From d2fc86bb00c0322a07469f29d3e1e4531c1ef624 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Fri, 4 Apr 2025 18:33:22 +0700 Subject: [PATCH 01/32] work for sell token --- .../accessors/mod.rs | 12 + .../accessors/v0/mod.rs | 6 + .../token_keeps_history_rules/v0/mod.rs | 10 +- .../batched_transition/mod.rs | 2 + .../token_direct_purchase_transition/mod.rs | 25 ++ .../v0/mod.rs | 41 ++++ .../v0/v0_methods.rs | 49 ++++ .../v0_methods.rs | 53 ++++ .../validate_structure/mod.rs | 36 +++ .../validate_structure/v0/mod.rs | 24 ++ .../mod.rs | 24 ++ .../v0/mod.rs | 57 +++++ .../v0/v0_methods.rs | 74 ++++++ .../v0_methods.rs | 89 +++++++ .../validate_structure/mod.rs | 36 +++ .../validate_structure/v0/mod.rs | 32 +++ .../document/batch_transition/mod.rs | 2 + packages/rs-dpp/src/tokens/mod.rs | 1 + packages/rs-dpp/src/tokens/token_event.rs | 21 ++ .../src/tokens/token_pricing_schedule.rs | 26 ++ .../batch/token/mod.rs | 1 + ...et_price_for_direct_purchase_transition.rs | 108 ++++++++ .../token_transition/mod.rs | 11 + .../mod.rs | 55 +++++ .../transformer.rs | 119 +++++++++ .../v0/mod.rs | 92 +++++++ .../v0/transformer.rs | 229 +++++++++++++++++ .../mod.rs | 73 ++++++ .../transformer.rs | 119 +++++++++ .../v0/mod.rs | 99 ++++++++ .../v0/transformer.rs | 231 ++++++++++++++++++ .../src/util/batch/drive_op_batch/token.rs | 9 + .../drive_abci_validation_versions/mod.rs | 4 + .../v1/token-history-contract-documents.json | 50 ++++ 34 files changed, 1818 insertions(+), 2 deletions(-) create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/v0_methods.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0_methods.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/mod.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/v0/mod.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/mod.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/v0_methods.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/mod.rs create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/v0/mod.rs create mode 100644 packages/rs-dpp/src/tokens/token_pricing_schedule.rs create mode 100644 packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs create mode 100644 packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/mod.rs create mode 100644 packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/transformer.rs create mode 100644 packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/mod.rs create mode 100644 packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs create mode 100644 packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/mod.rs create mode 100644 packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/transformer.rs create mode 100644 packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/mod.rs create mode 100644 packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/mod.rs index 928c105b9ff..0a6f6b64f15 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/mod.rs @@ -30,6 +30,12 @@ impl TokenKeepsHistoryRulesV0Getters for TokenKeepsHistoryRules { TokenKeepsHistoryRules::V0(v0) => v0.keeps_burning_history, } } + + fn keeps_direct_pricing_history(&self) -> bool { + match self { + TokenKeepsHistoryRules::V0(v0) => v0.keeps_direct_pricing_history, + } + } } /// Implementing `TokenKeepsHistoryRulesV0Setters` for `TokenKeepsHistoryRules` @@ -57,4 +63,10 @@ impl TokenKeepsHistoryRulesV0Setters for TokenKeepsHistoryRules { TokenKeepsHistoryRules::V0(v0) => v0.keeps_burning_history = value, } } + + fn set_keeps_direct_pricing_history(&mut self, value: bool) { + match self { + TokenKeepsHistoryRules::V0(v0) => v0.keeps_direct_pricing_history = value, + } + } } diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs index 791a5417002..660be3cf7c1 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs @@ -11,6 +11,9 @@ pub trait TokenKeepsHistoryRulesV0Getters { /// Returns whether burning history is kept. fn keeps_burning_history(&self) -> bool; + + /// Returns whether direct pricing history is kept. + fn keeps_direct_pricing_history(&self) -> bool; } /// Accessor trait for setters of `TokenKeepsHistoryRulesV0` @@ -26,4 +29,7 @@ pub trait TokenKeepsHistoryRulesV0Setters { /// Sets whether burning history is kept. fn set_keeps_burning_history(&mut self, value: bool); + + /// Sets whether direct pricing history is kept. + fn set_keeps_direct_pricing_history(&mut self, value: bool); } diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs index fd2a287f792..9c36924e156 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs @@ -25,6 +25,10 @@ pub struct TokenKeepsHistoryRulesV0 { /// Whether burning history is recorded. #[serde(default = "default_true")] pub keeps_burning_history: bool, + + /// Whether direct pricing history is recorded. + #[serde(default = "default_true")] + pub keeps_direct_pricing_history: bool, } impl Default for TokenKeepsHistoryRulesV0 { @@ -34,6 +38,7 @@ impl Default for TokenKeepsHistoryRulesV0 { keeps_freezing_history: true, keeps_minting_history: true, keeps_burning_history: true, + keeps_direct_pricing_history: true, } } } @@ -47,11 +52,12 @@ impl fmt::Display for TokenKeepsHistoryRulesV0 { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, - "TokenKeepsHistoryRulesV0 {{\n keeps_transfer_history: {},\n keeps_freezing_history: {},\n keeps_minting_history: {},\n keeps_burning_history: {}\n}}", + "TokenKeepsHistoryRulesV0 {{\n keeps_transfer_history: {},\n keeps_freezing_history: {},\n keeps_minting_history: {},\n keeps_burning_history: {},\n keeps_direct_pricing_history: {}\n}}", self.keeps_transfer_history, self.keeps_freezing_history, self.keeps_minting_history, - self.keeps_burning_history + self.keeps_burning_history, + self.keeps_direct_pricing_history, ) } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/mod.rs index 910572b72f9..ce18242f84c 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/mod.rs @@ -26,6 +26,8 @@ pub mod token_transfer_transition; pub mod token_transition; pub mod token_transition_action_type; pub mod token_unfreeze_transition; +pub mod token_direct_purchase_transition; +pub mod token_set_price_for_direct_purchase_transition; use crate::prelude::IdentityNonce; use crate::state_transition::batch_transition::batched_transition::document_transition::DocumentTransitionV0Methods; diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs new file mode 100644 index 00000000000..c3fd45cf9f2 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs @@ -0,0 +1,25 @@ +pub mod v0; +mod v0_methods; +pub mod validate_structure; + +use bincode::{Decode, Encode}; +use derive_more::{Display, From}; +#[cfg(feature = "state-transition-serde-conversion")] +use serde::{Deserialize, Serialize}; +pub use v0::TokenDirectPurchaseTransitionV0; + +#[derive(Debug, Clone, Encode, Decode, PartialEq, Display, From)] +#[cfg_attr( + feature = "state-transition-serde-conversion", + derive(Serialize, Deserialize) +)] +pub enum TokenDirectPurchaseTransition { + #[display("V0({})", "_0")] + V0(TokenDirectPurchaseTransitionV0), +} + +impl Default for TokenDirectPurchaseTransition { + fn default() -> Self { + TokenDirectPurchaseTransition::V0(TokenDirectPurchaseTransitionV0::default()) // since only v0 + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs new file mode 100644 index 00000000000..3499ceb6a69 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs @@ -0,0 +1,41 @@ +pub mod v0_methods; + +use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; +use bincode::{Decode, Encode}; +#[cfg(feature = "state-transition-serde-conversion")] +use serde::{Deserialize, Serialize}; +use std::fmt; +use crate::balances::credits::TokenAmount; +use crate::fee::Credits; + +/// The Identifier fields in [`TokenDirectPurchaseTransition`] +pub use super::super::document_base_transition::IDENTIFIER_FIELDS; + +#[derive(Debug, Clone, Default, Encode, Decode, PartialEq)] +#[cfg_attr( + feature = "state-transition-serde-conversion", + derive(Serialize, Deserialize), + serde(rename_all = "camelCase") +)] +pub struct TokenDirectPurchaseTransitionV0 { + /// Document Base Transition + #[cfg_attr(feature = "state-transition-serde-conversion", serde(flatten))] + pub base: TokenBaseTransition, + /// How many tokens should we buy. + pub token_count: TokenAmount, + /// Agreed price per token + /// The user will pay this amount times the token count + pub agreed_price_per_token: Credits, +} + +impl fmt::Display for TokenDirectPurchaseTransitionV0 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "Token DirectPurchase, base: {}, token count: {}, price per token {}", + self.base, + self.token_count, + self.agreed_price_per_token + ) + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/v0_methods.rs new file mode 100644 index 00000000000..d3f3c6225b4 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/v0_methods.rs @@ -0,0 +1,49 @@ +use crate::balances::credits::TokenAmount; +use crate::fee::Credits; +use crate::state_transition::batch_transition::token_base_transition::token_base_transition_accessors::TokenBaseTransitionAccessors; +use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; +use crate::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransitionV0; + +impl TokenBaseTransitionAccessors for TokenDirectPurchaseTransitionV0 { + fn base(&self) -> &TokenBaseTransition { + &self.base + } + + fn base_mut(&mut self) -> &mut TokenBaseTransition { + &mut self.base + } + + fn set_base(&mut self, base: TokenBaseTransition) { + self.base = base; + } +} + +pub trait TokenDirectPurchaseTransitionV0Methods: + TokenBaseTransitionAccessors +{ + fn token_count(&self) -> TokenAmount; + + fn set_token_count(&mut self, token_count: TokenAmount); + + fn agreed_price_per_token(&self) -> Credits; + + fn set_agreed_price_per_token(&mut self, credits: Credits); +} + +impl TokenDirectPurchaseTransitionV0Methods for TokenDirectPurchaseTransitionV0 { + fn token_count(&self) -> TokenAmount { + self.token_count + } + + fn set_token_count(&mut self, token_count: TokenAmount) { + self.token_count = token_count; + } + + fn agreed_price_per_token(&self) -> Credits { + self.agreed_price_per_token + } + + fn set_agreed_price_per_token(&mut self, credits: Credits) { + self.agreed_price_per_token = credits; + } +} \ No newline at end of file diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0_methods.rs new file mode 100644 index 00000000000..f58f7f99bcd --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0_methods.rs @@ -0,0 +1,53 @@ +use crate::balances::credits::TokenAmount; +use crate::fee::Credits; +use crate::state_transition::batch_transition::token_base_transition::token_base_transition_accessors::TokenBaseTransitionAccessors; +use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; +use crate::state_transition::batch_transition::token_direct_purchase_transition::v0::v0_methods::TokenDirectPurchaseTransitionV0Methods; +use crate::state_transition::batch_transition::TokenDirectPurchaseTransition; + +impl TokenBaseTransitionAccessors for TokenDirectPurchaseTransition { + fn base(&self) -> &TokenBaseTransition { + match self { + TokenDirectPurchaseTransition::V0(v0) => &v0.base, + } + } + + fn base_mut(&mut self) -> &mut TokenBaseTransition { + match self { + TokenDirectPurchaseTransition::V0(v0) => &mut v0.base, + } + } + + fn set_base(&mut self, base: TokenBaseTransition) { + match self { + TokenDirectPurchaseTransition::V0(v0) => v0.base = base, + } + } +} + +impl TokenDirectPurchaseTransitionV0Methods for TokenDirectPurchaseTransition { + + fn token_count(&self) -> TokenAmount { + match self { + TokenDirectPurchaseTransition::V0(v0) => v0.token_count(), + } + } + + fn set_token_count(&mut self, token_count: TokenAmount) { + match self { + TokenDirectPurchaseTransition::V0(v0) => v0.set_token_count(token_count), + } + } + + fn agreed_price_per_token(&self) -> Credits { + match self { + TokenDirectPurchaseTransition::V0(v0) => v0.agreed_price_per_token(), + } + } + + fn set_agreed_price_per_token(&mut self, credits: Credits) { + match self { + TokenDirectPurchaseTransition::V0(v0) => v0.set_agreed_price_per_token(credits), + } + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/mod.rs new file mode 100644 index 00000000000..cfb3fbafd42 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/mod.rs @@ -0,0 +1,36 @@ +use crate::state_transition::batch_transition::token_direct_purchase_transition::validate_structure::v0::TokenDirectPurchaseTransitionActionStructureValidationV0; +use crate::state_transition::batch_transition::TokenDirectPurchaseTransition; +use crate::validation::SimpleConsensusValidationResult; +use crate::ProtocolError; +use platform_version::version::PlatformVersion; + +mod v0; + +pub trait TokenDirectPurchaseTransitionStructureValidation { + fn validate_structure( + &self, + platform_version: &PlatformVersion, + ) -> Result; +} + +impl TokenDirectPurchaseTransitionStructureValidation for TokenDirectPurchaseTransition { + fn validate_structure( + &self, + platform_version: &PlatformVersion, + ) -> Result { + match platform_version + .drive_abci + .validation_and_processing + .state_transitions + .batch_state_transition + .token_direct_purchase_transition_structure_validation + { + 0 => self.validate_structure_v0(), + version => Err(ProtocolError::UnknownVersionMismatch { + method: "TokenDirectPurchaseTransition::validate_structure".to_string(), + known_versions: vec![0], + received: version, + }), + } + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/v0/mod.rs new file mode 100644 index 00000000000..4e56d944605 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/v0/mod.rs @@ -0,0 +1,24 @@ +use crate::consensus::basic::token::InvalidTokenAmountError; +use crate::consensus::basic::BasicError; +use crate::consensus::ConsensusError; +use crate::data_contract::associated_token::token_perpetual_distribution::distribution_function::MAX_DISTRIBUTION_PARAM; +use crate::state_transition::batch_transition::TokenDirectPurchaseTransition; +use crate::validation::SimpleConsensusValidationResult; +use crate::ProtocolError; +use crate::state_transition::batch_transition::token_direct_purchase_transition::v0::v0_methods::TokenDirectPurchaseTransitionV0Methods; + +pub(super) trait TokenDirectPurchaseTransitionActionStructureValidationV0 { + fn validate_structure_v0(&self) -> Result; +} +impl TokenDirectPurchaseTransitionActionStructureValidationV0 for TokenDirectPurchaseTransition { + fn validate_structure_v0(&self) -> Result { + if self.token_count() > MAX_DISTRIBUTION_PARAM { + return Ok(SimpleConsensusValidationResult::new_with_error( + ConsensusError::BasicError(BasicError::InvalidTokenAmountError( + InvalidTokenAmountError::new(MAX_DISTRIBUTION_PARAM, self.token_count()), + )), + )); + } + Ok(SimpleConsensusValidationResult::default()) + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs new file mode 100644 index 00000000000..e42c7c3e5f8 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs @@ -0,0 +1,24 @@ +pub mod v0; +mod v0_methods; +pub mod validate_structure; + +use bincode::{Decode, Encode}; +use derive_more::{Display, From}; +#[cfg(feature = "state-transition-serde-conversion")] +use serde::{Deserialize, Serialize}; +pub use v0::TokenSetPriceForDirectPurchaseTransitionV0; + +#[derive(Debug, Clone, Encode, Decode, PartialEq, Display, From)] +#[cfg_attr( + feature = "state-transition-serde-conversion", + derive(Serialize, Deserialize) +)] +pub enum TokenSetPriceForDirectPurchaseTransition { + #[display("V0({})", "_0")] + V0(TokenSetPriceForDirectPurchaseTransitionV0), +} +impl Default for TokenSetPriceForDirectPurchaseTransition { + fn default() -> Self { + TokenSetPriceForDirectPurchaseTransition::V0(TokenSetPriceForDirectPurchaseTransitionV0::default()) // since only v0 + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/mod.rs new file mode 100644 index 00000000000..f1035c0df13 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/mod.rs @@ -0,0 +1,57 @@ +pub mod v0_methods; + +use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; +use bincode::{Decode, Encode}; +#[cfg(feature = "state-transition-serde-conversion")] +use serde::{Deserialize, Serialize}; +use std::fmt; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; +/// The Identifier fields in [`TokenSetPriceForDirectPurchaseTransition`] +pub use super::super::document_base_transition::IDENTIFIER_FIELDS; + +#[derive(Debug, Clone, Default, Encode, Decode, PartialEq)] +#[cfg_attr( + feature = "state-transition-serde-conversion", + derive(Serialize, Deserialize), + serde(rename_all = "camelCase") +)] +pub struct TokenSetPriceForDirectPurchaseTransitionV0 { + /// Document Base Transition + #[cfg_attr(feature = "state-transition-serde-conversion", serde(flatten))] + pub base: TokenBaseTransition, + #[cfg_attr( + feature = "state-transition-serde-conversion", + serde(rename = "issuedToIdentityId") + )] + /// What should be the price for a single token + /// Setting this to None makes it no longer purchasable + pub price: Option, + /// The public note + #[cfg_attr( + feature = "state-transition-serde-conversion", + serde(rename = "publicNote") + )] + pub public_note: Option, +} + +impl fmt::Display for TokenSetPriceForDirectPurchaseTransitionV0 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let price_str = match &self.price { + Some(p) => p.to_string(), + None => "None".to_string(), + }; + + let note_str = match &self.public_note { + Some(note) => note, + None => "None", + }; + + write!( + f, + "Token Set Price for Direct Purchase, base: {}, price: {}, public note: {}", + self.base, + price_str, + note_str + ) + } +} \ No newline at end of file diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/v0_methods.rs new file mode 100644 index 00000000000..1ebabe0d76a --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/v0_methods.rs @@ -0,0 +1,74 @@ +use platform_value::Identifier; +use crate::state_transition::batch_transition::batched_transition::multi_party_action::AllowedAsMultiPartyAction; +use crate::state_transition::batch_transition::token_base_transition::token_base_transition_accessors::TokenBaseTransitionAccessors; +use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; +use crate::state_transition::batch_transition::token_base_transition::v0::v0_methods::TokenBaseTransitionV0Methods; +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransitionV0; +use crate::state_transition::batch_transition::TokenSetPriceForDirectPurchaseTransition; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; + +impl TokenBaseTransitionAccessors for TokenSetPriceForDirectPurchaseTransitionV0 { + fn base(&self) -> &TokenBaseTransition { + &self.base + } + + fn base_mut(&mut self) -> &mut TokenBaseTransition { + &mut self.base + } + + fn set_base(&mut self, base: TokenBaseTransition) { + self.base = base; + } +} + +pub trait TokenSetPriceForDirectPurchaseTransitionV0Methods: + TokenBaseTransitionAccessors + AllowedAsMultiPartyAction +{ + fn price(&self) -> Option; + + fn set_price(&mut self, price: Option); + + /// Returns the `public_note` field of the `TokenSetPriceForDirectPurchaseTransitionV0`. + fn public_note(&self) -> Option<&String>; + + /// Returns the owned `public_note` field of the `TokenSetPriceForDirectPurchaseTransitionV0`. + fn public_note_owned(self) -> Option; + + /// Sets the value of the `public_note` field in the `TokenSetPriceForDirectPurchaseTransitionV0`. + fn set_public_note(&mut self, public_note: Option); +} + +impl TokenSetPriceForDirectPurchaseTransitionV0Methods for TokenSetPriceForDirectPurchaseTransitionV0 { + fn price(&self) -> Option<&TokenPricingSchedule> { + self.price.as_ref() + } + + fn set_price(&mut self, price: Option) { + self.price = price; + } + + fn public_note(&self) -> Option<&String> { + self.public_note.as_ref() + } + + fn public_note_owned(self) -> Option { + self.public_note + } + + fn set_public_note(&mut self, public_note: Option) { + self.public_note = public_note; + } +} + +impl AllowedAsMultiPartyAction for TokenSetPriceForDirectPurchaseTransitionV0 { + fn calculate_action_id(&self, owner_id: Identifier) -> Identifier { + let TokenSetPriceForDirectPurchaseTransitionV0 { base, price, .. } = self; + + TokenSetPriceForDirectPurchaseTransition::calculate_action_id_with_fields( + base.token_id().as_bytes(), + owner_id.as_bytes(), + base.identity_contract_nonce(), + price.as_ref(), + ) + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs new file mode 100644 index 00000000000..d7b08f98238 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs @@ -0,0 +1,89 @@ +use platform_value::Identifier; +use crate::fee::Credits; +use crate::prelude::IdentityNonce; +use crate::state_transition::batch_transition::batched_transition::multi_party_action::AllowedAsMultiPartyAction; +use crate::state_transition::batch_transition::token_base_transition::token_base_transition_accessors::TokenBaseTransitionAccessors; +use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransition; +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::v0::v0_methods::TokenSetPriceForDirectPurchaseTransitionV0Methods; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; +use crate::util::hash::hash_double; + +impl TokenBaseTransitionAccessors for TokenSetPriceForDirectPurchaseTransition { + fn base(&self) -> &TokenBaseTransition { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => &v0.base, + } + } + + fn base_mut(&mut self) -> &mut TokenBaseTransition { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => &mut v0.base, + } + } + + fn set_base(&mut self, base: TokenBaseTransition) { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.base = base, + } + } +} + +impl TokenSetPriceForDirectPurchaseTransitionV0Methods for TokenSetPriceForDirectPurchaseTransition { + fn price(&self) -> Option { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.price(), + } + } + + fn set_price(&mut self, price: Option) { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.set_price(price), + } + } + + fn public_note(&self) -> Option<&String> { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.public_note(), + } + } + + fn public_note_owned(self) -> Option { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.public_note_owned(), + } + } + + fn set_public_note(&mut self, public_note: Option) { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.set_public_note(public_note), + } + } +} + +impl AllowedAsMultiPartyAction for TokenSetPriceForDirectPurchaseTransition { + fn calculate_action_id(&self, owner_id: Identifier) -> Identifier { + match self { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.calculate_action_id(owner_id), + } + } +} + +impl TokenSetPriceForDirectPurchaseTransition { + pub fn calculate_action_id_with_fields( + token_id: &[u8; 32], + owner_id: &[u8; 32], + identity_contract_nonce: IdentityNonce, + price_per_token: Option<&TokenPricingSchedule>, + ) -> Identifier { + let mut bytes = b"action_token_set_price_for_direct_purchase".to_vec(); + bytes.extend_from_slice(token_id); + bytes.extend_from_slice(owner_id); + bytes.extend_from_slice(&identity_contract_nonce.to_be_bytes()); + if let Some(price_per_token) = price_per_token { + bytes.extend_from_slice(&price_per_token.minimum_purchase_amount_and_price().1.to_be_bytes()); + } + + hash_double(bytes).into() + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/mod.rs new file mode 100644 index 00000000000..9f51edc1b40 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/mod.rs @@ -0,0 +1,36 @@ +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::validate_structure::v0::TokenSetPriceForDirectPurchaseTransitionActionStructureValidationV0; +use crate::state_transition::batch_transition::TokenSetPriceForDirectPurchaseTransition; +use crate::validation::SimpleConsensusValidationResult; +use crate::ProtocolError; +use platform_version::version::PlatformVersion; + +mod v0; + +pub trait TokenSetPriceForDirectPurchaseTransitionStructureValidation { + fn validate_structure( + &self, + platform_version: &PlatformVersion, + ) -> Result; +} + +impl TokenSetPriceForDirectPurchaseTransitionStructureValidation for TokenSetPriceForDirectPurchaseTransition { + fn validate_structure( + &self, + platform_version: &PlatformVersion, + ) -> Result { + match platform_version + .drive_abci + .validation_and_processing + .state_transitions + .batch_state_transition + .token_set_price_for_direct_purchase_transition_structure_validation + { + 0 => self.validate_structure_v0(), + version => Err(ProtocolError::UnknownVersionMismatch { + method: "TokenSetPriceForDirectPurchaseTransition::validate_structure".to_string(), + known_versions: vec![0], + received: version, + }), + } + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/v0/mod.rs new file mode 100644 index 00000000000..52268a39220 --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/v0/mod.rs @@ -0,0 +1,32 @@ +use crate::consensus::basic::token::InvalidTokenNoteTooBigError; +use crate::consensus::basic::BasicError; +use crate::consensus::ConsensusError; +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::v0::v0_methods::TokenSetPriceForDirectPurchaseTransitionV0Methods; +use crate::state_transition::batch_transition::TokenSetPriceForDirectPurchaseTransition; +use crate::tokens::MAX_TOKEN_NOTE_LEN; +use crate::validation::SimpleConsensusValidationResult; +use crate::ProtocolError; + +pub(super) trait TokenSetPriceForDirectPurchaseTransitionActionStructureValidationV0 { + fn validate_structure_v0(&self) -> Result; +} +impl TokenSetPriceForDirectPurchaseTransitionActionStructureValidationV0 for TokenSetPriceForDirectPurchaseTransition { + fn validate_structure_v0(&self) -> Result { + // There is no need to validate the price because setting a price that is too high just makes the token non purchasable + + if let Some(public_note) = self.public_note() { + if public_note.len() > MAX_TOKEN_NOTE_LEN { + return Ok(SimpleConsensusValidationResult::new_with_error( + ConsensusError::BasicError(BasicError::InvalidTokenNoteTooBigError( + InvalidTokenNoteTooBigError::new( + MAX_TOKEN_NOTE_LEN as u32, + "public_note", + public_note.len() as u32, + ), + )), + )); + } + } + Ok(SimpleConsensusValidationResult::default()) + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/mod.rs index 4beb0386c26..b2be9517500 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/mod.rs @@ -27,6 +27,8 @@ pub use self::batched_transition::{ token_mint_transition::TokenMintTransition, token_transfer_transition, token_transfer_transition::TokenTransferTransition, token_unfreeze_transition, token_unfreeze_transition::TokenUnfreezeTransition, + token_direct_purchase_transition, token_direct_purchase_transition::TokenBuyTransition, + token_set_price_for_direct_purchase_transition, token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransition }; use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize, PlatformSignable}; diff --git a/packages/rs-dpp/src/tokens/mod.rs b/packages/rs-dpp/src/tokens/mod.rs index c6da28ccd0b..2c46fd7b0cd 100644 --- a/packages/rs-dpp/src/tokens/mod.rs +++ b/packages/rs-dpp/src/tokens/mod.rs @@ -13,6 +13,7 @@ pub mod status; pub mod token_amount_on_contract_token; pub mod token_event; pub mod token_payment_info; +pub mod token_pricing_schedule; pub const MAX_TOKEN_NOTE_LEN: usize = 2048; pub type SharedEncryptedNote = (SenderKeyIndex, RecipientKeyIndex, Vec); diff --git a/packages/rs-dpp/src/tokens/token_event.rs b/packages/rs-dpp/src/tokens/token_event.rs index 618daaa2355..5e670129a26 100644 --- a/packages/rs-dpp/src/tokens/token_event.rs +++ b/packages/rs-dpp/src/tokens/token_event.rs @@ -26,6 +26,7 @@ use crate::serialization::PlatformSerializableWithPlatformVersion; use crate::tokens::emergency_action::TokenEmergencyAction; use crate::tokens::SharedEncryptedNote; use crate::ProtocolError; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; pub type RecipientIdentifier = Identifier; pub type FrozenIdentifier = Identifier; @@ -54,6 +55,7 @@ pub enum TokenEvent { ), EmergencyAction(TokenEmergencyAction, TokenEventPublicNote), ConfigUpdate(TokenConfigurationChangeItem, TokenEventPublicNote), + SetPriceForDirectPurchase(Option, TokenEventPublicNote) } impl TokenEvent { @@ -68,6 +70,7 @@ impl TokenEvent { TokenEvent::Claim(..) => "claim", TokenEvent::EmergencyAction(..) => "emergencyAction", TokenEvent::ConfigUpdate(..) => "configUpdate", + TokenEvent::SetPriceForDirectPurchase(..) => "setPriceForDirectPurchase", } } @@ -245,6 +248,24 @@ impl TokenEvent { } properties } + TokenEvent::SetPriceForDirectPurchase(price, note) => { + let mut properties = BTreeMap::from([ + ("tokenId".to_string(), token_id.into()), + ]); + + if let Some(price_schedule) = price { + properties.insert( + "priceSchedule".to_string(), + price_schedule.serialize_consume_to_bytes_with_platform_version(platform_version)?.into(), + ); + } + + if let Some(note) = note { + properties.insert("note".to_string(), note.into()); + } + + properties + } }; let document: Document = DocumentV0 { diff --git a/packages/rs-dpp/src/tokens/token_pricing_schedule.rs b/packages/rs-dpp/src/tokens/token_pricing_schedule.rs new file mode 100644 index 00000000000..25b09e2a5e9 --- /dev/null +++ b/packages/rs-dpp/src/tokens/token_pricing_schedule.rs @@ -0,0 +1,26 @@ +use std::collections::BTreeMap; +use bincode_derive::{Decode, Encode}; +use derive_more::Display; +use serde::{Deserialize, Serialize}; +use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; +use crate::balances::credits::TokenAmount; +use crate::fee::Credits; + +#[derive(Debug, Clone, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, Display, PlatformSerialize, PlatformDeserialize)] +#[cfg_attr( + feature = "state-transition-serde-conversion", + derive(Serialize, Deserialize) +)] +pub enum TokenPricingSchedule { + SinglePrice(Credits), + SetPrices(BTreeMap), +} + +impl TokenPricingSchedule { + pub fn minimum_purchase_amount_and_price(&self) -> (TokenAmount, Credits) { + match self { + TokenPricingSchedule::SinglePrice(price) => (1, *price), + TokenPricingSchedule::SetPrices(prices) => prices.first_key_value().map(|(amount, cost)| (*amount, *cost)).unwrap_or_default() + } + } +} diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs index d805cdc4b87..dd50e6788bf 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs @@ -8,3 +8,4 @@ mod token_mint_transition; mod token_transfer_transition; mod token_transition; mod token_unfreeze_transition; +mod token_set_price_for_direct_purchase_transition; diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs new file mode 100644 index 00000000000..8783a9d5460 --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs @@ -0,0 +1,108 @@ +use dpp::block::epoch::Epoch; +use dpp::data_contract::associated_token::token_configuration::accessors::v0::TokenConfigurationV0Getters; +use dpp::data_contract::associated_token::token_keeps_history_rules::accessors::v0::TokenKeepsHistoryRulesV0Getters; +use dpp::group::action_event::GroupActionEvent; +use dpp::group::group_action::GroupAction; +use dpp::group::group_action::v0::GroupActionV0; +use dpp::group::GroupStateTransitionResolvedInfo; +use dpp::identifier::Identifier; +use dpp::tokens::token_event::TokenEvent; +use platform_version::version::PlatformVersion; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::state_transition_action::action_convert_to_operations::batch::DriveHighLevelBatchOperationConverter; +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::TokenBaseTransitionActionAccessorsV0; +use crate::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::{TokenSetPriceForDirectPurchaseTransitionAction, TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0}; +use crate::util::batch::{DriveOperation, IdentityOperationType}; +use crate::util::batch::drive_op_batch::{GroupOperationType, TokenOperationType}; +use crate::util::batch::DriveOperation::{GroupOperation, IdentityOperation, TokenOperation}; + +impl DriveHighLevelBatchOperationConverter for TokenSetPriceForDirectPurchaseTransitionAction { + fn into_high_level_batch_drive_operations<'b>( + self, + _epoch: &Epoch, + owner_id: Identifier, + platform_version: &PlatformVersion, + ) -> Result>, Error> { + match platform_version + .drive + .methods + .state_transitions + .convert_to_high_level_operations + .token_mint_transition + { + 0 => { + let data_contract_id = self.base().data_contract_id(); + + let identity_contract_nonce = self.base().identity_contract_nonce(); + + let mut ops = vec![IdentityOperation( + IdentityOperationType::UpdateIdentityContractNonce { + identity_id: owner_id.into_buffer(), + contract_id: data_contract_id.into_buffer(), + nonce: identity_contract_nonce, + }, + )]; + + if let Some(GroupStateTransitionResolvedInfo { + group_contract_position, + action_id, + action_is_proposer, + signer_power, + .. + }) = self.base().store_in_group() + { + let event = TokenEvent::SetPriceForDirectPurchase( + self.price(), + self.public_note().cloned(), + ); + + let initialize_with_insert_action_info = if *action_is_proposer { + Some(GroupAction::V0(GroupActionV0 { + event: GroupActionEvent::TokenEvent(event), + })) + } else { + None + }; + + ops.push(GroupOperation(GroupOperationType::AddGroupAction { + contract_id: data_contract_id, + group_contract_position: *group_contract_position, + initialize_with_insert_action_info, + action_id: *action_id, + signer_identity_id: owner_id, + signer_power: *signer_power, + })); + } + + if self.base().perform_action() { + ops.push(TokenOperation(TokenOperationType::TokenSetPriceForDirectPurchase { + token_id: self.token_id(), + price: self.price(), + })); + + let token_configuration = self.base().token_configuration()?; + if token_configuration.keeps_history().keeps_direct_pricing_history() { + ops.push(TokenOperation(TokenOperationType::TokenHistory { + token_id: self.token_id(), + owner_id, + nonce: identity_contract_nonce, + event: TokenEvent::SetPriceForDirectPurchase( + self.price(), + self.public_note_owned(), + ), + })); + } + } + + Ok(ops) + } + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "TokenSetPriceForDirectPurchaseTransitionAction::into_high_level_document_drive_operations" + .to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/mod.rs index bbb5862592c..c536d1f3b21 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/mod.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/mod.rs @@ -23,6 +23,12 @@ pub mod token_emergency_action_transition_action; /// token_claim_transition_action pub mod token_claim_transition_action; +/// token_direct_purchase_transition_action +pub mod token_direct_purchase_transition_action; + +/// token_set_price_for_direct_purchase_transition_action +pub mod token_set_price_for_direct_purchase_transition_action; + use derive_more::From; use dpp::block::block_info::BlockInfo; use dpp::data_contract::accessors::v0::DataContractV0Getters; @@ -48,6 +54,7 @@ use crate::state_transition_action::batch::batched_transition::token_transition: use crate::state_transition_action::batch::batched_transition::token_transition::token_destroy_frozen_funds_transition_action::TokenDestroyFrozenFundsTransitionAction; use crate::state_transition_action::batch::batched_transition::token_transition::token_destroy_frozen_funds_transition_action::TokenDestroyFrozenFundsTransitionActionAccessorsV0; use crate::state_transition_action::batch::batched_transition::token_transition::token_claim_transition_action::{TokenClaimTransitionAction, TokenClaimTransitionActionAccessorsV0}; +use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::TokenDirectPurchaseTransitionAction; /// token action #[derive(Debug, Clone, From)] @@ -70,6 +77,10 @@ pub enum TokenTransitionAction { DestroyFrozenFundsAction(TokenDestroyFrozenFundsTransitionAction), /// update the token configuration ConfigUpdateAction(TokenConfigUpdateTransitionAction), + /// purchases the token from the contract owner + DirectPurchaseAction(TokenDirectPurchaseTransitionAction), + /// sets the price for direct purchase of the token + SetPriceForDirectPurchaseAction(TokenSetPriceForDirectPurchaseTransitionAction), } impl TokenTransitionAction { diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/mod.rs new file mode 100644 index 00000000000..9335cd17ce7 --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/mod.rs @@ -0,0 +1,55 @@ +use derive_more::From; +use dpp::balances::credits::TokenAmount; +use dpp::fee::Credits; + +/// transformer module for token issuance transition action +pub mod transformer; +mod v0; + +pub use v0::*; + +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::TokenBaseTransitionAction; + +/// Token issuance transition action +#[derive(Debug, Clone, From)] +pub enum TokenDirectPurchaseTransitionAction { + /// v0 + V0(TokenDirectPurchaseTransitionActionV0), +} + +impl TokenDirectPurchaseTransitionActionAccessorsV0 for TokenDirectPurchaseTransitionAction { + fn base(&self) -> &TokenBaseTransitionAction { + match self { + TokenDirectPurchaseTransitionAction::V0(v0) => &v0.base, + } + } + + fn base_owned(self) -> TokenBaseTransitionAction { + match self { + TokenDirectPurchaseTransitionAction::V0(v0) => v0.base, + } + } + fn token_count(&self) -> TokenAmount { + match self { + TokenDirectPurchaseTransitionAction::V0(v0) => v0.token_count, + } + } + + fn set_token_count(&mut self, amount: TokenAmount) { + match self { + TokenDirectPurchaseTransitionAction::V0(v0) => v0.token_count = amount, + } + } + + fn agreed_price_per_token(&self) -> Credits { + match self { + TokenDirectPurchaseTransitionAction::V0(v0) => v0.agreed_price_per_token, + } + } + + fn set_agreed_price_per_token(&mut self, agreed_price: Credits) { + match self { + TokenDirectPurchaseTransitionAction::V0(v0) => v0.agreed_price_per_token = agreed_price, + } + } +} diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/transformer.rs new file mode 100644 index 00000000000..30138f16ecd --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/transformer.rs @@ -0,0 +1,119 @@ +use dpp::platform_value::Identifier; +use dpp::ProtocolError; +use grovedb::TransactionArg; +use std::sync::Arc; +use dpp::block::block_info::BlockInfo; +use dpp::fee::fee_result::FeeResult; +use dpp::prelude::{ConsensusValidationResult, UserFeeIncrease}; +use crate::drive::contract::DataContractFetchInfo; +use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::{TokenDirectPurchaseTransitionActionV0, TokenDirectPurchaseTransitionAction}; +use dpp::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransition; +use platform_version::version::PlatformVersion; +use crate::drive::Drive; +use crate::error::Error; +use crate::state_transition_action::batch::BatchedTransitionAction; + +/// Implement methods to transform a `TokenDirectPurchaseTransition` into a `TokenDirectPurchaseTransitionAction`. +impl TokenDirectPurchaseTransitionAction { + /// Transform a `TokenDirectPurchaseTransition` into a `TokenDirectPurchaseTransitionAction` using the provided data contract lookup. + /// + /// # Arguments + /// + /// * `drive` - A reference to the `Drive` instance used for accessing the system. + /// * `owner_id` - The identifier of the owner initiating the direct_purchase transition. + /// * `transaction` - The transaction argument used for state changes. + /// * `value` - A `TokenDirectPurchaseTransition` instance. + /// * `approximate_without_state_for_costs` - A flag indicating whether to approximate state costs without full state. + /// * `drive_operations` - A mutable reference to the vector of low-level operations that need to be performed. + /// * `get_data_contract` - A closure that fetches the `DataContractFetchInfo` given a contract ID. + /// * `platform_version` - The platform version for the context in which the transition is being executed. + /// + /// # Returns + /// + /// * `Result<(ConsensusValidationResult, FeeResult), Error>` - A `TokenDirectPurchaseTransitionAction` if successful, otherwise `ProtocolError`. + #[allow(clippy::too_many_arguments)] + pub fn try_from_token_direct_purchase_transition_with_contract_lookup( + drive: &Drive, + owner_id: Identifier, + value: TokenDirectPurchaseTransition, + approximate_without_state_for_costs: bool, + transaction: TransactionArg, + block_info: &BlockInfo, + user_fee_increase: UserFeeIncrease, + get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, + platform_version: &PlatformVersion, + ) -> Result< + ( + ConsensusValidationResult, + FeeResult, + ), + Error, + > { + match value { + TokenDirectPurchaseTransition::V0(v0) => { + TokenDirectPurchaseTransitionActionV0::try_from_token_direct_purchase_transition_with_contract_lookup( + drive, + owner_id, + v0, + approximate_without_state_for_costs, + transaction, + block_info, + user_fee_increase, + get_data_contract, + platform_version, + ) + } + } + } + + /// Transform a borrowed `TokenDirectPurchaseTransition` into a `TokenDirectPurchaseTransitionAction` using the provided data contract lookup. + /// + /// # Arguments + /// + /// * `drive` - A reference to the `Drive` instance used for accessing the system. + /// * `owner_id` - The identifier of the owner initiating the direct_purchase transition. + /// * `transaction` - The transaction argument used for state changes. + /// * `value` - A reference to a `TokenDirectPurchaseTransition`. + /// * `approximate_without_state_for_costs` - A flag indicating whether to approximate state costs without full state. + /// * `drive_operations` - A mutable reference to the vector of low-level operations that need to be performed. + /// * `get_data_contract` - A closure that fetches the `DataContractFetchInfo` given a contract ID. + /// * `platform_version` - The platform version for the context in which the transition is being executed. + /// + /// # Returns + /// + #[allow(clippy::too_many_arguments)] + /// * `Result<(ConsensusValidationResult, FeeResult), Error>` - A `TokenDirectPurchaseTransitionAction` if successful, otherwise `ProtocolError`. + pub fn try_from_borrowed_token_direct_purchase_transition_with_contract_lookup( + drive: &Drive, + owner_id: Identifier, + value: &TokenDirectPurchaseTransition, + approximate_without_state_for_costs: bool, + transaction: TransactionArg, + block_info: &BlockInfo, + user_fee_increase: UserFeeIncrease, + get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, + platform_version: &PlatformVersion, + ) -> Result< + ( + ConsensusValidationResult, + FeeResult, + ), + Error, + > { + match value { + TokenDirectPurchaseTransition::V0(v0) => { + TokenDirectPurchaseTransitionActionV0::try_from_borrowed_token_direct_purchase_transition_with_contract_lookup( + drive, + owner_id, + v0, + approximate_without_state_for_costs, + transaction, + block_info, + user_fee_increase, + get_data_contract, + platform_version, + ) + } + } + } +} diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/mod.rs new file mode 100644 index 00000000000..b656861515f --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/mod.rs @@ -0,0 +1,92 @@ +mod transformer; + +use std::sync::Arc; +use dpp::balances::credits::TokenAmount; +use dpp::fee::Credits; +use dpp::identifier::Identifier; +use crate::drive::contract::DataContractFetchInfo; +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::{TokenBaseTransitionAction, TokenBaseTransitionActionAccessorsV0}; + +/// Token issuance transition action v0 +#[derive(Debug, Clone)] +pub struct TokenDirectPurchaseTransitionActionV0 { + /// Base token transition action + pub base: TokenBaseTransitionAction, + /// How many tokens should we buy. + pub token_count: TokenAmount, + /// Agreed price per token + /// The user will pay this amount times the token count + pub agreed_price_per_token: Credits, +} + +/// Accessors for `TokenIssuanceTransitionActionV0` +pub trait TokenDirectPurchaseTransitionActionAccessorsV0 { + /// Returns a reference to the base token transition action + fn base(&self) -> &TokenBaseTransitionAction; + + /// Consumes self and returns the base token transition action + fn base_owned(self) -> TokenBaseTransitionAction; + + /// Returns the amount of tokens to purchase + fn token_count(&self) -> TokenAmount; + + /// Sets the amount of tokens to purchase + fn set_token_count(&mut self, amount: TokenAmount); + + /// The agreed price per token + fn agreed_price_per_token(&self) -> Credits; + + /// Sets the agreed price per token + fn set_agreed_price_per_token(&mut self, agreed_price: Credits); + + /// Returns the token position in the contract + fn token_position(&self) -> u16 { + self.base().token_position() + } + + /// Returns the token ID + fn token_id(&self) -> Identifier { + self.base().token_id() + } + + /// Returns the data contract ID + fn data_contract_id(&self) -> Identifier { + self.base().data_contract_id() + } + + /// Returns a reference to the data contract fetch info + fn data_contract_fetch_info_ref(&self) -> &Arc { + self.base().data_contract_fetch_info_ref() + } + + /// Returns the data contract fetch info + fn data_contract_fetch_info(&self) -> Arc { + self.base().data_contract_fetch_info() + } +} + +impl TokenDirectPurchaseTransitionActionAccessorsV0 for TokenDirectPurchaseTransitionActionV0 { + fn base(&self) -> &TokenBaseTransitionAction { + &self.base + } + + fn base_owned(self) -> TokenBaseTransitionAction { + self.base + } + + fn token_count(&self) -> TokenAmount { + self.token_count + } + + fn set_token_count(&mut self, amount: TokenAmount) { + self.token_count = amount; + } + + fn agreed_price_per_token(&self) -> Credits { + self.agreed_price_per_token + } + + fn set_agreed_price_per_token(&mut self, agreed_price: Credits) { + self.agreed_price_per_token = agreed_price; + } +} diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs new file mode 100644 index 00000000000..93911d77729 --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs @@ -0,0 +1,229 @@ +use std::sync::Arc; +use grovedb::TransactionArg; +use dpp::block::block_info::BlockInfo; +use dpp::identifier::Identifier; +use dpp::state_transition::batch_transition::token_direct_purchase_transition::v0::TokenDirectPurchaseTransitionV0; +use dpp::ProtocolError; +use crate::drive::contract::DataContractFetchInfo; +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::TokenBaseTransitionAction; +use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::v0::TokenDirectPurchaseTransitionActionV0; +use dpp::fee::fee_result::FeeResult; +use dpp::prelude::{ConsensusValidationResult, UserFeeIncrease}; +use platform_version::version::PlatformVersion; +use crate::drive::Drive; +use crate::error::Error; +use crate::state_transition_action::batch::batched_transition::token_transition::TokenTransitionAction; +use crate::state_transition_action::batch::BatchedTransitionAction; +use crate::state_transition_action::system::bump_identity_data_contract_nonce_action::BumpIdentityDataContractNonceAction; + +impl TokenDirectPurchaseTransitionActionV0 { + /// Converts a `TokenDirectPurchaseTransitionV0` into a `TokenDirectPurchaseTransitionActionV0` using the provided contract lookup. + /// + /// This method processes the token direct_purchase transition and returns the corresponding transition action + /// while looking up necessary data contracts and applying the relevant logic for direct purchasing. + /// + /// # Arguments + /// + /// * `drive` - A reference to the `Drive` instance which handles data storage and retrieval. + /// * `owner_id` - The identifier of the owner initiating the direct_purchaseing transition. This is typically the identity + /// performing the transaction, such as the user's ID. + /// * `transaction` - A transaction context that includes the necessary state and other details for the transition. + /// * `value` - The `TokenDirectPurchaseTransitionV0` struct containing the transition data, including token amount and recipient. + /// * `approximate_without_state_for_costs` - A flag to determine if costs should be approximated without considering + /// the full state for the operation. Useful for optimizing the transaction cost calculations. + /// * `block_info` - Information about the current block to calculate fees. + /// * `get_data_contract` - A closure function that takes a contract identifier and returns a `DataContractFetchInfo` + /// containing the data contract details, including token configurations. + /// * `platform_version` - A reference to the platform version, ensuring the transition respects version-specific logic. + /// + /// # Returns + /// + /// * `Result, Error>` - Returns the constructed `TokenDirectPurchaseTransitionActionV0` if successful, + /// or an error if any issue arises, such as missing data or an invalid state transition. + #[allow(clippy::too_many_arguments)] + pub fn try_from_token_direct_purchase_transition_with_contract_lookup( + drive: &Drive, + owner_id: Identifier, + value: TokenDirectPurchaseTransitionV0, + approximate_without_state_for_costs: bool, + transaction: TransactionArg, + block_info: &BlockInfo, + user_fee_increase: UserFeeIncrease, + get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, + platform_version: &PlatformVersion, + ) -> Result< + ( + ConsensusValidationResult, + FeeResult, + ), + Error, + > { + let TokenDirectPurchaseTransitionV0 { + base, token_count, agreed_price_per_token + } = value; + + let mut drive_operations = vec![]; + + let base_action_validation_result = + TokenBaseTransitionAction::try_from_borrowed_base_transition_with_contract_lookup( + drive, + owner_id, + &base, + approximate_without_state_for_costs, + transaction, + &mut drive_operations, + get_data_contract, + platform_version, + )?; + + let fee_result = Drive::calculate_fee( + None, + Some(drive_operations), + &block_info.epoch, + drive.config.epochs_per_era, + platform_version, + None, + )?; + + let base_action = match base_action_validation_result.is_valid() { + true => base_action_validation_result.into_data()?, + false => { + let bump_action = BumpIdentityDataContractNonceAction::from_token_base_transition( + base, + owner_id, + user_fee_increase, + ); + let batched_action = + BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); + + return Ok(( + ConsensusValidationResult::new_with_data_and_errors( + batched_action, + base_action_validation_result.errors, + ), + fee_result, + )); + } + }; + + Ok(( + BatchedTransitionAction::TokenAction(TokenTransitionAction::DirectPurchaseAction( + TokenDirectPurchaseTransitionActionV0 { + base: base_action, + token_count, + agreed_price_per_token, + } + .into(), + )) + .into(), + fee_result, + )) + } + + /// Converts a borrowed `TokenDirectPurchaseTransitionV0` into a `TokenDirectPurchaseTransitionActionV0` using the provided contract lookup. + /// + /// This method processes the token direct_purchaseing transition and constructs the corresponding transition action while + /// looking up necessary data contracts and applying the relevant direct_purchaseing logic. It does not require `drive_operations` + /// to be passed as a parameter, but it manages them internally. + /// + /// # Arguments + /// + /// * `drive` - A reference to the `Drive` instance that handles data storage and retrieval. + /// * `owner_id` - The identifier of the owner initiating the direct_purchaseing transition. This is typically the identity + /// performing the transaction, such as the user's ID. + /// * `value` - A reference to the `TokenDirectPurchaseTransitionV0` struct containing the transition data, including token + /// amount and recipient. + /// * `approximate_without_state_for_costs` - A flag to indicate whether costs should be approximated without full + /// state consideration. Useful for optimizing transaction cost calculations in scenarios where full state is not needed. + /// * `transaction` - The transaction context, which includes the necessary state and other details for the transition. + /// * `block_info` - Information about the current block (e.g., epoch) to help calculate transaction fees. + /// * `get_data_contract` - A closure function that takes a contract identifier and returns a `DataContractFetchInfo` + /// containing the data contract details, including token configurations. + /// * `platform_version` - A reference to the platform version to ensure the transition respects version-specific logic. + /// + //// # Returns + /// + /// * `Result<(ConsensusValidationResult, FeeResult), Error>` - Returns a tuple containing the constructed + /// `TokenDirectPurchaseTransitionActionV0` and a `FeeResult` if successful. If an error occurs (e.g., missing data or + /// invalid state transition), it returns an `Error`. + /// + #[allow(clippy::too_many_arguments)] + pub fn try_from_borrowed_token_direct_purchase_transition_with_contract_lookup( + drive: &Drive, + owner_id: Identifier, + value: &TokenDirectPurchaseTransitionV0, + approximate_without_state_for_costs: bool, + transaction: TransactionArg, + block_info: &BlockInfo, + user_fee_increase: UserFeeIncrease, + get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, + platform_version: &PlatformVersion, + ) -> Result< + ( + ConsensusValidationResult, + FeeResult, + ), + Error, + > { + let TokenDirectPurchaseTransitionV0 { + base, token_count, agreed_price_per_token + } = value; + + let mut drive_operations = vec![]; + + let base_action_validation_result = + TokenBaseTransitionAction::try_from_borrowed_base_transition_with_contract_lookup( + drive, + owner_id, + &base, + approximate_without_state_for_costs, + transaction, + &mut drive_operations, + get_data_contract, + platform_version, + )?; + + let fee_result = Drive::calculate_fee( + None, + Some(drive_operations), + &block_info.epoch, + drive.config.epochs_per_era, + platform_version, + None, + )?; + + let base_action = match base_action_validation_result.is_valid() { + true => base_action_validation_result.into_data()?, + false => { + let bump_action = BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( + base, + owner_id, + user_fee_increase, + ); + let batched_action = + BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); + + return Ok(( + ConsensusValidationResult::new_with_data_and_errors( + batched_action, + base_action_validation_result.errors, + ), + fee_result, + )); + } + }; + + Ok(( + BatchedTransitionAction::TokenAction(TokenTransitionAction::DirectPurchaseAction( + TokenDirectPurchaseTransitionActionV0 { + base: base_action, + token_count: *token_count, + agreed_price_per_token: *agreed_price_per_token, + } + .into(), + )) + .into(), + fee_result, + )) + } +} diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/mod.rs new file mode 100644 index 00000000000..9bdb47bab2d --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/mod.rs @@ -0,0 +1,73 @@ +use derive_more::From; +use dpp::identifier::Identifier; + +/// transformer module for token issuance transition action +pub mod transformer; +mod v0; + +pub use v0::*; // re-export the v0 module items (including TokenIssuanceTransitionActionV0) + +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::TokenBaseTransitionAction; + +/// Token issuance transition action +#[derive(Debug, Clone, From)] +pub enum TokenSetPriceForDirectPurchaseTransitionAction { + /// v0 + V0(TokenSetPriceForDirectPurchaseTransitionActionV0), +} + +impl TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 for TokenSetPriceForDirectPurchaseTransitionAction { + fn base(&self) -> &TokenBaseTransitionAction { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => &v0.base, + } + } + + fn base_owned(self) -> TokenBaseTransitionAction { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.base, + } + } + + fn set_price_for_direct_purchase_amount(&self) -> u64 { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.set_price_for_direct_purchase_amount, + } + } + + fn set_set_price_for_direct_purchase_amount(&mut self, amount: u64) { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.set_price_for_direct_purchase_amount = amount, + } + } + + fn identity_balance_holder_id(&self) -> Identifier { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.identity_balance_holder_id, + } + } + + fn set_identity_balance_holder_id(&mut self, id: Identifier) { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.identity_balance_holder_id = id, + } + } + + fn public_note(&self) -> Option<&String> { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.public_note.as_ref(), + } + } + + fn public_note_owned(self) -> Option { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.public_note, + } + } + + fn set_public_note(&mut self, public_note: Option) { + match self { + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.public_note = public_note, + } + } +} diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/transformer.rs new file mode 100644 index 00000000000..8d6040b72d0 --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/transformer.rs @@ -0,0 +1,119 @@ +use dpp::platform_value::Identifier; +use dpp::ProtocolError; +use grovedb::TransactionArg; +use std::sync::Arc; +use dpp::block::block_info::BlockInfo; +use dpp::fee::fee_result::FeeResult; +use dpp::prelude::{ConsensusValidationResult, UserFeeIncrease}; +use crate::drive::contract::DataContractFetchInfo; +use crate::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::{TokenSetPriceForDirectPurchaseTransitionActionV0, TokenSetPriceForDirectPurchaseTransitionAction}; +use dpp::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransition; +use platform_version::version::PlatformVersion; +use crate::drive::Drive; +use crate::error::Error; +use crate::state_transition_action::batch::BatchedTransitionAction; + +/// Implement methods to transform a `TokenSetPriceForDirectPurchaseTransition` into a `TokenSetPriceForDirectPurchaseTransitionAction`. +impl TokenSetPriceForDirectPurchaseTransitionAction { + /// Transform a `TokenSetPriceForDirectPurchaseTransition` into a `TokenSetPriceForDirectPurchaseTransitionAction` using the provided data contract lookup. + /// + /// # Arguments + /// + /// * `drive` - A reference to the `Drive` instance used for accessing the system. + /// * `owner_id` - The identifier of the owner initiating the set_price_for_direct_purchase transition. + /// * `transaction` - The transaction argument used for state changes. + /// * `value` - A `TokenSetPriceForDirectPurchaseTransition` instance. + /// * `approximate_without_state_for_costs` - A flag indicating whether to approximate state costs without full state. + /// * `drive_operations` - A mutable reference to the vector of low-level operations that need to be performed. + /// * `get_data_contract` - A closure that fetches the `DataContractFetchInfo` given a contract ID. + /// * `platform_version` - The platform version for the context in which the transition is being executed. + /// + /// # Returns + /// + /// * `Result<(ConsensusValidationResult, FeeResult), Error>` - A `TokenSetPriceForDirectPurchaseTransitionAction` if successful, otherwise `ProtocolError`. + #[allow(clippy::too_many_arguments)] + pub fn try_from_token_set_price_for_direct_purchase_transition_with_contract_lookup( + drive: &Drive, + owner_id: Identifier, + value: TokenSetPriceForDirectPurchaseTransition, + approximate_without_state_for_costs: bool, + transaction: TransactionArg, + block_info: &BlockInfo, + user_fee_increase: UserFeeIncrease, + get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, + platform_version: &PlatformVersion, + ) -> Result< + ( + ConsensusValidationResult, + FeeResult, + ), + Error, + > { + match value { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => { + TokenSetPriceForDirectPurchaseTransitionActionV0::try_from_token_set_price_for_direct_purchase_transition_with_contract_lookup( + drive, + owner_id, + v0, + approximate_without_state_for_costs, + transaction, + block_info, + user_fee_increase, + get_data_contract, + platform_version, + ) + } + } + } + + /// Transform a borrowed `TokenSetPriceForDirectPurchaseTransition` into a `TokenSetPriceForDirectPurchaseTransitionAction` using the provided data contract lookup. + /// + /// # Arguments + /// + /// * `drive` - A reference to the `Drive` instance used for accessing the system. + /// * `owner_id` - The identifier of the owner initiating the set_price_for_direct_purchase transition. + /// * `transaction` - The transaction argument used for state changes. + /// * `value` - A reference to a `TokenSetPriceForDirectPurchaseTransition`. + /// * `approximate_without_state_for_costs` - A flag indicating whether to approximate state costs without full state. + /// * `drive_operations` - A mutable reference to the vector of low-level operations that need to be performed. + /// * `get_data_contract` - A closure that fetches the `DataContractFetchInfo` given a contract ID. + /// * `platform_version` - The platform version for the context in which the transition is being executed. + /// + /// # Returns + /// + #[allow(clippy::too_many_arguments)] + /// * `Result<(ConsensusValidationResult, FeeResult), Error>` - A `TokenSetPriceForDirectPurchaseTransitionAction` if successful, otherwise `ProtocolError`. + pub fn try_from_borrowed_token_set_price_for_direct_purchase_transition_with_contract_lookup( + drive: &Drive, + owner_id: Identifier, + value: &TokenSetPriceForDirectPurchaseTransition, + approximate_without_state_for_costs: bool, + transaction: TransactionArg, + block_info: &BlockInfo, + user_fee_increase: UserFeeIncrease, + get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, + platform_version: &PlatformVersion, + ) -> Result< + ( + ConsensusValidationResult, + FeeResult, + ), + Error, + > { + match value { + TokenSetPriceForDirectPurchaseTransition::V0(v0) => { + TokenSetPriceForDirectPurchaseTransitionActionV0::try_from_borrowed_token_set_price_for_direct_purchase_transition_with_contract_lookup( + drive, + owner_id, + v0, + approximate_without_state_for_costs, + transaction, + block_info, + user_fee_increase, + get_data_contract, + platform_version, + ) + } + } + } +} diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/mod.rs new file mode 100644 index 00000000000..ee834ccf053 --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/mod.rs @@ -0,0 +1,99 @@ +mod transformer; + +use std::sync::Arc; +use dpp::fee::Credits; +use dpp::identifier::Identifier; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use crate::drive::contract::DataContractFetchInfo; +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::{TokenBaseTransitionAction, TokenBaseTransitionActionAccessorsV0}; + +/// Token issuance transition action v0 +#[derive(Debug, Clone)] +pub struct TokenSetPriceForDirectPurchaseTransitionActionV0 { + /// Base token transition action + pub base: TokenBaseTransitionAction, + /// What should be the price for a single token + /// Setting this to None makes it no longer purchasable + pub price: Option, + /// The public note + pub public_note: Option, +} + +/// Accessors for `TokenIssuanceTransitionActionV0` +pub trait TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 { + /// Returns a reference to the base token transition action + fn base(&self) -> &TokenBaseTransitionAction; + + /// Consumes self and returns the base token transition action + fn base_owned(self) -> TokenBaseTransitionAction; + + /// Returns the price + fn price(&self) -> Option; + + /// Sets the amount of tokens to issuance + fn set_price(&mut self, price: Option); + + /// Returns the token position in the contract + fn token_position(&self) -> u16 { + self.base().token_position() + } + + /// Returns the token ID + fn token_id(&self) -> Identifier { + self.base().token_id() + } + + /// Returns the data contract ID + fn data_contract_id(&self) -> Identifier { + self.base().data_contract_id() + } + + /// Returns a reference to the data contract fetch info + fn data_contract_fetch_info_ref(&self) -> &Arc { + self.base().data_contract_fetch_info_ref() + } + + /// Returns the data contract fetch info + fn data_contract_fetch_info(&self) -> Arc { + self.base().data_contract_fetch_info() + } + + /// Returns the public note (optional) + fn public_note(&self) -> Option<&String>; + + /// Returns the public note (owned) + fn public_note_owned(self) -> Option; + + /// Sets the public note + fn set_public_note(&mut self, public_note: Option); +} + +impl TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 for TokenSetPriceForDirectPurchaseTransitionActionV0 { + fn base(&self) -> &TokenBaseTransitionAction { + &self.base + } + + fn base_owned(self) -> TokenBaseTransitionAction { + self.base + } + + fn price(&self) -> Option<&TokenPricingSchedule> { + self.price.as_ref() + } + + fn set_price(&mut self, price: Option) { + self.price = price; + } + + fn public_note(&self) -> Option<&String> { + self.public_note.as_ref() + } + + fn public_note_owned(self) -> Option { + self.public_note + } + + fn set_public_note(&mut self, public_note: Option) { + self.public_note = public_note; + } +} diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs new file mode 100644 index 00000000000..128af6f67a7 --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs @@ -0,0 +1,231 @@ +use std::sync::Arc; +use grovedb::TransactionArg; +use dpp::block::block_info::BlockInfo; +use dpp::identifier::Identifier; +use dpp::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::v0::TokenSetPriceForDirectPurchaseTransitionV0; +use dpp::ProtocolError; +use crate::drive::contract::DataContractFetchInfo; +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::{TokenBaseTransitionAction, TokenBaseTransitionActionAccessorsV0}; +use crate::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::v0::TokenSetPriceForDirectPurchaseTransitionActionV0; +use dpp::fee::fee_result::FeeResult; +use dpp::prelude::{ConsensusValidationResult, UserFeeIncrease}; +use platform_version::version::PlatformVersion; +use crate::drive::Drive; +use crate::error::Error; +use crate::state_transition_action::batch::batched_transition::token_transition::TokenTransitionAction; +use crate::state_transition_action::batch::BatchedTransitionAction; +use crate::state_transition_action::system::bump_identity_data_contract_nonce_action::BumpIdentityDataContractNonceAction; + +impl TokenSetPriceForDirectPurchaseTransitionActionV0 { + /// Converts a `TokenSetPriceForDirectPurchaseTransitionV0` into a `TokenSetPriceForDirectPurchaseTransitionActionV0` using the provided contract lookup. + /// + /// This method processes the token set_price_for_direct_purchaseing transition and returns the corresponding transition action + /// while looking up necessary data contracts and applying the relevant logic for set_price_for_direct_purchaseing. + /// + /// # Arguments + /// + /// * `drive` - A reference to the `Drive` instance which handles data storage and retrieval. + /// * `owner_id` - The identifier of the owner initiating the set_price_for_direct_purchaseing transition. This is typically the identity + /// performing the transaction, such as the user's ID. + /// * `transaction` - A transaction context that includes the necessary state and other details for the transition. + /// * `value` - The `TokenSetPriceForDirectPurchaseTransitionV0` struct containing the transition data, including token amount and recipient. + /// * `approximate_without_state_for_costs` - A flag to determine if costs should be approximated without considering + /// the full state for the operation. Useful for optimizing the transaction cost calculations. + /// * `block_info` - Information about the current block to calculate fees. + /// * `get_data_contract` - A closure function that takes a contract identifier and returns a `DataContractFetchInfo` + /// containing the data contract details, including token configurations. + /// * `platform_version` - A reference to the platform version, ensuring the transition respects version-specific logic. + /// + /// # Returns + /// + /// * `Result, Error>` - Returns the constructed `TokenSetPriceForDirectPurchaseTransitionActionV0` if successful, + /// or an error if any issue arises, such as missing data or an invalid state transition. + #[allow(clippy::too_many_arguments)] + pub fn try_from_token_set_price_for_direct_purchase_transition_with_contract_lookup( + drive: &Drive, + owner_id: Identifier, + value: TokenSetPriceForDirectPurchaseTransitionV0, + approximate_without_state_for_costs: bool, + transaction: TransactionArg, + block_info: &BlockInfo, + user_fee_increase: UserFeeIncrease, + get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, + platform_version: &PlatformVersion, + ) -> Result< + ( + ConsensusValidationResult, + FeeResult, + ), + Error, + > { + let TokenSetPriceForDirectPurchaseTransitionV0 { + base, + price, public_note, + } = value; + + let mut drive_operations = vec![]; + + let base_action_validation_result = + TokenBaseTransitionAction::try_from_borrowed_base_transition_with_contract_lookup( + drive, + owner_id, + &base, + approximate_without_state_for_costs, + transaction, + &mut drive_operations, + get_data_contract, + platform_version, + )?; + + let fee_result = Drive::calculate_fee( + None, + Some(drive_operations), + &block_info.epoch, + drive.config.epochs_per_era, + platform_version, + None, + )?; + + let base_action = match base_action_validation_result.is_valid() { + true => base_action_validation_result.into_data()?, + false => { + let bump_action = BumpIdentityDataContractNonceAction::from_token_base_transition( + base, + owner_id, + user_fee_increase, + ); + let batched_action = + BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); + + return Ok(( + ConsensusValidationResult::new_with_data_and_errors( + batched_action, + base_action_validation_result.errors, + ), + fee_result, + )); + } + }; + + Ok(( + BatchedTransitionAction::TokenAction(TokenTransitionAction::SetPriceForDirectPurchaseAction( + TokenSetPriceForDirectPurchaseTransitionActionV0 { + base: base_action, + price, + public_note, + } + .into(), + )) + .into(), + fee_result, + )) + } + + /// Converts a borrowed `TokenSetPriceForDirectPurchaseTransitionV0` into a `TokenSetPriceForDirectPurchaseTransitionActionV0` using the provided contract lookup. + /// + /// This method processes the token set_price_for_direct_purchaseing transition and constructs the corresponding transition action while + /// looking up necessary data contracts and applying the relevant set_price_for_direct_purchaseing logic. It does not require `drive_operations` + /// to be passed as a parameter, but it manages them internally. + /// + /// # Arguments + /// + /// * `drive` - A reference to the `Drive` instance that handles data storage and retrieval. + /// * `owner_id` - The identifier of the owner initiating the set_price_for_direct_purchaseing transition. This is typically the identity + /// performing the transaction, such as the user's ID. + /// * `value` - A reference to the `TokenSetPriceForDirectPurchaseTransitionV0` struct containing the transition data, including token + /// amount and recipient. + /// * `approximate_without_state_for_costs` - A flag to indicate whether costs should be approximated without full + /// state consideration. Useful for optimizing transaction cost calculations in scenarios where full state is not needed. + /// * `transaction` - The transaction context, which includes the necessary state and other details for the transition. + /// * `block_info` - Information about the current block (e.g., epoch) to help calculate transaction fees. + /// * `get_data_contract` - A closure function that takes a contract identifier and returns a `DataContractFetchInfo` + /// containing the data contract details, including token configurations. + /// * `platform_version` - A reference to the platform version to ensure the transition respects version-specific logic. + /// + //// # Returns + /// + /// * `Result<(ConsensusValidationResult, FeeResult), Error>` - Returns a tuple containing the constructed + /// `TokenSetPriceForDirectPurchaseTransitionActionV0` and a `FeeResult` if successful. If an error occurs (e.g., missing data or + /// invalid state transition), it returns an `Error`. + /// + #[allow(clippy::too_many_arguments)] + pub fn try_from_borrowed_token_set_price_for_direct_purchase_transition_with_contract_lookup( + drive: &Drive, + owner_id: Identifier, + value: &TokenSetPriceForDirectPurchaseTransitionV0, + approximate_without_state_for_costs: bool, + transaction: TransactionArg, + block_info: &BlockInfo, + user_fee_increase: UserFeeIncrease, + get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, + platform_version: &PlatformVersion, + ) -> Result< + ( + ConsensusValidationResult, + FeeResult, + ), + Error, + > { + let TokenSetPriceForDirectPurchaseTransitionV0 { + base, + price, public_note, + } = value; + + let mut drive_operations = vec![]; + + let base_action_validation_result = + TokenBaseTransitionAction::try_from_borrowed_base_transition_with_contract_lookup( + drive, + owner_id, + &base, + approximate_without_state_for_costs, + transaction, + &mut drive_operations, + get_data_contract, + platform_version, + )?; + + let fee_result = Drive::calculate_fee( + None, + Some(drive_operations), + &block_info.epoch, + drive.config.epochs_per_era, + platform_version, + None, + )?; + + let base_action = match base_action_validation_result.is_valid() { + true => base_action_validation_result.into_data()?, + false => { + let bump_action = BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( + base, + owner_id, + user_fee_increase, + ); + let batched_action = + BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); + + return Ok(( + ConsensusValidationResult::new_with_data_and_errors( + batched_action, + base_action_validation_result.errors, + ), + fee_result, + )); + } + }; + + Ok(( + BatchedTransitionAction::TokenAction(TokenTransitionAction::SetPriceForDirectPurchaseAction( + TokenSetPriceForDirectPurchaseTransitionActionV0 { + base: base_action, + price: price.clone(), + public_note: public_note.clone(), + } + .into(), + )) + .into(), + fee_result, + )) + } +} diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/token.rs b/packages/rs-drive/src/util/batch/drive_op_batch/token.rs index db3cead1f91..999c4e8c12f 100644 --- a/packages/rs-drive/src/util/batch/drive_op_batch/token.rs +++ b/packages/rs-drive/src/util/batch/drive_op_batch/token.rs @@ -13,6 +13,7 @@ use grovedb::{EstimatedLayerInformation, TransactionArg}; use platform_version::version::PlatformVersion; use std::collections::HashMap; use dpp::data_contract::associated_token::token_perpetual_distribution::reward_distribution_moment::RewardDistributionMoment; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; /// Operations on Tokens #[derive(Clone, Debug)] @@ -115,6 +116,14 @@ pub enum TokenOperationType { /// The token event event: TokenEvent, }, + /// Sets the price of a token for direct purchase + TokenSetPriceForDirectPurchase { + /// The token id + token_id: Identifier, + /// The price we are setting to + /// None means it's not currently for sale + price: Option, + } } impl DriveLowLevelOperationConverter for TokenOperationType { diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs index 8ceadd2f9f6..439ac18d51e 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs @@ -120,6 +120,10 @@ pub struct DriveAbciDocumentsStateTransitionValidationVersions { pub token_base_transition_group_action_validation: FeatureVersion, pub token_claim_transition_structure_validation: FeatureVersion, pub token_claim_transition_state_validation: FeatureVersion, + pub token_direct_purchase_transition_structure_validation: FeatureVersion, + pub token_direct_purchase_transition_state_validation: FeatureVersion, + pub token_set_price_for_direct_purchase_transition_structure_validation: FeatureVersion, + pub token_set_price_for_direct_purchase_transition_state_validation: FeatureVersion, } #[derive(Clone, Debug, Default)] diff --git a/packages/token-history-contract/schema/v1/token-history-contract-documents.json b/packages/token-history-contract/schema/v1/token-history-contract-documents.json index 23408dfd6f1..03578a4a0cd 100644 --- a/packages/token-history-contract/schema/v1/token-history-contract-documents.json +++ b/packages/token-history-contract/schema/v1/token-history-contract-documents.json @@ -759,5 +759,55 @@ "$createdAtBlockHeight" ], "additionalProperties": false + }, + "setPriceForDirectPurchase": { + "type": "object", + "documentsMutable": false, + "canBeDeleted": false, + "creationRestrictionMode": 2, + "indices": [ + { + "name": "byDate", + "properties": [ + { + "tokenId": "asc" + }, + { + "$createdAt": "asc" + } + ] + } + ], + "properties": { + "tokenId": { + "type": "array", + "byteArray": true, + "minItems": 32, + "maxItems": 32, + "description": "The token ID", + "position": 0, + "contentMediaType": "application/x.dash.dpp.identifier" + }, + "priceSchedule": { + "type": "array", + "byteArray": true, + "minItems": 1, + "maxItems": 2048, + "description": "The serialized price schedule for direct token purchases", + "position": 1 + }, + "note": { + "type": "string", + "maxLength": 2048, + "description": "An optional note explaining the pricing change", + "position": 2 + } + }, + "required": [ + "tokenId", + "$createdAt", + "$createdAtBlockHeight" + ], + "additionalProperties": false } } \ No newline at end of file From b28bb6594d53699d8314afd63952ac8e3e362d64 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 6 Apr 2025 18:03:59 +0700 Subject: [PATCH 02/32] more work on sell token --- .../accessors/mod.rs | 12 +++ .../accessors/v0/mod.rs | 4 + .../token_keeps_history_rules/v0/mod.rs | 8 +- .../v0_methods.rs | 2 +- .../batched_transition/token_transition.rs | 45 +++++++++- .../token_transition_action_type.rs | 5 ++ .../batch_transition/resolvers/v0/mod.rs | 10 +-- packages/rs-dpp/src/tokens/token_event.rs | 6 +- .../batch/token/mod.rs | 1 + .../token/token_direct_purchase_transition.rs | 85 +++++++++++++++++++ ...et_price_for_direct_purchase_transition.rs | 2 +- .../token_transition_action_type.rs | 2 + .../mod.rs | 2 + 13 files changed, 171 insertions(+), 13 deletions(-) create mode 100644 packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_direct_purchase_transition.rs diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/mod.rs index 0a6f6b64f15..e78c45edc70 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/mod.rs @@ -36,6 +36,12 @@ impl TokenKeepsHistoryRulesV0Getters for TokenKeepsHistoryRules { TokenKeepsHistoryRules::V0(v0) => v0.keeps_direct_pricing_history, } } + + fn keeps_direct_purchase_history(&self) -> bool { + match self { + TokenKeepsHistoryRules::V0(v0) => v0.keeps_direct_purchase_history, + } + } } /// Implementing `TokenKeepsHistoryRulesV0Setters` for `TokenKeepsHistoryRules` @@ -69,4 +75,10 @@ impl TokenKeepsHistoryRulesV0Setters for TokenKeepsHistoryRules { TokenKeepsHistoryRules::V0(v0) => v0.keeps_direct_pricing_history = value, } } + + fn set_keeps_direct_purchase_history(&mut self, value: bool) { + match self { + TokenKeepsHistoryRules::V0(v0) => v0.keeps_direct_purchase_history = value, + } + } } diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs index 660be3cf7c1..a30dbc72654 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs @@ -1,3 +1,5 @@ +use crate::data_contract::associated_token::token_keeps_history_rules::TokenKeepsHistoryRules; + /// Accessor trait for getters of `TokenKeepsHistoryRulesV0` pub trait TokenKeepsHistoryRulesV0Getters { /// Returns whether transfer history is kept. @@ -14,6 +16,7 @@ pub trait TokenKeepsHistoryRulesV0Getters { /// Returns whether direct pricing history is kept. fn keeps_direct_pricing_history(&self) -> bool; + fn keeps_direct_purchase_history(&self) -> bool; } /// Accessor trait for setters of `TokenKeepsHistoryRulesV0` @@ -32,4 +35,5 @@ pub trait TokenKeepsHistoryRulesV0Setters { /// Sets whether direct pricing history is kept. fn set_keeps_direct_pricing_history(&mut self, value: bool); + fn set_keeps_direct_purchase_history(&mut self, value: bool); } diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs index 9c36924e156..dce3ce0f0f6 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs @@ -29,6 +29,10 @@ pub struct TokenKeepsHistoryRulesV0 { /// Whether direct pricing history is recorded. #[serde(default = "default_true")] pub keeps_direct_pricing_history: bool, + + /// Whether direct purchase history is recorded. + #[serde(default = "default_true")] + pub keeps_direct_purchase_history: bool, } impl Default for TokenKeepsHistoryRulesV0 { @@ -39,6 +43,7 @@ impl Default for TokenKeepsHistoryRulesV0 { keeps_minting_history: true, keeps_burning_history: true, keeps_direct_pricing_history: true, + keeps_direct_purchase_history: true, } } } @@ -52,12 +57,13 @@ impl fmt::Display for TokenKeepsHistoryRulesV0 { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, - "TokenKeepsHistoryRulesV0 {{\n keeps_transfer_history: {},\n keeps_freezing_history: {},\n keeps_minting_history: {},\n keeps_burning_history: {},\n keeps_direct_pricing_history: {}\n}}", + "TokenKeepsHistoryRulesV0 {{\n keeps_transfer_history: {},\n keeps_freezing_history: {},\n keeps_minting_history: {},\n keeps_burning_history: {},\n keeps_direct_pricing_history: {}, \n keeps_direct_purchase_history: {}\n", self.keeps_transfer_history, self.keeps_freezing_history, self.keeps_minting_history, self.keeps_burning_history, self.keeps_direct_pricing_history, + self.keeps_direct_purchase_history, ) } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs index d7b08f98238..644bd7440cf 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs @@ -30,7 +30,7 @@ impl TokenBaseTransitionAccessors for TokenSetPriceForDirectPurchaseTransition { } impl TokenSetPriceForDirectPurchaseTransitionV0Methods for TokenSetPriceForDirectPurchaseTransition { - fn price(&self) -> Option { + fn price(&self) -> Option<&TokenPricingSchedule> { match self { TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.price(), } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs index 848e90c768c..c0c40b06275 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs @@ -18,7 +18,7 @@ use crate::data_contract::document_type::DocumentTypeRef; use crate::document::Document; use crate::prelude::IdentityNonce; use crate::ProtocolError; -use crate::state_transition::batch_transition::{DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, TokenBurnTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenClaimTransition, TokenTransferTransition}; +use crate::state_transition::batch_transition::{DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, TokenBurnTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenClaimTransition, TokenTransferTransition, TokenSetPriceForDirectPurchaseTransition}; use crate::state_transition::batch_transition::batched_transition::{DocumentPurchaseTransition, DocumentTransferTransition}; use crate::state_transition::batch_transition::batched_transition::multi_party_action::AllowedAsMultiPartyAction; use crate::state_transition::batch_transition::batched_transition::token_unfreeze_transition::TokenUnfreezeTransition; @@ -33,6 +33,8 @@ use crate::state_transition::batch_transition::token_emergency_action_transition use crate::state_transition::batch_transition::token_freeze_transition::v0::v0_methods::TokenFreezeTransitionV0Methods; use crate::state_transition::batch_transition::token_mint_transition::v0::v0_methods::TokenMintTransitionV0Methods; use crate::state_transition::batch_transition::token_claim_transition::v0::v0_methods::TokenClaimTransitionV0Methods; +use crate::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransition; +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::v0::v0_methods::TokenSetPriceForDirectPurchaseTransitionV0Methods; use crate::state_transition::batch_transition::token_transfer_transition::v0::v0_methods::TokenTransferTransitionV0Methods; use crate::state_transition::batch_transition::token_unfreeze_transition::v0::v0_methods::TokenUnfreezeTransitionV0Methods; use crate::tokens::token_event::TokenEvent; @@ -74,6 +76,12 @@ pub enum TokenTransition { #[display("TokenConfigUpdateTransition({})", "_0")] ConfigUpdate(TokenConfigUpdateTransition), + + #[display("TokenDirectPurchaseTransition({})", "_0")] + DirectPurchase(TokenDirectPurchaseTransition), + + #[display("TokenSetPriceForDirectPurchaseTransition({})", "_0")] + SetPriceForDirectPurchase(TokenSetPriceForDirectPurchaseTransition), } impl BatchTransitionResolversV0 for TokenTransition { @@ -168,6 +176,22 @@ impl BatchTransitionResolversV0 for TokenTransition { None } } + + fn as_transition_token_direct_purchase(&self) -> Option<&TokenDirectPurchaseTransition> { + if let Self::DirectPurchase(ref t) = self { + Some(t) + } else { + None + } + } + + fn as_transition_token_set_price_for_direct_purchase(&self) -> Option<&TokenSetPriceForDirectPurchaseTransition> { + if let Self::SetPriceForDirectPurchase(ref t) = self { + Some(t) + } else { + None + } + } } pub trait TokenTransitionV0Methods { @@ -230,6 +254,8 @@ impl TokenTransitionV0Methods for TokenTransition { TokenTransition::Claim(t) => t.base(), TokenTransition::EmergencyAction(t) => t.base(), TokenTransition::ConfigUpdate(t) => t.base(), + TokenTransition::DirectPurchase(t) => t.base(), + TokenTransition::SetPriceForDirectPurchase(t) => t.base(), } } @@ -244,6 +270,8 @@ impl TokenTransitionV0Methods for TokenTransition { TokenTransition::Claim(t) => t.base_mut(), TokenTransition::EmergencyAction(t) => t.base_mut(), TokenTransition::ConfigUpdate(t) => t.base_mut(), + TokenTransition::DirectPurchase(t) => t.base_mut(), + TokenTransition::SetPriceForDirectPurchase(t) => t.base_mut(), } } @@ -262,6 +290,8 @@ impl TokenTransitionV0Methods for TokenTransition { TokenTransition::Claim(_) => None, TokenTransition::EmergencyAction(t) => Some(t.calculate_action_id(owner_id)), TokenTransition::ConfigUpdate(t) => Some(t.calculate_action_id(owner_id)), + TokenTransition::DirectPurchase(_) => None, + TokenTransition::SetPriceForDirectPurchase(t) => Some(t.calculate_action_id(owner_id)), } } @@ -273,8 +303,9 @@ impl TokenTransitionV0Methods for TokenTransition { | TokenTransition::Unfreeze(_) | TokenTransition::DestroyFrozenFunds(_) | TokenTransition::EmergencyAction(_) - | TokenTransition::ConfigUpdate(_) => true, - TokenTransition::Transfer(_) | TokenTransition::Claim(_) => false, + | TokenTransition::ConfigUpdate(_) + | TokenTransition::SetPriceForDirectPurchase(_) => true, + TokenTransition::Transfer(_) | TokenTransition::Claim(_) | TokenTransition::DirectPurchase(_) => false, } } @@ -310,6 +341,8 @@ impl TokenTransitionV0Methods for TokenTransition { TokenTransition::DestroyFrozenFunds(_) => "destroyFrozenFunds", TokenTransition::ConfigUpdate(_) => "configUpdate", TokenTransition::Claim(_) => "claim", + TokenTransition::DirectPurchase(_) => "directPurchase", + TokenTransition::SetPriceForDirectPurchase(_) => "setPriceForDirectPurchase", } } @@ -438,6 +471,12 @@ impl TokenTransitionV0Methods for TokenTransition { claim.public_note().cloned(), ) } + TokenTransition::DirectPurchase(direct_purchase) => { + TokenEvent::DirectPurchase(owner_id, direct_purchase.amount(), ) + } + TokenTransition::SetPriceForDirectPurchase(set_price_transition) => { + TokenEvent::SetPriceForDirectPurchase(set_price_transition.price().cloned(), set_price_transition.public_note().cloned()) + } }) } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs index ea464d5e88d..4d2286a04b7 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs @@ -14,6 +14,8 @@ pub enum TokenTransitionActionType { Claim, EmergencyAction, ConfigUpdate, + DirectPurchase, + SetPriceForDirectPurchase, } impl fmt::Display for TokenTransitionActionType { @@ -28,6 +30,8 @@ impl fmt::Display for TokenTransitionActionType { TokenTransitionActionType::Claim => "Claim", TokenTransitionActionType::EmergencyAction => "EmergencyAction", TokenTransitionActionType::ConfigUpdate => "ConfigUpdate", + TokenTransitionActionType::DirectPurchase => "DirectPurchase", + TokenTransitionActionType::SetPriceForDirectPurchase => "SetPriceForDirectPurchase", }; write!(f, "{}", action_str) } @@ -49,6 +53,7 @@ impl TokenTransitionActionTypeGetter for TokenTransition { TokenTransition::Claim(_) => TokenTransitionActionType::Claim, TokenTransition::EmergencyAction(_) => TokenTransitionActionType::EmergencyAction, TokenTransition::ConfigUpdate(_) => TokenTransitionActionType::ConfigUpdate, + TokenTransition::Di } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/resolvers/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/resolvers/v0/mod.rs index 687ece25889..5789fdd9afb 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/resolvers/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/resolvers/v0/mod.rs @@ -2,12 +2,8 @@ use crate::state_transition::batch_transition::batched_transition::token_unfreez use crate::state_transition::batch_transition::batched_transition::{ DocumentPurchaseTransition, DocumentTransferTransition, }; -use crate::state_transition::batch_transition::{ - DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, - TokenBurnTransition, TokenClaimTransition, TokenConfigUpdateTransition, - TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, - TokenMintTransition, TokenTransferTransition, -}; +use crate::state_transition::batch_transition::{DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, TokenBurnTransition, TokenClaimTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenSetPriceForDirectPurchaseTransition, TokenTransferTransition}; +use crate::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransition; pub trait BatchTransitionResolversV0 { fn as_transition_create(&self) -> Option<&DocumentCreateTransition>; @@ -28,4 +24,6 @@ pub trait BatchTransitionResolversV0 { fn as_transition_token_emergency_action(&self) -> Option<&TokenEmergencyActionTransition>; fn as_transition_token_config_update(&self) -> Option<&TokenConfigUpdateTransition>; + fn as_transition_token_direct_purchase(&self) -> Option<&TokenDirectPurchaseTransition>; + fn as_transition_token_set_price_for_direct_purchase(&self) -> Option<&TokenSetPriceForDirectPurchaseTransition>; } diff --git a/packages/rs-dpp/src/tokens/token_event.rs b/packages/rs-dpp/src/tokens/token_event.rs index 5e670129a26..6f52b4d77a5 100644 --- a/packages/rs-dpp/src/tokens/token_event.rs +++ b/packages/rs-dpp/src/tokens/token_event.rs @@ -14,6 +14,7 @@ use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; use platform_value::Identifier; use platform_version::version::PlatformVersion; use std::collections::BTreeMap; +use crate::fee::Credits; pub type TokenEventPublicNote = Option; pub type TokenEventSharedEncryptedNote = Option; @@ -29,6 +30,8 @@ use crate::ProtocolError; use crate::tokens::token_pricing_schedule::TokenPricingSchedule; pub type RecipientIdentifier = Identifier; + +pub type PurchaserIdentifier = Identifier; pub type FrozenIdentifier = Identifier; #[derive( @@ -55,7 +58,8 @@ pub enum TokenEvent { ), EmergencyAction(TokenEmergencyAction, TokenEventPublicNote), ConfigUpdate(TokenConfigurationChangeItem, TokenEventPublicNote), - SetPriceForDirectPurchase(Option, TokenEventPublicNote) + SetPriceForDirectPurchase(Option, TokenEventPublicNote), + DirectPurchase(PurchaserIdentifier, TokenAmount, Credits), } impl TokenEvent { diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs index dd50e6788bf..be5b26d0df0 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs @@ -9,3 +9,4 @@ mod token_transfer_transition; mod token_transition; mod token_unfreeze_transition; mod token_set_price_for_direct_purchase_transition; +mod token_direct_purchase_transition; diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_direct_purchase_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_direct_purchase_transition.rs new file mode 100644 index 00000000000..04457d404f8 --- /dev/null +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_direct_purchase_transition.rs @@ -0,0 +1,85 @@ +use dpp::block::epoch::Epoch; +use dpp::data_contract::accessors::v0::DataContractV0Getters; +use dpp::data_contract::associated_token::token_configuration::accessors::v0::TokenConfigurationV0Getters; +use dpp::data_contract::associated_token::token_keeps_history_rules::accessors::v0::TokenKeepsHistoryRulesV0Getters; +use dpp::identifier::Identifier; +use dpp::tokens::token_event::TokenEvent; +use platform_version::version::PlatformVersion; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::state_transition_action::action_convert_to_operations::batch::DriveHighLevelBatchOperationConverter; +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::TokenBaseTransitionActionAccessorsV0; +use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::{TokenDirectPurchaseTransitionAction, TokenDirectPurchaseTransitionActionAccessorsV0}; +use crate::util::batch::{DriveOperation, IdentityOperationType}; +use crate::util::batch::drive_op_batch::TokenOperationType; +use crate::util::batch::DriveOperation::{IdentityOperation, TokenOperation}; + +impl DriveHighLevelBatchOperationConverter for TokenDirectPurchaseTransitionAction { + fn into_high_level_batch_drive_operations<'b>( + self, + _epoch: &Epoch, + owner_id: Identifier, + platform_version: &PlatformVersion, + ) -> Result>, Error> { + match platform_version + .drive + .methods + .state_transitions + .convert_to_high_level_operations + .token_direct_purchase_transition + { + 0 => { + let data_contract_id = self.base().data_contract_id(); + + let identity_contract_nonce = self.base().identity_contract_nonce(); + + let mut ops = vec![IdentityOperation( + IdentityOperationType::UpdateIdentityContractNonce { + identity_id: owner_id.into_buffer(), + contract_id: data_contract_id.into_buffer(), + nonce: identity_contract_nonce, + }, + )]; + + ops.push(TokenOperation(TokenOperationType::TokenMint { + token_id: self.token_id(), + identity_balance_holder_id: owner_id, + mint_amount: self.token_count(), + allow_first_mint: true, + allow_saturation: false, + })); + + ops.push(IdentityOperation(IdentityOperationType::RemoveFromIdentityBalance { + identity_id: owner_id.to_buffer(), + balance_to_remove: self.token_count()*self.agreed_price_per_token(), + })); + ops.push(IdentityOperation(IdentityOperationType::AddToIdentityBalance { + identity_id: self.base().data_contract_fetch_info().contract.owner_id().to_buffer(), + added_balance: self.token_count()*self.agreed_price_per_token(), + })); + + let token_configuration = self.base().token_configuration()?; + if token_configuration.keeps_history().keeps_direct_purchase_history() { + ops.push(TokenOperation(TokenOperationType::TokenHistory { + token_id: self.token_id(), + owner_id, + nonce: identity_contract_nonce, + event: TokenEvent::DirectPurchase( + owner_id, + self.token_count(), + self.agreed_price_per_token(), + ), + })); + } + + Ok(ops) + } + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "TokenDirectPurchaseTransitionAction::into_high_level_document_drive_operations" + .to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs index 8783a9d5460..ebe20d6d334 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs @@ -29,7 +29,7 @@ impl DriveHighLevelBatchOperationConverter for TokenSetPriceForDirectPurchaseTra .methods .state_transitions .convert_to_high_level_operations - .token_mint_transition + .token_set_price_for_direct_purchase_transition { 0 => { let data_contract_id = self.base().data_contract_id(); diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transition_action_type.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transition_action_type.rs index 75f617670a4..b061501cb51 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transition_action_type.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transition_action_type.rs @@ -19,6 +19,8 @@ impl TokenTransitionActionTypeGetter for TokenTransitionAction { TokenTransitionActionType::DestroyFrozenFunds } TokenTransitionAction::ConfigUpdateAction(_) => TokenTransitionActionType::ConfigUpdate, + TokenTransitionAction::DirectPurchaseAction(_) => {} + TokenTransitionAction::SetPriceForDirectPurchaseAction(_) => {} } } } diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs index 1e38cbb87f3..99acce7835b 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/mod.rs @@ -39,6 +39,8 @@ pub struct DriveStateTransitionActionConvertToHighLevelOperationsMethodVersions pub token_destroy_frozen_funds_transition: FeatureVersion, pub token_config_update_transition: FeatureVersion, pub token_claim_transition: FeatureVersion, + pub token_direct_purchase_transition: FeatureVersion, + pub token_set_price_for_direct_purchase_transition: FeatureVersion, } #[derive(Clone, Debug, Default)] From 4273233b84a98ffedcb276d9fb77f61a955c4b79 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Tue, 8 Apr 2025 15:18:09 +0700 Subject: [PATCH 03/32] more work on selling --- .../token_configuration/v0/mod.rs | 4 + .../accessors/v0/mod.rs | 2 - .../token_keeps_history_rules/v0/accessors.rs | 16 ++ packages/rs-dpp/src/state_transition/mod.rs | 6 + .../batched_transition/document_transition.rs | 12 +- .../batched_transition/mod.rs | 4 +- .../batched_transition/resolvers.rs | 41 +++- .../token_direct_purchase_transition/mod.rs | 3 +- .../v0/mod.rs | 16 +- .../v0/v0_methods.rs | 18 +- .../v0_methods.rs | 9 +- .../validate_structure/v0/mod.rs | 2 +- .../mod.rs | 4 +- .../v0/mod.rs | 12 +- .../v0/v0_methods.rs | 6 +- .../v0_methods.rs | 14 +- .../validate_structure/mod.rs | 4 +- .../validate_structure/v0/mod.rs | 6 +- .../batched_transition/token_transition.rs | 21 +- .../token_transition_action_type.rs | 9 +- .../document/batch_transition/mod.rs | 11 +- .../batch_transition/resolvers/v0/mod.rs | 11 +- .../validate_basic_structure/v0/mod.rs | 10 + packages/rs-dpp/src/tokens/token_event.rs | 24 ++- .../src/tokens/token_pricing_schedule.rs | 49 ++++- .../batch/tests/token/direct_selling/mod.rs | 190 ++++++++++++++++++ .../batch/tests/token/mod.rs | 2 + .../state_transition/state_transitions/mod.rs | 38 +++- .../batch/token/mod.rs | 4 +- .../token/token_direct_purchase_transition.rs | 70 ++++--- ...et_price_for_direct_purchase_transition.rs | 6 +- .../batch/token/token_transition.rs | 19 ++ .../token_transition/mod.rs | 15 +- .../mod.rs | 8 +- .../v0/mod.rs | 22 +- .../v0/transformer.rs | 27 ++- .../mod.rs | 26 +-- .../v0/mod.rs | 9 +- .../v0/transformer.rs | 57 +++--- .../token_transition_action_type.rs | 8 +- .../src/util/batch/drive_op_batch/token.rs | 13 +- .../drive_abci_validation_versions/v1.rs | 4 + .../drive_abci_validation_versions/v2.rs | 4 + .../drive_abci_validation_versions/v3.rs | 4 + .../drive_abci_validation_versions/v4.rs | 4 + .../drive_abci_validation_versions/v5.rs | 4 + .../v1.rs | 2 + .../v1/token-history-contract-documents.json | 99 ++++++++- 48 files changed, 758 insertions(+), 191 deletions(-) create mode 100644 packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs index 62cb3ba138b..2b85b51bb29 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs @@ -75,6 +75,8 @@ fn default_token_keeps_history_rules() -> TokenKeepsHistoryRules { keeps_freezing_history: true, keeps_minting_history: true, keeps_burning_history: true, + keeps_direct_pricing_history: true, + keeps_direct_purchase_history: true, }) } @@ -175,6 +177,8 @@ impl TokenConfigurationV0 { keeps_freezing_history: true, keeps_minting_history: true, keeps_burning_history: true, + keeps_direct_pricing_history: true, + keeps_direct_purchase_history: true, }), start_as_paused: false, max_supply_change_rules: ChangeControlRulesV0 { diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs index a30dbc72654..813939e4edf 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/accessors/v0/mod.rs @@ -1,5 +1,3 @@ -use crate::data_contract::associated_token::token_keeps_history_rules::TokenKeepsHistoryRules; - /// Accessor trait for getters of `TokenKeepsHistoryRulesV0` pub trait TokenKeepsHistoryRulesV0Getters { /// Returns whether transfer history is kept. diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/accessors.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/accessors.rs index a837078a3d1..b9153b38873 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/accessors.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/accessors.rs @@ -20,6 +20,14 @@ impl TokenKeepsHistoryRulesV0Getters for TokenKeepsHistoryRulesV0 { fn keeps_burning_history(&self) -> bool { self.keeps_burning_history } + + fn keeps_direct_pricing_history(&self) -> bool { + self.keeps_direct_pricing_history + } + + fn keeps_direct_purchase_history(&self) -> bool { + self.keeps_direct_purchase_history + } } /// Implementing `TokenKeepsHistoryRulesV0Setters` for `TokenKeepsHistoryRulesV0` @@ -39,4 +47,12 @@ impl TokenKeepsHistoryRulesV0Setters for TokenKeepsHistoryRulesV0 { fn set_keeps_burning_history(&mut self, value: bool) { self.keeps_burning_history = value; } + + fn set_keeps_direct_pricing_history(&mut self, value: bool) { + self.keeps_direct_pricing_history = value; + } + + fn set_keeps_direct_purchase_history(&mut self, value: bool) { + self.keeps_direct_purchase_history = value; + } } diff --git a/packages/rs-dpp/src/state_transition/mod.rs b/packages/rs-dpp/src/state_transition/mod.rs index 782c970aa04..69fa9c5e4e3 100644 --- a/packages/rs-dpp/src/state_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/mod.rs @@ -362,6 +362,12 @@ impl StateTransition { "TokenConfigUpdate" } BatchedTransitionRef::Token(TokenTransition::Claim(_)) => "TokenClaim", + BatchedTransitionRef::Token(TokenTransition::DirectPurchase(_)) => { + "TokenDirectPurchase" + } + BatchedTransitionRef::Token( + TokenTransition::SetPriceForDirectPurchase(_), + ) => "SetPriceForDirectPurchase", }; document_transition_types.push(document_transition_name); } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/document_transition.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/document_transition.rs index ed63c8524a7..d2c0b99394c 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/document_transition.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/document_transition.rs @@ -5,7 +5,7 @@ use derive_more::{Display, From}; use serde::{Deserialize, Serialize}; use bincode::{Encode, Decode}; use crate::prelude::{IdentityNonce, Revision}; -use crate::state_transition::batch_transition::{DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, TokenBurnTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenClaimTransition, TokenTransferTransition, TokenUnfreezeTransition}; +use crate::state_transition::batch_transition::{DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, TokenBurnTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenClaimTransition, TokenTransferTransition, TokenUnfreezeTransition, TokenDirectPurchaseTransition, TokenSetPriceForDirectPurchaseTransition}; use crate::state_transition::batch_transition::batched_transition::{DocumentPurchaseTransition, DocumentTransferTransition, DocumentUpdatePriceTransition}; use crate::state_transition::batch_transition::batched_transition::document_purchase_transition::v0::v0_methods::DocumentPurchaseTransitionV0Methods; use crate::state_transition::batch_transition::batched_transition::document_transfer_transition::v0::v0_methods::DocumentTransferTransitionV0Methods; @@ -119,6 +119,16 @@ impl BatchTransitionResolversV0 for DocumentTransition { fn as_transition_token_config_update(&self) -> Option<&TokenConfigUpdateTransition> { None } + + fn as_transition_token_direct_purchase(&self) -> Option<&TokenDirectPurchaseTransition> { + None + } + + fn as_transition_token_set_price_for_direct_purchase( + &self, + ) -> Option<&TokenSetPriceForDirectPurchaseTransition> { + None + } } pub trait DocumentTransitionV0Methods { diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/mod.rs index ce18242f84c..0e13b68b791 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/mod.rs @@ -19,15 +19,15 @@ pub mod token_burn_transition; pub mod token_claim_transition; pub mod token_config_update_transition; pub mod token_destroy_frozen_funds_transition; +pub mod token_direct_purchase_transition; pub mod token_emergency_action_transition; pub mod token_freeze_transition; pub mod token_mint_transition; +pub mod token_set_price_for_direct_purchase_transition; pub mod token_transfer_transition; pub mod token_transition; pub mod token_transition_action_type; pub mod token_unfreeze_transition; -pub mod token_direct_purchase_transition; -pub mod token_set_price_for_direct_purchase_transition; use crate::prelude::IdentityNonce; use crate::state_transition::batch_transition::batched_transition::document_transition::DocumentTransitionV0Methods; diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/resolvers.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/resolvers.rs index 83ead62c008..ea182fc3d46 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/resolvers.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/resolvers.rs @@ -5,8 +5,9 @@ use crate::state_transition::batch_transition::resolvers::v0::BatchTransitionRes use crate::state_transition::batch_transition::{ DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, TokenBurnTransition, TokenClaimTransition, TokenConfigUpdateTransition, - TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, - TokenMintTransition, TokenTransferTransition, TokenUnfreezeTransition, + TokenDestroyFrozenFundsTransition, TokenDirectPurchaseTransition, + TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, + TokenSetPriceForDirectPurchaseTransition, TokenTransferTransition, TokenUnfreezeTransition, }; impl BatchTransitionResolversV0 for BatchedTransition { @@ -109,6 +110,24 @@ impl BatchTransitionResolversV0 for BatchedTransition { BatchedTransition::Token(token) => token.as_transition_token_config_update(), } } + + fn as_transition_token_direct_purchase(&self) -> Option<&TokenDirectPurchaseTransition> { + match self { + BatchedTransition::Document(_) => None, + BatchedTransition::Token(token) => token.as_transition_token_direct_purchase(), + } + } + + fn as_transition_token_set_price_for_direct_purchase( + &self, + ) -> Option<&TokenSetPriceForDirectPurchaseTransition> { + match self { + BatchedTransition::Document(_) => None, + BatchedTransition::Token(token) => { + token.as_transition_token_set_price_for_direct_purchase() + } + } + } } impl BatchTransitionResolversV0 for BatchedTransitionRef<'_> { @@ -211,4 +230,22 @@ impl BatchTransitionResolversV0 for BatchedTransitionRef<'_> { BatchedTransitionRef::Token(token) => token.as_transition_token_config_update(), } } + + fn as_transition_token_direct_purchase(&self) -> Option<&TokenDirectPurchaseTransition> { + match self { + BatchedTransitionRef::Document(_) => None, + BatchedTransitionRef::Token(token) => token.as_transition_token_direct_purchase(), + } + } + + fn as_transition_token_set_price_for_direct_purchase( + &self, + ) -> Option<&TokenSetPriceForDirectPurchaseTransition> { + match self { + BatchedTransitionRef::Document(_) => None, + BatchedTransitionRef::Token(token) => { + token.as_transition_token_set_price_for_direct_purchase() + } + } + } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs index c3fd45cf9f2..e44da77d552 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs @@ -20,6 +20,7 @@ pub enum TokenDirectPurchaseTransition { impl Default for TokenDirectPurchaseTransition { fn default() -> Self { - TokenDirectPurchaseTransition::V0(TokenDirectPurchaseTransitionV0::default()) // since only v0 + TokenDirectPurchaseTransition::V0(TokenDirectPurchaseTransitionV0::default()) + // since only v0 } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs index 3499ceb6a69..1c70bba6908 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs @@ -1,12 +1,12 @@ pub mod v0_methods; +use crate::balances::credits::TokenAmount; +use crate::fee::Credits; use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; use bincode::{Decode, Encode}; #[cfg(feature = "state-transition-serde-conversion")] use serde::{Deserialize, Serialize}; use std::fmt; -use crate::balances::credits::TokenAmount; -use crate::fee::Credits; /// The Identifier fields in [`TokenDirectPurchaseTransition`] pub use super::super::document_base_transition::IDENTIFIER_FIELDS; @@ -23,19 +23,17 @@ pub struct TokenDirectPurchaseTransitionV0 { pub base: TokenBaseTransition, /// How many tokens should we buy. pub token_count: TokenAmount, - /// Agreed price per token - /// The user will pay this amount times the token count - pub agreed_price_per_token: Credits, + /// Agreed price + /// The user will pay this amount + pub total_agreed_price: Credits, } impl fmt::Display for TokenDirectPurchaseTransitionV0 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, - "Token DirectPurchase, base: {}, token count: {}, price per token {}", - self.base, - self.token_count, - self.agreed_price_per_token + "Token DirectPurchase, base: {}, token count: {}, price {}", + self.base, self.token_count, self.total_agreed_price ) } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/v0_methods.rs index d3f3c6225b4..34d56ae32b6 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/v0_methods.rs @@ -18,16 +18,14 @@ impl TokenBaseTransitionAccessors for TokenDirectPurchaseTransitionV0 { } } -pub trait TokenDirectPurchaseTransitionV0Methods: - TokenBaseTransitionAccessors -{ +pub trait TokenDirectPurchaseTransitionV0Methods: TokenBaseTransitionAccessors { fn token_count(&self) -> TokenAmount; fn set_token_count(&mut self, token_count: TokenAmount); - fn agreed_price_per_token(&self) -> Credits; + fn total_agreed_price(&self) -> Credits; - fn set_agreed_price_per_token(&mut self, credits: Credits); + fn set_total_agreed_price(&mut self, credits: Credits); } impl TokenDirectPurchaseTransitionV0Methods for TokenDirectPurchaseTransitionV0 { @@ -39,11 +37,11 @@ impl TokenDirectPurchaseTransitionV0Methods for TokenDirectPurchaseTransitionV0 self.token_count = token_count; } - fn agreed_price_per_token(&self) -> Credits { - self.agreed_price_per_token + fn total_agreed_price(&self) -> Credits { + self.total_agreed_price } - fn set_agreed_price_per_token(&mut self, credits: Credits) { - self.agreed_price_per_token = credits; + fn set_total_agreed_price(&mut self, credits: Credits) { + self.total_agreed_price = credits; } -} \ No newline at end of file +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0_methods.rs index f58f7f99bcd..516783b1aba 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0_methods.rs @@ -26,7 +26,6 @@ impl TokenBaseTransitionAccessors for TokenDirectPurchaseTransition { } impl TokenDirectPurchaseTransitionV0Methods for TokenDirectPurchaseTransition { - fn token_count(&self) -> TokenAmount { match self { TokenDirectPurchaseTransition::V0(v0) => v0.token_count(), @@ -39,15 +38,15 @@ impl TokenDirectPurchaseTransitionV0Methods for TokenDirectPurchaseTransition { } } - fn agreed_price_per_token(&self) -> Credits { + fn total_agreed_price(&self) -> Credits { match self { - TokenDirectPurchaseTransition::V0(v0) => v0.agreed_price_per_token(), + TokenDirectPurchaseTransition::V0(v0) => v0.total_agreed_price(), } } - fn set_agreed_price_per_token(&mut self, credits: Credits) { + fn set_total_agreed_price(&mut self, credits: Credits) { match self { - TokenDirectPurchaseTransition::V0(v0) => v0.set_agreed_price_per_token(credits), + TokenDirectPurchaseTransition::V0(v0) => v0.set_total_agreed_price(credits), } } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/v0/mod.rs index 4e56d944605..366c26101fb 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/validate_structure/v0/mod.rs @@ -2,10 +2,10 @@ use crate::consensus::basic::token::InvalidTokenAmountError; use crate::consensus::basic::BasicError; use crate::consensus::ConsensusError; use crate::data_contract::associated_token::token_perpetual_distribution::distribution_function::MAX_DISTRIBUTION_PARAM; +use crate::state_transition::batch_transition::token_direct_purchase_transition::v0::v0_methods::TokenDirectPurchaseTransitionV0Methods; use crate::state_transition::batch_transition::TokenDirectPurchaseTransition; use crate::validation::SimpleConsensusValidationResult; use crate::ProtocolError; -use crate::state_transition::batch_transition::token_direct_purchase_transition::v0::v0_methods::TokenDirectPurchaseTransitionV0Methods; pub(super) trait TokenDirectPurchaseTransitionActionStructureValidationV0 { fn validate_structure_v0(&self) -> Result; diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs index e42c7c3e5f8..537febbc887 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs @@ -19,6 +19,8 @@ pub enum TokenSetPriceForDirectPurchaseTransition { } impl Default for TokenSetPriceForDirectPurchaseTransition { fn default() -> Self { - TokenSetPriceForDirectPurchaseTransition::V0(TokenSetPriceForDirectPurchaseTransitionV0::default()) // since only v0 + TokenSetPriceForDirectPurchaseTransition::V0( + TokenSetPriceForDirectPurchaseTransitionV0::default(), + ) // since only v0 } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/mod.rs index f1035c0df13..b91c515a934 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/mod.rs @@ -1,13 +1,13 @@ pub mod v0_methods; +/// The Identifier fields in [`TokenSetPriceForDirectPurchaseTransition`] +pub use super::super::document_base_transition::IDENTIFIER_FIELDS; use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; use bincode::{Decode, Encode}; #[cfg(feature = "state-transition-serde-conversion")] use serde::{Deserialize, Serialize}; use std::fmt; -use crate::tokens::token_pricing_schedule::TokenPricingSchedule; -/// The Identifier fields in [`TokenSetPriceForDirectPurchaseTransition`] -pub use super::super::document_base_transition::IDENTIFIER_FIELDS; #[derive(Debug, Clone, Default, Encode, Decode, PartialEq)] #[cfg_attr( @@ -49,9 +49,7 @@ impl fmt::Display for TokenSetPriceForDirectPurchaseTransitionV0 { write!( f, "Token Set Price for Direct Purchase, base: {}, price: {}, public note: {}", - self.base, - price_str, - note_str + self.base, price_str, note_str ) } -} \ No newline at end of file +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/v0_methods.rs index 1ebabe0d76a..8ec1935292b 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0/v0_methods.rs @@ -24,7 +24,7 @@ impl TokenBaseTransitionAccessors for TokenSetPriceForDirectPurchaseTransitionV0 pub trait TokenSetPriceForDirectPurchaseTransitionV0Methods: TokenBaseTransitionAccessors + AllowedAsMultiPartyAction { - fn price(&self) -> Option; + fn price(&self) -> Option<&TokenPricingSchedule>; fn set_price(&mut self, price: Option); @@ -38,7 +38,9 @@ pub trait TokenSetPriceForDirectPurchaseTransitionV0Methods: fn set_public_note(&mut self, public_note: Option); } -impl TokenSetPriceForDirectPurchaseTransitionV0Methods for TokenSetPriceForDirectPurchaseTransitionV0 { +impl TokenSetPriceForDirectPurchaseTransitionV0Methods + for TokenSetPriceForDirectPurchaseTransitionV0 +{ fn price(&self) -> Option<&TokenPricingSchedule> { self.price.as_ref() } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs index 644bd7440cf..15409f6009f 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/v0_methods.rs @@ -1,5 +1,4 @@ use platform_value::Identifier; -use crate::fee::Credits; use crate::prelude::IdentityNonce; use crate::state_transition::batch_transition::batched_transition::multi_party_action::AllowedAsMultiPartyAction; use crate::state_transition::batch_transition::token_base_transition::token_base_transition_accessors::TokenBaseTransitionAccessors; @@ -29,14 +28,16 @@ impl TokenBaseTransitionAccessors for TokenSetPriceForDirectPurchaseTransition { } } -impl TokenSetPriceForDirectPurchaseTransitionV0Methods for TokenSetPriceForDirectPurchaseTransition { +impl TokenSetPriceForDirectPurchaseTransitionV0Methods + for TokenSetPriceForDirectPurchaseTransition +{ fn price(&self) -> Option<&TokenPricingSchedule> { match self { TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.price(), } } - fn set_price(&mut self, price: Option) { + fn set_price(&mut self, price: Option) { match self { TokenSetPriceForDirectPurchaseTransition::V0(v0) => v0.set_price(price), } @@ -81,7 +82,12 @@ impl TokenSetPriceForDirectPurchaseTransition { bytes.extend_from_slice(owner_id); bytes.extend_from_slice(&identity_contract_nonce.to_be_bytes()); if let Some(price_per_token) = price_per_token { - bytes.extend_from_slice(&price_per_token.minimum_purchase_amount_and_price().1.to_be_bytes()); + bytes.extend_from_slice( + &price_per_token + .minimum_purchase_amount_and_price() + .1 + .to_be_bytes(), + ); } hash_double(bytes).into() diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/mod.rs index 9f51edc1b40..e4b169a7a20 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/mod.rs @@ -13,7 +13,9 @@ pub trait TokenSetPriceForDirectPurchaseTransitionStructureValidation { ) -> Result; } -impl TokenSetPriceForDirectPurchaseTransitionStructureValidation for TokenSetPriceForDirectPurchaseTransition { +impl TokenSetPriceForDirectPurchaseTransitionStructureValidation + for TokenSetPriceForDirectPurchaseTransition +{ fn validate_structure( &self, platform_version: &PlatformVersion, diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/v0/mod.rs index 52268a39220..57cd63e9e06 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/validate_structure/v0/mod.rs @@ -10,10 +10,12 @@ use crate::ProtocolError; pub(super) trait TokenSetPriceForDirectPurchaseTransitionActionStructureValidationV0 { fn validate_structure_v0(&self) -> Result; } -impl TokenSetPriceForDirectPurchaseTransitionActionStructureValidationV0 for TokenSetPriceForDirectPurchaseTransition { +impl TokenSetPriceForDirectPurchaseTransitionActionStructureValidationV0 + for TokenSetPriceForDirectPurchaseTransition +{ fn validate_structure_v0(&self) -> Result { // There is no need to validate the price because setting a price that is too high just makes the token non purchasable - + if let Some(public_note) = self.public_note() { if public_note.len() > MAX_TOKEN_NOTE_LEN { return Ok(SimpleConsensusValidationResult::new_with_error( diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs index c0c40b06275..fa7c3f2590f 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs @@ -34,6 +34,7 @@ use crate::state_transition::batch_transition::token_freeze_transition::v0::v0_m use crate::state_transition::batch_transition::token_mint_transition::v0::v0_methods::TokenMintTransitionV0Methods; use crate::state_transition::batch_transition::token_claim_transition::v0::v0_methods::TokenClaimTransitionV0Methods; use crate::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransition; +use crate::state_transition::batch_transition::token_direct_purchase_transition::v0::v0_methods::TokenDirectPurchaseTransitionV0Methods; use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::v0::v0_methods::TokenSetPriceForDirectPurchaseTransitionV0Methods; use crate::state_transition::batch_transition::token_transfer_transition::v0::v0_methods::TokenTransferTransitionV0Methods; use crate::state_transition::batch_transition::token_unfreeze_transition::v0::v0_methods::TokenUnfreezeTransitionV0Methods; @@ -185,7 +186,9 @@ impl BatchTransitionResolversV0 for TokenTransition { } } - fn as_transition_token_set_price_for_direct_purchase(&self) -> Option<&TokenSetPriceForDirectPurchaseTransition> { + fn as_transition_token_set_price_for_direct_purchase( + &self, + ) -> Option<&TokenSetPriceForDirectPurchaseTransition> { if let Self::SetPriceForDirectPurchase(ref t) = self { Some(t) } else { @@ -305,7 +308,9 @@ impl TokenTransitionV0Methods for TokenTransition { | TokenTransition::EmergencyAction(_) | TokenTransition::ConfigUpdate(_) | TokenTransition::SetPriceForDirectPurchase(_) => true, - TokenTransition::Transfer(_) | TokenTransition::Claim(_) | TokenTransition::DirectPurchase(_) => false, + TokenTransition::Transfer(_) + | TokenTransition::Claim(_) + | TokenTransition::DirectPurchase(_) => false, } } @@ -471,11 +476,15 @@ impl TokenTransitionV0Methods for TokenTransition { claim.public_note().cloned(), ) } - TokenTransition::DirectPurchase(direct_purchase) => { - TokenEvent::DirectPurchase(owner_id, direct_purchase.amount(), ) - } + TokenTransition::DirectPurchase(direct_purchase) => TokenEvent::DirectPurchase( + direct_purchase.token_count(), + direct_purchase.total_agreed_price(), + ), TokenTransition::SetPriceForDirectPurchase(set_price_transition) => { - TokenEvent::SetPriceForDirectPurchase(set_price_transition.price().cloned(), set_price_transition.public_note().cloned()) + TokenEvent::SetPriceForDirectPurchase( + set_price_transition.price().cloned(), + set_price_transition.public_note().cloned(), + ) } }) } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs index 4d2286a04b7..2f625cf3c15 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs @@ -53,7 +53,10 @@ impl TokenTransitionActionTypeGetter for TokenTransition { TokenTransition::Claim(_) => TokenTransitionActionType::Claim, TokenTransition::EmergencyAction(_) => TokenTransitionActionType::EmergencyAction, TokenTransition::ConfigUpdate(_) => TokenTransitionActionType::ConfigUpdate, - TokenTransition::Di + TokenTransition::SetPriceForDirectPurchase(_) => { + TokenTransitionActionType::SetPriceForDirectPurchase + } + TokenTransition::DirectPurchase(_) => TokenTransitionActionType::DirectPurchase, } } } @@ -76,6 +79,10 @@ impl TryFrom<&str> for TokenTransitionActionType { Ok(TokenTransitionActionType::EmergencyAction) } "config_update" | "configUpdate" => Ok(TokenTransitionActionType::ConfigUpdate), + "direct_purchase" | "directPurchase" => Ok(TokenTransitionActionType::DirectPurchase), + "set_price_for_direct_purchase" | "setPriceForDirectPurchase" => { + Ok(TokenTransitionActionType::SetPriceForDirectPurchase) + } action_type => Err(ProtocolError::Generic(format!( "unknown token transition action type {action_type}" ))), diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/mod.rs index b2be9517500..93a886b1b84 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/mod.rs @@ -21,14 +21,15 @@ pub use self::batched_transition::{ token_config_update_transition::TokenConfigUpdateTransition, token_destroy_frozen_funds_transition, token_destroy_frozen_funds_transition::TokenDestroyFrozenFundsTransition, + token_direct_purchase_transition, + token_direct_purchase_transition::TokenDirectPurchaseTransition, token_emergency_action_transition, token_emergency_action_transition::TokenEmergencyActionTransition, token_freeze_transition, token_freeze_transition::TokenFreezeTransition, token_mint_transition, - token_mint_transition::TokenMintTransition, token_transfer_transition, - token_transfer_transition::TokenTransferTransition, token_unfreeze_transition, - token_unfreeze_transition::TokenUnfreezeTransition, - token_direct_purchase_transition, token_direct_purchase_transition::TokenBuyTransition, - token_set_price_for_direct_purchase_transition, token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransition + token_mint_transition::TokenMintTransition, token_set_price_for_direct_purchase_transition, + token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransition, + token_transfer_transition, token_transfer_transition::TokenTransferTransition, + token_unfreeze_transition, token_unfreeze_transition::TokenUnfreezeTransition, }; use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize, PlatformSignable}; diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/resolvers/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/resolvers/v0/mod.rs index 5789fdd9afb..bdad604186b 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/resolvers/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/resolvers/v0/mod.rs @@ -2,8 +2,13 @@ use crate::state_transition::batch_transition::batched_transition::token_unfreez use crate::state_transition::batch_transition::batched_transition::{ DocumentPurchaseTransition, DocumentTransferTransition, }; -use crate::state_transition::batch_transition::{DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, TokenBurnTransition, TokenClaimTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenSetPriceForDirectPurchaseTransition, TokenTransferTransition}; use crate::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransition; +use crate::state_transition::batch_transition::{ + DocumentCreateTransition, DocumentDeleteTransition, DocumentReplaceTransition, + TokenBurnTransition, TokenClaimTransition, TokenConfigUpdateTransition, + TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, + TokenMintTransition, TokenSetPriceForDirectPurchaseTransition, TokenTransferTransition, +}; pub trait BatchTransitionResolversV0 { fn as_transition_create(&self) -> Option<&DocumentCreateTransition>; @@ -25,5 +30,7 @@ pub trait BatchTransitionResolversV0 { fn as_transition_token_config_update(&self) -> Option<&TokenConfigUpdateTransition>; fn as_transition_token_direct_purchase(&self) -> Option<&TokenDirectPurchaseTransition>; - fn as_transition_token_set_price_for_direct_purchase(&self) -> Option<&TokenSetPriceForDirectPurchaseTransition>; + fn as_transition_token_set_price_for_direct_purchase( + &self, + ) -> Option<&TokenSetPriceForDirectPurchaseTransition>; } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/validation/validate_basic_structure/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/validation/validate_basic_structure/v0/mod.rs index 3ab68d5219b..60661a44916 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/validation/validate_basic_structure/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/validation/validate_basic_structure/v0/mod.rs @@ -27,6 +27,8 @@ use crate::state_transition::batch_transition::token_emergency_action_transition use crate::state_transition::batch_transition::token_freeze_transition::validate_structure::TokenFreezeTransitionStructureValidation; use crate::state_transition::batch_transition::token_mint_transition::validate_structure::TokenMintTransitionStructureValidation; use crate::state_transition::batch_transition::token_claim_transition::validate_structure::TokenClaimTransitionStructureValidation; +use crate::state_transition::batch_transition::token_direct_purchase_transition::validate_structure::TokenDirectPurchaseTransitionStructureValidation; +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::validate_structure::TokenSetPriceForDirectPurchaseTransitionStructureValidation; use crate::state_transition::batch_transition::token_transfer_transition::validate_structure::TokenTransferTransitionStructureValidation; use crate::state_transition::batch_transition::token_unfreeze_transition::validate_structure::TokenUnfreezeTransitionStructureValidation; use crate::state_transition::state_transitions::document::batch_transition::batched_transition::document_transition::{DocumentTransition, DocumentTransitionV0Methods}; @@ -170,6 +172,14 @@ impl BatchTransition { TokenTransition::Claim(release_transition) => { release_transition.validate_structure(platform_version)? } + TokenTransition::DirectPurchase(direct_purchase_transition) => { + direct_purchase_transition.validate_structure(platform_version)? + } + TokenTransition::SetPriceForDirectPurchase( + set_price_for_direct_purchase_transition, + ) => { + set_price_for_direct_purchase_transition.validate_structure(platform_version)? + } }; if !consensus_result.is_valid() { diff --git a/packages/rs-dpp/src/tokens/token_event.rs b/packages/rs-dpp/src/tokens/token_event.rs index 6f52b4d77a5..2e3408fa109 100644 --- a/packages/rs-dpp/src/tokens/token_event.rs +++ b/packages/rs-dpp/src/tokens/token_event.rs @@ -6,6 +6,7 @@ use crate::data_contract::associated_token::token_distribution_key::TokenDistrib use crate::data_contract::associated_token::token_perpetual_distribution::distribution_recipient::TokenDistributionResolvedRecipient; use crate::data_contract::document_type::DocumentTypeRef; use crate::document::{Document, DocumentV0}; +use crate::fee::Credits; use crate::prelude::{ DataContract, DerivationEncryptionKeyIndex, IdentityNonce, RootEncryptionKeyIndex, }; @@ -14,7 +15,6 @@ use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; use platform_value::Identifier; use platform_version::version::PlatformVersion; use std::collections::BTreeMap; -use crate::fee::Credits; pub type TokenEventPublicNote = Option; pub type TokenEventSharedEncryptedNote = Option; @@ -25,9 +25,9 @@ pub type TokenEventPersonalEncryptedNote = Option<( )>; use crate::serialization::PlatformSerializableWithPlatformVersion; use crate::tokens::emergency_action::TokenEmergencyAction; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; use crate::tokens::SharedEncryptedNote; use crate::ProtocolError; -use crate::tokens::token_pricing_schedule::TokenPricingSchedule; pub type RecipientIdentifier = Identifier; @@ -59,7 +59,7 @@ pub enum TokenEvent { EmergencyAction(TokenEmergencyAction, TokenEventPublicNote), ConfigUpdate(TokenConfigurationChangeItem, TokenEventPublicNote), SetPriceForDirectPurchase(Option, TokenEventPublicNote), - DirectPurchase(PurchaserIdentifier, TokenAmount, Credits), + DirectPurchase(TokenAmount, Credits), } impl TokenEvent { @@ -74,6 +74,7 @@ impl TokenEvent { TokenEvent::Claim(..) => "claim", TokenEvent::EmergencyAction(..) => "emergencyAction", TokenEvent::ConfigUpdate(..) => "configUpdate", + TokenEvent::DirectPurchase(..) => "directPurchase", TokenEvent::SetPriceForDirectPurchase(..) => "setPriceForDirectPurchase", } } @@ -253,14 +254,14 @@ impl TokenEvent { properties } TokenEvent::SetPriceForDirectPurchase(price, note) => { - let mut properties = BTreeMap::from([ - ("tokenId".to_string(), token_id.into()), - ]); + let mut properties = BTreeMap::from([("tokenId".to_string(), token_id.into())]); if let Some(price_schedule) = price { properties.insert( "priceSchedule".to_string(), - price_schedule.serialize_consume_to_bytes_with_platform_version(platform_version)?.into(), + price_schedule + .serialize_consume_to_bytes_with_platform_version(platform_version)? + .into(), ); } @@ -268,6 +269,15 @@ impl TokenEvent { properties.insert("note".to_string(), note.into()); } + properties + } + TokenEvent::DirectPurchase(amount, total_cost) => { + let properties = BTreeMap::from([ + ("tokenId".to_string(), token_id.into()), + ("tokenAmount".to_string(), amount.into()), + ("purchaseCost".to_string(), total_cost.into()), + ]); + properties } }; diff --git a/packages/rs-dpp/src/tokens/token_pricing_schedule.rs b/packages/rs-dpp/src/tokens/token_pricing_schedule.rs index 25b09e2a5e9..eed804950c5 100644 --- a/packages/rs-dpp/src/tokens/token_pricing_schedule.rs +++ b/packages/rs-dpp/src/tokens/token_pricing_schedule.rs @@ -1,12 +1,24 @@ -use std::collections::BTreeMap; -use bincode_derive::{Decode, Encode}; -use derive_more::Display; -use serde::{Deserialize, Serialize}; -use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; use crate::balances::credits::TokenAmount; +use crate::errors::ProtocolError; use crate::fee::Credits; +use bincode_derive::{Decode, Encode}; +use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use std::fmt::{self, Display, Formatter}; -#[derive(Debug, Clone, Encode, Decode, Eq, PartialEq, Ord, PartialOrd, Display, PlatformSerialize, PlatformDeserialize)] +#[derive( + Debug, + Clone, + Encode, + Decode, + Eq, + PartialEq, + Ord, + PartialOrd, + PlatformSerialize, + PlatformDeserialize, +)] #[cfg_attr( feature = "state-transition-serde-conversion", derive(Serialize, Deserialize) @@ -20,7 +32,30 @@ impl TokenPricingSchedule { pub fn minimum_purchase_amount_and_price(&self) -> (TokenAmount, Credits) { match self { TokenPricingSchedule::SinglePrice(price) => (1, *price), - TokenPricingSchedule::SetPrices(prices) => prices.first_key_value().map(|(amount, cost)| (*amount, *cost)).unwrap_or_default() + TokenPricingSchedule::SetPrices(prices) => prices + .first_key_value() + .map(|(amount, cost)| (*amount, *cost)) + .unwrap_or_default(), + } + } +} + +impl Display for TokenPricingSchedule { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + match self { + TokenPricingSchedule::SinglePrice(credits) => { + write!(f, "SinglePrice: {}", credits) + } + TokenPricingSchedule::SetPrices(prices) => { + write!(f, "SetPrices: [")?; + for (i, (amount, credits)) in prices.iter().enumerate() { + if i > 0 { + write!(f, ", ")?; + } + write!(f, "{} => {}", amount, credits)?; + } + write!(f, "]") + } } } } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs new file mode 100644 index 00000000000..6a1facda159 --- /dev/null +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs @@ -0,0 +1,190 @@ +mod token_selling_tests { + use super::*; + #[test] + fn test_successful_direct_purchase_single_price() { + let platform_version = PlatformVersion::latest(); + let mut platform = TestPlatformBuilder::new() + .with_latest_protocol_version() + .build_with_mock_rpc() + .set_genesis_state(); + + let mut rng = StdRng::seed_from_u64(12345); + let (seller, seller_signer, seller_key) = + setup_identity(&mut platform, rng.gen(), dash_to_credits!(1.0)); + let (buyer, buyer_signer, buyer_key) = + setup_identity(&mut platform, rng.gen(), dash_to_credits!(10.0)); + + let (contract, token_id) = create_token_contract_with_owner_identity( + &mut platform, + seller.id(), + None::, + None, + None, + platform_version, + ); + + // Seller sets single price + let set_price_transition = + BatchTransition::new_token_set_price_for_direct_purchase_transition( + token_id, + seller.id(), + contract.id(), + 0, + Some(TokenPricingSchedule::SinglePrice(500)), // Price per token + None, + &seller_key, + 2, + 0, + &seller_signer, + platform_version, + None, + None, + None, + ) + .unwrap(); + + process_state_transition( + &mut platform, + set_price_transition, + &platform.state.load(), + platform_version, + ); + + // Buyer purchases tokens + let purchase_transition = BatchTransition::new_token_direct_purchase_transition( + token_id, + buyer.id(), + contract.id(), + 0, + 10, // Buying 10 tokens + 500, // Agreed price per token + &buyer_key, + 2, + 0, + &buyer_signer, + platform_version, + None, + None, + None, + ) + .unwrap(); + + process_state_transition( + &mut platform, + purchase_transition, + &platform.state.load(), + platform_version, + ); + + let token_balance = platform + .drive + .fetch_identity_token_balance( + token_id.to_buffer(), + buyer.id().to_buffer(), + None, + platform_version, + ) + .expect("expected to fetch token balance"); + assert_eq!(token_balance, Some(10)); + + let buyer_credit_balance = platform + .drive + .fetch_identity_balance(buyer.id().to_buffer(), None, platform_version) + .expect("expected to fetch credit balance"); + assert_eq!(buyer_credit_balance, dash_to_credits!(5.0)); // 10.0 - 5.0 spent (10 tokens * 500 credits) + } + + #[test] + fn test_direct_purchase_insufficient_credits() { + let platform_version = PlatformVersion::latest(); + let mut platform = TestPlatformBuilder::new() + .with_latest_protocol_version() + .build_with_mock_rpc() + .set_genesis_state(); + + let mut rng = StdRng::seed_from_u64(67890); + let (seller, seller_signer, seller_key) = + setup_identity(&mut platform, rng.gen(), dash_to_credits!(1.0)); + let (buyer, buyer_signer, buyer_key) = + setup_identity(&mut platform, rng.gen(), dash_to_credits!(0.01)); // insufficient credits + + let (contract, token_id) = create_token_contract_with_owner_identity( + &mut platform, + seller.id(), + None::, + None, + None, + platform_version, + ); + + let set_price_transition = + BatchTransition::new_token_set_price_for_direct_purchase_transition( + token_id, + seller.id(), + contract.id(), + 0, + Some(TokenPricingSchedule::SinglePrice(5000)), // High price + None, + &seller_key, + 2, + 0, + &seller_signer, + platform_version, + None, + None, + None, + ) + .unwrap(); + + process_state_transition( + &mut platform, + set_price_transition, + &platform.state.load(), + platform_version, + ); + + let purchase_transition = BatchTransition::new_token_direct_purchase_transition( + token_id, + buyer.id(), + contract.id(), + 0, + 1, // Buying 1 token + 5000, // Agreed price per token + &buyer_key, + 2, + 0, + &buyer_signer, + platform_version, + None, + None, + None, + ) + .unwrap(); + + let processing_result = process_state_transition( + &mut platform, + purchase_transition, + &platform.state.load(), + platform_version, + ); + + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::PaidConsensusError( + ConsensusError::BasicError(BasicError::InsufficientBalanceError(_)), + _ + )] + ); + + let token_balance = platform + .drive + .fetch_identity_token_balance( + token_id.to_buffer(), + buyer.id().to_buffer(), + None, + platform_version, + ) + .expect("expected to fetch token balance"); + assert_eq!(token_balance, None); + } +} diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/mod.rs index ab883e45de6..cc7a4b948f0 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/mod.rs @@ -1,4 +1,6 @@ +mod direct_selling; mod distribution; + use super::*; use crate::execution::validation::state_transition::tests::create_token_contract_with_owner_identity; use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult; diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs index 868de9b9e3b..fda795e8fcf 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs @@ -118,7 +118,7 @@ pub(in crate::execution) mod tests { use crate::expect_match; use crate::platform_types::platform_state::PlatformState; use crate::platform_types::platform_state::v0::PlatformStateV0Methods; - use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult; + use crate::platform_types::state_transitions_processing_result::{StateTransitionExecutionResult, StateTransitionsProcessingResult}; use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult::{SuccessfulExecution, UnpaidConsensusError}; use crate::execution::types::block_state_info::BlockStateInfo; use crate::execution::types::block_state_info::v0::BlockStateInfoV0; @@ -131,6 +131,7 @@ pub(in crate::execution) mod tests { use dpp::tokens::gas_fees_paid_by::GasFeesPaidBy; use dpp::tokens::token_amount_on_contract_token::{DocumentActionTokenCost, DocumentActionTokenEffect}; use dpp::data_contract::document_type::accessors::DocumentTypeV0MutGetters; + use crate::platform_types::platform::Platform; /// We add an identity, but we also add the same amount to system credits pub(in crate::execution) fn setup_identity_with_system_credits( @@ -2469,4 +2470,39 @@ pub(in crate::execution) mod tests { basic_token_contract } + + pub(in crate::execution) fn process_state_transition( + platform: &mut TempPlatform, + state_transition: S, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> StateTransitionsProcessingResult { + let serialized_state_transition = state_transition + .serialize_to_bytes() + .expect("expected documents batch serialized state transition"); + + let transaction = platform.drive.grove.start_transaction(); + + let processing_result = platform + .platform + .process_raw_state_transitions( + &vec![serialized_state_transition], + &platform_state, + &BlockInfo::default(), + &transaction, + platform_version, + false, + None, + ) + .expect("expected to process state transition"); + + platform + .drive + .grove + .commit_transaction(transaction) + .unwrap() + .expect("expected to commit transaction"); + + processing_result + } } diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs index be5b26d0df0..4638abc332d 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/mod.rs @@ -2,11 +2,11 @@ mod token_burn_transition; mod token_claim_transition; mod token_config_update_transition; mod token_destroy_frozen_funds_transition; +mod token_direct_purchase_transition; mod token_emergency_action_transition; mod token_freeze_transition; mod token_mint_transition; +mod token_set_price_for_direct_purchase_transition; mod token_transfer_transition; mod token_transition; mod token_unfreeze_transition; -mod token_set_price_for_direct_purchase_transition; -mod token_direct_purchase_transition; diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_direct_purchase_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_direct_purchase_transition.rs index 04457d404f8..e1f43cdd198 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_direct_purchase_transition.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_direct_purchase_transition.rs @@ -40,43 +40,55 @@ impl DriveHighLevelBatchOperationConverter for TokenDirectPurchaseTransitionActi nonce: identity_contract_nonce, }, )]; - - ops.push(TokenOperation(TokenOperationType::TokenMint { - token_id: self.token_id(), - identity_balance_holder_id: owner_id, - mint_amount: self.token_count(), - allow_first_mint: true, - allow_saturation: false, - })); - ops.push(IdentityOperation(IdentityOperationType::RemoveFromIdentityBalance { - identity_id: owner_id.to_buffer(), - balance_to_remove: self.token_count()*self.agreed_price_per_token(), - })); - ops.push(IdentityOperation(IdentityOperationType::AddToIdentityBalance { - identity_id: self.base().data_contract_fetch_info().contract.owner_id().to_buffer(), - added_balance: self.token_count()*self.agreed_price_per_token(), + ops.push(TokenOperation(TokenOperationType::TokenMint { + token_id: self.token_id(), + identity_balance_holder_id: owner_id, + mint_amount: self.token_count(), + allow_first_mint: true, + allow_saturation: false, })); + ops.push(IdentityOperation( + IdentityOperationType::RemoveFromIdentityBalance { + identity_id: owner_id.to_buffer(), + balance_to_remove: self.total_agreed_price(), + }, + )); + ops.push(IdentityOperation( + IdentityOperationType::AddToIdentityBalance { + identity_id: self + .base() + .data_contract_fetch_info() + .contract + .owner_id() + .to_buffer(), + added_balance: self.total_agreed_price(), + }, + )); + let token_configuration = self.base().token_configuration()?; - if token_configuration.keeps_history().keeps_direct_purchase_history() { - ops.push(TokenOperation(TokenOperationType::TokenHistory { - token_id: self.token_id(), - owner_id, - nonce: identity_contract_nonce, - event: TokenEvent::DirectPurchase( - owner_id, - self.token_count(), - self.agreed_price_per_token(), - ), - })); - } + if token_configuration + .keeps_history() + .keeps_direct_purchase_history() + { + ops.push(TokenOperation(TokenOperationType::TokenHistory { + token_id: self.token_id(), + owner_id, + nonce: identity_contract_nonce, + event: TokenEvent::DirectPurchase( + self.token_count(), + self.total_agreed_price(), + ), + })); + } Ok(ops) } version => Err(Error::Drive(DriveError::UnknownVersionMismatch { - method: "TokenDirectPurchaseTransitionAction::into_high_level_document_drive_operations" - .to_string(), + method: + "TokenDirectPurchaseTransitionAction::into_high_level_document_drive_operations" + .to_string(), known_versions: vec![0], received: version, })), diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs index ebe20d6d334..50e54709054 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs @@ -53,7 +53,7 @@ impl DriveHighLevelBatchOperationConverter for TokenSetPriceForDirectPurchaseTra }) = self.base().store_in_group() { let event = TokenEvent::SetPriceForDirectPurchase( - self.price(), + self.price().cloned(), self.public_note().cloned(), ); @@ -78,7 +78,7 @@ impl DriveHighLevelBatchOperationConverter for TokenSetPriceForDirectPurchaseTra if self.base().perform_action() { ops.push(TokenOperation(TokenOperationType::TokenSetPriceForDirectPurchase { token_id: self.token_id(), - price: self.price(), + price: self.price().cloned(), })); let token_configuration = self.base().token_configuration()?; @@ -88,7 +88,7 @@ impl DriveHighLevelBatchOperationConverter for TokenSetPriceForDirectPurchaseTra owner_id, nonce: identity_contract_nonce, event: TokenEvent::SetPriceForDirectPurchase( - self.price(), + self.price().cloned(), self.public_note_owned(), ), })); diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_transition.rs index 691674d9f34..372240091c0 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_transition.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_transition.rs @@ -13,6 +13,8 @@ use crate::state_transition_action::batch::batched_transition::token_transition: use crate::state_transition_action::batch::batched_transition::token_transition::token_freeze_transition_action::TokenFreezeTransitionActionAccessorsV0; use crate::state_transition_action::batch::batched_transition::token_transition::token_mint_transition_action::TokenMintTransitionActionAccessorsV0; use crate::state_transition_action::batch::batched_transition::token_transition::token_claim_transition_action::TokenClaimTransitionActionAccessorsV0; +use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::TokenDirectPurchaseTransitionActionAccessorsV0; +use crate::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0; use crate::state_transition_action::batch::batched_transition::token_transition::token_transfer_transition_action::TokenTransferTransitionActionAccessorsV0; use crate::state_transition_action::batch::batched_transition::token_transition::token_unfreeze_transition_action::TokenUnfreezeTransitionActionAccessorsV0; @@ -57,6 +59,11 @@ impl DriveHighLevelBatchOperationConverter for TokenTransitionAction { } TokenTransitionAction::ConfigUpdateAction(token_config_update) => token_config_update .into_high_level_batch_drive_operations(epoch, owner_id, platform_version), + TokenTransitionAction::DirectPurchaseAction(direct_purchase) => direct_purchase + .into_high_level_batch_drive_operations(epoch, owner_id, platform_version), + TokenTransitionAction::SetPriceForDirectPurchaseAction(set_price) => { + set_price.into_high_level_batch_drive_operations(epoch, owner_id, platform_version) + } } } } @@ -115,6 +122,18 @@ impl TokenTransitionAction { config_update.update_token_configuration_item().clone(), config_update.public_note().cloned(), ), + TokenTransitionAction::DirectPurchaseAction(purchase_action) => { + TokenEvent::DirectPurchase( + purchase_action.token_count(), + purchase_action.total_agreed_price(), + ) + } + TokenTransitionAction::SetPriceForDirectPurchaseAction(set_price_action) => { + TokenEvent::SetPriceForDirectPurchase( + set_price_action.price().cloned(), + set_price_action.public_note().cloned(), + ) + } } } } diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/mod.rs index c536d1f3b21..cbbef1173cf 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/mod.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/mod.rs @@ -54,7 +54,8 @@ use crate::state_transition_action::batch::batched_transition::token_transition: use crate::state_transition_action::batch::batched_transition::token_transition::token_destroy_frozen_funds_transition_action::TokenDestroyFrozenFundsTransitionAction; use crate::state_transition_action::batch::batched_transition::token_transition::token_destroy_frozen_funds_transition_action::TokenDestroyFrozenFundsTransitionActionAccessorsV0; use crate::state_transition_action::batch::batched_transition::token_transition::token_claim_transition_action::{TokenClaimTransitionAction, TokenClaimTransitionActionAccessorsV0}; -use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::TokenDirectPurchaseTransitionAction; +use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::{TokenDirectPurchaseTransitionAction, TokenDirectPurchaseTransitionActionAccessorsV0}; +use crate::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::{TokenSetPriceForDirectPurchaseTransitionAction, TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0}; /// token action #[derive(Debug, Clone, From)] @@ -96,6 +97,8 @@ impl TokenTransitionAction { TokenTransitionAction::EmergencyActionAction(action) => action.base(), TokenTransitionAction::DestroyFrozenFundsAction(action) => action.base(), TokenTransitionAction::ConfigUpdateAction(action) => action.base(), + TokenTransitionAction::DirectPurchaseAction(action) => action.base(), + TokenTransitionAction::SetPriceForDirectPurchaseAction(action) => action.base(), } } @@ -111,6 +114,8 @@ impl TokenTransitionAction { TokenTransitionAction::EmergencyActionAction(action) => action.base_owned(), TokenTransitionAction::DestroyFrozenFundsAction(action) => action.base_owned(), TokenTransitionAction::ConfigUpdateAction(action) => action.base_owned(), + TokenTransitionAction::DirectPurchaseAction(action) => action.base_owned(), + TokenTransitionAction::SetPriceForDirectPurchaseAction(action) => action.base_owned(), } } @@ -126,6 +131,8 @@ impl TokenTransitionAction { TokenTransitionAction::EmergencyActionAction(_) => "emergencyAction", TokenTransitionAction::DestroyFrozenFundsAction(_) => "destroyFrozenFunds", TokenTransitionAction::ConfigUpdateAction(_) => "configUpdate", + TokenTransitionAction::DirectPurchaseAction(_) => "directPurchase", + TokenTransitionAction::SetPriceForDirectPurchaseAction(_) => "directPricing", } } @@ -183,6 +190,12 @@ impl TokenTransitionAction { TokenTransitionAction::EmergencyActionAction(_) => Ok(true), TokenTransitionAction::DestroyFrozenFundsAction(_) => Ok(true), TokenTransitionAction::ConfigUpdateAction(_) => Ok(true), + TokenTransitionAction::DirectPurchaseAction(_) => { + Ok(keeps_history.keeps_direct_purchase_history()) + } + TokenTransitionAction::SetPriceForDirectPurchaseAction(_) => { + Ok(keeps_history.keeps_direct_pricing_history()) + } } } } diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/mod.rs index 9335cd17ce7..3ef67234e8d 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/mod.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/mod.rs @@ -41,15 +41,15 @@ impl TokenDirectPurchaseTransitionActionAccessorsV0 for TokenDirectPurchaseTrans } } - fn agreed_price_per_token(&self) -> Credits { + fn total_agreed_price(&self) -> Credits { match self { - TokenDirectPurchaseTransitionAction::V0(v0) => v0.agreed_price_per_token, + TokenDirectPurchaseTransitionAction::V0(v0) => v0.total_agreed_price, } } - fn set_agreed_price_per_token(&mut self, agreed_price: Credits) { + fn set_total_agreed_price(&mut self, agreed_price: Credits) { match self { - TokenDirectPurchaseTransitionAction::V0(v0) => v0.agreed_price_per_token = agreed_price, + TokenDirectPurchaseTransitionAction::V0(v0) => v0.total_agreed_price = agreed_price, } } } diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/mod.rs index b656861515f..3ec1c469a01 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/mod.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/mod.rs @@ -14,9 +14,9 @@ pub struct TokenDirectPurchaseTransitionActionV0 { pub base: TokenBaseTransitionAction, /// How many tokens should we buy. pub token_count: TokenAmount, - /// Agreed price per token - /// The user will pay this amount times the token count - pub agreed_price_per_token: Credits, + /// Agreed price + /// The user will pay this amount + pub total_agreed_price: Credits, } /// Accessors for `TokenIssuanceTransitionActionV0` @@ -33,11 +33,11 @@ pub trait TokenDirectPurchaseTransitionActionAccessorsV0 { /// Sets the amount of tokens to purchase fn set_token_count(&mut self, amount: TokenAmount); - /// The agreed price per token - fn agreed_price_per_token(&self) -> Credits; + /// The agreed price + fn total_agreed_price(&self) -> Credits; - /// Sets the agreed price per token - fn set_agreed_price_per_token(&mut self, agreed_price: Credits); + /// Sets the agreed price + fn set_total_agreed_price(&mut self, agreed_price: Credits); /// Returns the token position in the contract fn token_position(&self) -> u16 { @@ -82,11 +82,11 @@ impl TokenDirectPurchaseTransitionActionAccessorsV0 for TokenDirectPurchaseTrans self.token_count = amount; } - fn agreed_price_per_token(&self) -> Credits { - self.agreed_price_per_token + fn total_agreed_price(&self) -> Credits { + self.total_agreed_price } - fn set_agreed_price_per_token(&mut self, agreed_price: Credits) { - self.agreed_price_per_token = agreed_price; + fn set_total_agreed_price(&mut self, agreed_price: Credits) { + self.total_agreed_price = agreed_price; } } diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs index 93911d77729..26ae2099797 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs @@ -59,7 +59,9 @@ impl TokenDirectPurchaseTransitionActionV0 { Error, > { let TokenDirectPurchaseTransitionV0 { - base, token_count, agreed_price_per_token + base, + token_count, + total_agreed_price, } = value; let mut drive_operations = vec![]; @@ -111,7 +113,7 @@ impl TokenDirectPurchaseTransitionActionV0 { TokenDirectPurchaseTransitionActionV0 { base: base_action, token_count, - agreed_price_per_token, + total_agreed_price, } .into(), )) @@ -166,7 +168,9 @@ impl TokenDirectPurchaseTransitionActionV0 { Error, > { let TokenDirectPurchaseTransitionV0 { - base, token_count, agreed_price_per_token + base, + token_count, + total_agreed_price, } = value; let mut drive_operations = vec![]; @@ -195,11 +199,12 @@ impl TokenDirectPurchaseTransitionActionV0 { let base_action = match base_action_validation_result.is_valid() { true => base_action_validation_result.into_data()?, false => { - let bump_action = BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( - base, - owner_id, - user_fee_increase, - ); + let bump_action = + BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( + base, + owner_id, + user_fee_increase, + ); let batched_action = BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); @@ -218,11 +223,11 @@ impl TokenDirectPurchaseTransitionActionV0 { TokenDirectPurchaseTransitionActionV0 { base: base_action, token_count: *token_count, - agreed_price_per_token: *agreed_price_per_token, + total_agreed_price: *total_agreed_price, } - .into(), - )) .into(), + )) + .into(), fee_result, )) } diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/mod.rs index 9bdb47bab2d..2750b3660c2 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/mod.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/mod.rs @@ -1,5 +1,5 @@ use derive_more::From; -use dpp::identifier::Identifier; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; /// transformer module for token issuance transition action pub mod transformer; @@ -16,7 +16,9 @@ pub enum TokenSetPriceForDirectPurchaseTransitionAction { V0(TokenSetPriceForDirectPurchaseTransitionActionV0), } -impl TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 for TokenSetPriceForDirectPurchaseTransitionAction { +impl TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 + for TokenSetPriceForDirectPurchaseTransitionAction +{ fn base(&self) -> &TokenBaseTransitionAction { match self { TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => &v0.base, @@ -29,27 +31,15 @@ impl TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 for TokenSetPrice } } - fn set_price_for_direct_purchase_amount(&self) -> u64 { + fn price(&self) -> Option<&TokenPricingSchedule> { match self { - TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.set_price_for_direct_purchase_amount, + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.price.as_ref(), } } - fn set_set_price_for_direct_purchase_amount(&mut self, amount: u64) { + fn set_price(&mut self, price: Option) { match self { - TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.set_price_for_direct_purchase_amount = amount, - } - } - - fn identity_balance_holder_id(&self) -> Identifier { - match self { - TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.identity_balance_holder_id, - } - } - - fn set_identity_balance_holder_id(&mut self, id: Identifier) { - match self { - TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.identity_balance_holder_id = id, + TokenSetPriceForDirectPurchaseTransitionAction::V0(v0) => v0.price = price, } } diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/mod.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/mod.rs index ee834ccf053..696283281e8 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/mod.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/mod.rs @@ -1,7 +1,6 @@ mod transformer; use std::sync::Arc; -use dpp::fee::Credits; use dpp::identifier::Identifier; use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; use crate::drive::contract::DataContractFetchInfo; @@ -28,11 +27,11 @@ pub trait TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 { fn base_owned(self) -> TokenBaseTransitionAction; /// Returns the price - fn price(&self) -> Option; + fn price(&self) -> Option<&TokenPricingSchedule>; /// Sets the amount of tokens to issuance fn set_price(&mut self, price: Option); - + /// Returns the token position in the contract fn token_position(&self) -> u16 { self.base().token_position() @@ -68,7 +67,9 @@ pub trait TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 { fn set_public_note(&mut self, public_note: Option); } -impl TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 for TokenSetPriceForDirectPurchaseTransitionActionV0 { +impl TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0 + for TokenSetPriceForDirectPurchaseTransitionActionV0 +{ fn base(&self) -> &TokenBaseTransitionAction { &self.base } diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs index 128af6f67a7..e4d85e41fac 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs @@ -5,7 +5,7 @@ use dpp::identifier::Identifier; use dpp::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::v0::TokenSetPriceForDirectPurchaseTransitionV0; use dpp::ProtocolError; use crate::drive::contract::DataContractFetchInfo; -use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::{TokenBaseTransitionAction, TokenBaseTransitionActionAccessorsV0}; +use crate::state_transition_action::batch::batched_transition::token_transition::token_base_transition_action::TokenBaseTransitionAction; use crate::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::v0::TokenSetPriceForDirectPurchaseTransitionActionV0; use dpp::fee::fee_result::FeeResult; use dpp::prelude::{ConsensusValidationResult, UserFeeIncrease}; @@ -60,9 +60,10 @@ impl TokenSetPriceForDirectPurchaseTransitionActionV0 { > { let TokenSetPriceForDirectPurchaseTransitionV0 { base, - price, public_note, + price, + public_note, } = value; - + let mut drive_operations = vec![]; let base_action_validation_result = @@ -108,14 +109,16 @@ impl TokenSetPriceForDirectPurchaseTransitionActionV0 { }; Ok(( - BatchedTransitionAction::TokenAction(TokenTransitionAction::SetPriceForDirectPurchaseAction( - TokenSetPriceForDirectPurchaseTransitionActionV0 { - base: base_action, - price, - public_note, - } - .into(), - )) + BatchedTransitionAction::TokenAction( + TokenTransitionAction::SetPriceForDirectPurchaseAction( + TokenSetPriceForDirectPurchaseTransitionActionV0 { + base: base_action, + price, + public_note, + } + .into(), + ), + ) .into(), fee_result, )) @@ -168,7 +171,8 @@ impl TokenSetPriceForDirectPurchaseTransitionActionV0 { > { let TokenSetPriceForDirectPurchaseTransitionV0 { base, - price, public_note, + price, + public_note, } = value; let mut drive_operations = vec![]; @@ -197,11 +201,12 @@ impl TokenSetPriceForDirectPurchaseTransitionActionV0 { let base_action = match base_action_validation_result.is_valid() { true => base_action_validation_result.into_data()?, false => { - let bump_action = BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( - base, - owner_id, - user_fee_increase, - ); + let bump_action = + BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( + base, + owner_id, + user_fee_increase, + ); let batched_action = BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); @@ -216,15 +221,17 @@ impl TokenSetPriceForDirectPurchaseTransitionActionV0 { }; Ok(( - BatchedTransitionAction::TokenAction(TokenTransitionAction::SetPriceForDirectPurchaseAction( - TokenSetPriceForDirectPurchaseTransitionActionV0 { - base: base_action, - price: price.clone(), - public_note: public_note.clone(), - } + BatchedTransitionAction::TokenAction( + TokenTransitionAction::SetPriceForDirectPurchaseAction( + TokenSetPriceForDirectPurchaseTransitionActionV0 { + base: base_action, + price: price.clone(), + public_note: public_note.clone(), + } .into(), - )) - .into(), + ), + ) + .into(), fee_result, )) } diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transition_action_type.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transition_action_type.rs index b061501cb51..d9a06b61de8 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transition_action_type.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_transition_action_type.rs @@ -19,8 +19,12 @@ impl TokenTransitionActionTypeGetter for TokenTransitionAction { TokenTransitionActionType::DestroyFrozenFunds } TokenTransitionAction::ConfigUpdateAction(_) => TokenTransitionActionType::ConfigUpdate, - TokenTransitionAction::DirectPurchaseAction(_) => {} - TokenTransitionAction::SetPriceForDirectPurchaseAction(_) => {} + TokenTransitionAction::DirectPurchaseAction(_) => { + TokenTransitionActionType::DirectPurchase + } + TokenTransitionAction::SetPriceForDirectPurchaseAction(_) => { + TokenTransitionActionType::SetPriceForDirectPurchase + } } } } diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/token.rs b/packages/rs-drive/src/util/batch/drive_op_batch/token.rs index 999c4e8c12f..e77b5856cc4 100644 --- a/packages/rs-drive/src/util/batch/drive_op_batch/token.rs +++ b/packages/rs-drive/src/util/batch/drive_op_batch/token.rs @@ -123,7 +123,7 @@ pub enum TokenOperationType { /// The price we are setting to /// None means it's not currently for sale price: Option, - } + }, } impl DriveLowLevelOperationConverter for TokenOperationType { @@ -298,6 +298,17 @@ impl DriveLowLevelOperationConverter for TokenOperationType { )?; Ok(batch_operations) } + TokenOperationType::TokenSetPriceForDirectPurchase { token_id, price } => { + let batch_operations = drive.set_token_direct_purchase_price_operations( + token_id, + price, + block_info, + estimated_costs_only_with_layer_info, + transaction, + platform_version, + )?; + Ok(batch_operations) + } } } } diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs index 2ea70f9c38c..f5430e5df97 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs @@ -151,6 +151,10 @@ pub const DRIVE_ABCI_VALIDATION_VERSIONS_V1: DriveAbciValidationVersions = token_base_transition_group_action_validation: 0, token_claim_transition_structure_validation: 0, token_claim_transition_state_validation: 0, + token_direct_purchase_transition_structure_validation: 0, + token_direct_purchase_transition_state_validation: 0, + token_set_price_for_direct_purchase_transition_structure_validation: 0, + token_set_price_for_direct_purchase_transition_state_validation: 0, }, }, has_nonce_validation: 0, diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs index c5f280b3b17..6419d23c603 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs @@ -151,6 +151,10 @@ pub const DRIVE_ABCI_VALIDATION_VERSIONS_V2: DriveAbciValidationVersions = token_base_transition_group_action_validation: 0, token_claim_transition_structure_validation: 0, token_claim_transition_state_validation: 0, + token_direct_purchase_transition_structure_validation: 0, + token_direct_purchase_transition_state_validation: 0, + token_set_price_for_direct_purchase_transition_structure_validation: 0, + token_set_price_for_direct_purchase_transition_state_validation: 0, }, }, has_nonce_validation: 0, diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs index 758e340218d..676e0152bc0 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs @@ -151,6 +151,10 @@ pub const DRIVE_ABCI_VALIDATION_VERSIONS_V3: DriveAbciValidationVersions = token_base_transition_group_action_validation: 0, token_claim_transition_structure_validation: 0, token_claim_transition_state_validation: 0, + token_direct_purchase_transition_structure_validation: 0, + token_direct_purchase_transition_state_validation: 0, + token_set_price_for_direct_purchase_transition_structure_validation: 0, + token_set_price_for_direct_purchase_transition_state_validation: 0, }, }, has_nonce_validation: 0, diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v4.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v4.rs index 7b1ed68b745..88122972c00 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v4.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v4.rs @@ -154,6 +154,10 @@ pub const DRIVE_ABCI_VALIDATION_VERSIONS_V4: DriveAbciValidationVersions = token_base_transition_group_action_validation: 0, token_claim_transition_structure_validation: 0, token_claim_transition_state_validation: 0, + token_direct_purchase_transition_structure_validation: 0, + token_direct_purchase_transition_state_validation: 0, + token_set_price_for_direct_purchase_transition_structure_validation: 0, + token_set_price_for_direct_purchase_transition_state_validation: 0, }, }, has_nonce_validation: 1, // <---- changed this diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v5.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v5.rs index 41946b98be5..221015664ea 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v5.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v5.rs @@ -155,6 +155,10 @@ pub const DRIVE_ABCI_VALIDATION_VERSIONS_V5: DriveAbciValidationVersions = token_base_transition_group_action_validation: 0, token_claim_transition_structure_validation: 0, token_claim_transition_state_validation: 0, + token_direct_purchase_transition_structure_validation: 0, + token_direct_purchase_transition_state_validation: 0, + token_set_price_for_direct_purchase_transition_structure_validation: 0, + token_set_price_for_direct_purchase_transition_state_validation: 0, }, }, has_nonce_validation: 1, diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs index 5ca5fd49951..7b568f95837 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_state_transition_method_versions/v1.rs @@ -41,5 +41,7 @@ pub const DRIVE_STATE_TRANSITION_METHOD_VERSIONS_V1: DriveStateTransitionMethodV token_destroy_frozen_funds_transition: 0, token_config_update_transition: 0, token_claim_transition: 0, + token_direct_purchase_transition: 0, + token_set_price_for_direct_purchase_transition: 0, }, }; diff --git a/packages/token-history-contract/schema/v1/token-history-contract-documents.json b/packages/token-history-contract/schema/v1/token-history-contract-documents.json index 03578a4a0cd..0cba2e416b4 100644 --- a/packages/token-history-contract/schema/v1/token-history-contract-documents.json +++ b/packages/token-history-contract/schema/v1/token-history-contract-documents.json @@ -760,7 +760,7 @@ ], "additionalProperties": false }, - "setPriceForDirectPurchase": { + "directPricing": { "type": "object", "documentsMutable": false, "canBeDeleted": false, @@ -809,5 +809,102 @@ "$createdAtBlockHeight" ], "additionalProperties": false + }, + "directPurchase": { + "type": "object", + "documentsMutable": false, + "canBeDeleted": false, + "creationRestrictionMode": 2, + "indices": [ + { + "name": "byDate", + "properties": [ + { + "tokenId": "asc" + }, + { + "$createdAt": "asc" + } + ] + }, + { + "name": "byOwnerIdForToken", + "properties": [ + { + "tokenId": "asc" + }, + { + "$ownerId": "asc" + }, + { + "$createdAt": "asc" + } + ] + }, + { + "name": "byOwnerId", + "properties": [ + { + "$ownerId": "asc" + }, + { + "$createdAt": "asc" + } + ] + }, + { + "name": "byPurchaseCost", + "properties": [ + { + "purchaseCost": "asc" + } + ] + }, + { + "name": "byTokenAmount", + "properties": [ + { + "tokenId": "asc" + }, + { + "tokenAmount": "asc" + }, + { + "$createdAt": "asc" + } + ] + } + ], + "properties": { + "tokenId": { + "type": "array", + "byteArray": true, + "minItems": 32, + "maxItems": 32, + "description": "The token ID", + "position": 0, + "contentMediaType": "application/x.dash.dpp.identifier" + }, + "tokenAmount": { + "type": "integer", + "minimum": 1, + "description": "The number of tokens purchased", + "position": 1 + }, + "purchaseCost": { + "type": "integer", + "minimum": 0, + "description": "The cost paid for the tokens in credits", + "position": 2 + } + }, + "required": [ + "tokenId", + "tokenAmount", + "purchaseCost", + "$createdAt", + "$createdAtBlockHeight" + ], + "additionalProperties": false } } \ No newline at end of file From f6825fff8a90b2fd8b41e84ab93b758ffc1afe31 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Apr 2025 14:20:28 +0700 Subject: [PATCH 04/32] working --- .../protos/platform/v0/platform.proto | 20 ++- .../token_configuration/v0/mod.rs | 16 +++ .../token_distribution_rules/accessors/mod.rs | 18 +++ .../accessors/v0/mod.rs | 9 ++ .../token_distribution_rules/v0/accessors.rs | 12 ++ .../token_distribution_rules/v0/mod.rs | 6 +- .../src/state_transition/proof_result.rs | 2 + .../document/batch_transition/methods/mod.rs | 123 +++++++++++++++++ .../batch_transition/methods/v1/mod.rs | 40 ++++++ .../batch_transition/v1/v0_methods.rs | 125 +++++++++++++++++- .../v0/mod.rs | 17 ++- .../batch/action_validation/token/mod.rs | 2 + .../mod.rs | 59 +++++++++ .../state_v0/mod.rs | 106 +++++++++++++++ .../mod.rs | 62 +++++++++ .../state_v0/mod.rs | 74 +++++++++++ .../state_transitions/batch/state/v0/mod.rs | 22 +++ .../state_transitions/batch/tests/mod.rs | 1 + .../batch/tests/token/direct_selling/mod.rs | 42 +++--- .../batch/transformer/v0/mod.rs | 26 +++- .../state_transition/state_transitions/mod.rs | 9 +- .../group_queries/group_actions/v0/mod.rs | 38 ++++-- .../src/drive/initialization/v1/mod.rs | 16 ++- .../src/drive/tokens/direct_purchase/mod.rs | 2 + .../drive/tokens/direct_purchase/queries.rs | 33 +++++ .../set_direct_purchase_price/mod.rs | 81 ++++++++++++ .../set_direct_purchase_price/v0/mod.rs | 49 +++++++ .../for_token_direct_selling_prices/mod.rs | 55 ++++++++ .../for_token_direct_selling_prices/v0/mod.rs | 100 ++++++++++++++ .../src/drive/tokens/estimated_costs/mod.rs | 3 + packages/rs-drive/src/drive/tokens/mod.rs | 1 + packages/rs-drive/src/drive/tokens/paths.rs | 18 +++ .../src/util/batch/drive_op_batch/token.rs | 6 +- .../src/util/batch/grovedb_op_batch/mod.rs | 6 +- .../v0/mod.rs | 41 +++++- packages/rs-drive/src/verify/tokens/mod.rs | 1 + .../verify_token_direct_selling_price/mod.rs | 67 ++++++++++ .../v0/mod.rs | 54 ++++++++ .../drive_identity_method_versions/mod.rs | 1 + .../drive_identity_method_versions/v1.rs | 1 + .../drive_verify_method_versions/mod.rs | 1 + .../drive_verify_method_versions/v1.rs | 1 + 42 files changed, 1315 insertions(+), 51 deletions(-) create mode 100644 packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_direct_purchase_transition_action/mod.rs create mode 100644 packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_direct_purchase_transition_action/state_v0/mod.rs create mode 100644 packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_set_price_for_direct_purchase_transition_action/mod.rs create mode 100644 packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_set_price_for_direct_purchase_transition_action/state_v0/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/queries.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs create mode 100644 packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/mod.rs create mode 100644 packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/v0/mod.rs diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index 905ef6c1d23..abc2aa85bbe 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -1664,6 +1664,23 @@ message GetGroupActionsResponse { optional string public_note = 2; // Public note } + // UpdatePrice event + message UpdateDirectPurchasePriceEvent { + message PriceForQuantity { + uint64 quantity = 1; + uint64 price = 2; + } + + message PricingSchedule { + repeated PriceForQuantity price_for_quantity = 1; + } + oneof price { + uint64 fixed_price = 1; + PricingSchedule variable_price = 2; + } + optional string public_note = 3; // Public note + } + // Event associated with this action message GroupActionEvent { oneof event_type { @@ -1702,7 +1719,8 @@ message GetGroupActionsResponse { UnfreezeEvent unfreeze = 4; // Unfreeze event details DestroyFrozenFundsEvent destroy_frozen_funds = 5; // Destroy frozen funds EmergencyActionEvent emergency_action = 6; // Emergency action details - TokenConfigUpdateEvent token_config_update = 7; // Token configuration update details + TokenConfigUpdateEvent token_config_update = 7; // Token configuration update details + UpdateDirectPurchasePriceEvent update_price = 8; // Updating the token direct selling price } } diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs index 2b85b51bb29..0254aceb4a9 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs @@ -107,6 +107,13 @@ fn default_token_distribution_rules() -> TokenDistributionRules { changing_admin_action_takers_to_no_one_allowed: false, self_changing_admin_action_takers_allowed: false, }), + change_direct_purchase_pricing_rules: ChangeControlRules::V0(ChangeControlRulesV0 { + authorized_to_make_change: AuthorizedActionTakers::NoOne, + admin_action_takers: AuthorizedActionTakers::NoOne, + changing_authorized_action_takers_to_no_one_allowed: false, + changing_admin_action_takers_to_no_one_allowed: false, + self_changing_admin_action_takers_allowed: false, + }), }) } @@ -218,6 +225,15 @@ impl TokenConfigurationV0 { self_changing_admin_action_takers_allowed: false, } .into(), + change_direct_purchase_pricing_rules: ChangeControlRules::V0( + ChangeControlRulesV0 { + authorized_to_make_change: AuthorizedActionTakers::NoOne, + admin_action_takers: AuthorizedActionTakers::NoOne, + changing_authorized_action_takers_to_no_one_allowed: false, + changing_admin_action_takers_to_no_one_allowed: false, + self_changing_admin_action_takers_allowed: false, + }, + ), }), manual_minting_rules: ChangeControlRulesV0 { authorized_to_make_change: AuthorizedActionTakers::NoOne, diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/accessors/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/accessors/mod.rs index f189476244e..3505df0ad3a 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/accessors/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/accessors/mod.rs @@ -93,6 +93,18 @@ impl TokenDistributionRulesV0Getters for TokenDistributionRules { TokenDistributionRules::V0(v0) => v0.minting_allow_choosing_destination_rules_mut(), } } + + fn change_direct_purchase_pricing_rules(&self) -> &ChangeControlRules { + match self { + TokenDistributionRules::V0(v0) => v0.change_direct_purchase_pricing_rules(), + } + } + + fn change_direct_purchase_pricing_rules_mut(&mut self) -> &mut ChangeControlRules { + match self { + TokenDistributionRules::V0(v0) => v0.change_direct_purchase_pricing_rules_mut(), + } + } } /// Implementing `TokenDistributionRulesV0Setters` for `TokenDistributionRules` @@ -155,4 +167,10 @@ impl TokenDistributionRulesV0Setters for TokenDistributionRules { } } } + + fn set_change_direct_purchase_pricing_rules(&mut self, rules: ChangeControlRules) { + match self { + TokenDistributionRules::V0(v0) => v0.set_change_direct_purchase_pricing_rules(rules), + } + } } diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/accessors/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/accessors/v0/mod.rs index 5b7c5080ee7..308ed3ea470 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/accessors/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/accessors/v0/mod.rs @@ -40,6 +40,12 @@ pub trait TokenDistributionRulesV0Getters { /// Returns the rules for changing the minting allow choosing destination setting. fn minting_allow_choosing_destination_rules_mut(&mut self) -> &mut ChangeControlRules; + + /// Returns the rules for changing the direct purchase pricing. + fn change_direct_purchase_pricing_rules(&self) -> &ChangeControlRules; + + /// Returns the rules for changing the direct purchase pricing as mut. + fn change_direct_purchase_pricing_rules_mut(&mut self) -> &mut ChangeControlRules; } /// Accessor trait for setters of `TokenDistributionRulesV0` @@ -70,4 +76,7 @@ pub trait TokenDistributionRulesV0Setters { /// Sets the rules for changing the minting allow choosing destination setting. fn set_minting_allow_choosing_destination_rules(&mut self, rules: ChangeControlRules); + + /// Sets the rules for changing the direct purchase pricing as mut. + fn set_change_direct_purchase_pricing_rules(&mut self, rules: ChangeControlRules); } diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/v0/accessors.rs b/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/v0/accessors.rs index 397e609525b..e3108bd9864 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/v0/accessors.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/v0/accessors.rs @@ -67,6 +67,14 @@ impl TokenDistributionRulesV0Getters for TokenDistributionRulesV0 { fn minting_allow_choosing_destination_rules_mut(&mut self) -> &mut ChangeControlRules { &mut self.minting_allow_choosing_destination_rules } + + fn change_direct_purchase_pricing_rules(&self) -> &ChangeControlRules { + &self.change_direct_purchase_pricing_rules + } + + fn change_direct_purchase_pricing_rules_mut(&mut self) -> &mut ChangeControlRules { + &mut self.change_direct_purchase_pricing_rules + } } /// Implementing `TokenDistributionRulesV0Setters` for `TokenDistributionRulesV0` @@ -111,4 +119,8 @@ impl TokenDistributionRulesV0Setters for TokenDistributionRulesV0 { fn set_minting_allow_choosing_destination_rules(&mut self, rules: ChangeControlRules) { self.minting_allow_choosing_destination_rules = rules; } + + fn set_change_direct_purchase_pricing_rules(&mut self, rules: ChangeControlRules) { + self.change_direct_purchase_pricing_rules = rules; + } } diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/v0/mod.rs index ddcc549a4b3..1da29450e0a 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_distribution_rules/v0/mod.rs @@ -28,6 +28,8 @@ pub struct TokenDistributionRulesV0 { pub minting_allow_choosing_destination: bool, #[serde(default = "default_change_control_rules")] pub minting_allow_choosing_destination_rules: ChangeControlRules, + #[serde(default = "default_change_control_rules")] + pub change_direct_purchase_pricing_rules: ChangeControlRules, } // Default function for `minting_allow_choosing_destination` to return `true` @@ -56,7 +58,8 @@ impl fmt::Display for TokenDistributionRulesV0 { new_tokens_destination_identity: {},\n \ new_tokens_destination_identity_rules: {},\n \ minting_allow_choosing_destination: {},\n \ - minting_allow_choosing_destination_rules: {}\n\ + minting_allow_choosing_destination_rules: {},\n \ + change_direct_purchase_pricing_rules:: {}\n\ }}", match &self.perpetual_distribution { Some(value) => format!("{}", value), @@ -74,6 +77,7 @@ impl fmt::Display for TokenDistributionRulesV0 { self.new_tokens_destination_identity_rules, self.minting_allow_choosing_destination, self.minting_allow_choosing_destination_rules, + self.change_direct_purchase_pricing_rules, ) } } diff --git a/packages/rs-dpp/src/state_transition/proof_result.rs b/packages/rs-dpp/src/state_transition/proof_result.rs index 33e6e2be0ce..98fc6e79f55 100644 --- a/packages/rs-dpp/src/state_transition/proof_result.rs +++ b/packages/rs-dpp/src/state_transition/proof_result.rs @@ -4,6 +4,7 @@ use crate::document::Document; use crate::identity::{Identity, PartialIdentity}; use crate::tokens::info::IdentityTokenInfo; use crate::tokens::status::TokenStatus; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; use crate::voting::votes::Vote; use platform_value::Identifier; use std::collections::BTreeMap; @@ -15,6 +16,7 @@ pub enum StateTransitionProofResult { VerifiedTokenBalanceAbsence(Identifier), VerifiedTokenBalance(Identifier, TokenAmount), VerifiedTokenIdentityInfo(Identifier, IdentityTokenInfo), + VerifiedTokenPricingSchedule(Identifier, Option), VerifiedTokenStatus(TokenStatus), VerifiedTokenIdentitiesBalances(BTreeMap), VerifiedPartialIdentity(PartialIdentity), diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/mod.rs index 7404683fd53..a10b14274d5 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/mod.rs @@ -32,6 +32,7 @@ use crate::state_transition::StateTransition; use crate::tokens::emergency_action::TokenEmergencyAction; #[cfg(feature = "state-transition-signing")] use crate::tokens::token_payment_info::TokenPaymentInfo; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; #[cfg(feature = "state-transition-signing")] use crate::tokens::{PrivateEncryptedNote, SharedEncryptedNote}; use crate::ProtocolError; @@ -996,4 +997,126 @@ impl DocumentsBatchTransitionMethodsV1 for BatchTransition { }), } } + + #[cfg(feature = "state-transition-signing")] + #[allow(clippy::too_many_arguments)] + fn new_token_change_direct_purchase_price_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + token_pricing_schedule: Option, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + platform_version: &PlatformVersion, + batch_feature_version: Option, + config_update_feature_version: Option, + base_feature_version: Option, + ) -> Result { + match batch_feature_version.unwrap_or( + platform_version + .dpp + .state_transition_serialization_versions + .batch_state_transition + .default_current_version, + ) { + 1 | 0 + if platform_version + .dpp + .state_transition_serialization_versions + .batch_state_transition + .max_version + >= 1 => + { + // Create the emergency action transition for batch version 1 + BatchTransitionV1::new_token_change_direct_purchase_price_transition( + token_id, + owner_id, + data_contract_id, + token_contract_position, + token_pricing_schedule, + public_note, + using_group_info, + identity_public_key, + identity_contract_nonce, + user_fee_increase, + signer, + platform_version, + batch_feature_version, + config_update_feature_version, + base_feature_version, + ) + } + version => Err(ProtocolError::UnknownVersionMismatch { + method: + "DocumentsBatchTransition::new_token_change_direct_purchase_price_transition" + .to_string(), + known_versions: vec![1], + received: version, + }), + } + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_direct_purchase_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + amount: TokenAmount, + agreed_total_cost: Credits, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + platform_version: &PlatformVersion, + batch_feature_version: Option, + config_update_feature_version: Option, + base_feature_version: Option, + ) -> Result { + match batch_feature_version.unwrap_or( + platform_version + .dpp + .state_transition_serialization_versions + .batch_state_transition + .default_current_version, + ) { + 1 | 0 + if platform_version + .dpp + .state_transition_serialization_versions + .batch_state_transition + .max_version + >= 1 => + { + // Create the emergency action transition for batch version 1 + BatchTransitionV1::new_token_direct_purchase_transition( + token_id, + owner_id, + data_contract_id, + token_contract_position, + amount, + agreed_total_cost, + identity_public_key, + identity_contract_nonce, + user_fee_increase, + signer, + platform_version, + batch_feature_version, + config_update_feature_version, + base_feature_version, + ) + } + version => Err(ProtocolError::UnknownVersionMismatch { + method: "DocumentsBatchTransition::new_token_direct_purchase_transition" + .to_string(), + known_versions: vec![1], + received: version, + }), + } + } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs index 996566d0190..c9695e9c724 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs @@ -4,6 +4,7 @@ use crate::balances::credits::TokenAmount; use crate::data_contract::associated_token::token_configuration_item::TokenConfigurationChangeItem; #[cfg(feature = "state-transition-signing")] use crate::data_contract::associated_token::token_distribution_key::TokenDistributionType; +use crate::fee::Credits; #[cfg(feature = "state-transition-signing")] use crate::group::GroupStateTransitionInfoStatus; #[cfg(feature = "state-transition-signing")] @@ -17,6 +18,7 @@ use crate::state_transition::batch_transition::accessors::DocumentsBatchTransiti use crate::state_transition::StateTransition; #[cfg(feature = "state-transition-signing")] use crate::tokens::emergency_action::TokenEmergencyAction; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; #[cfg(feature = "state-transition-signing")] use crate::tokens::{PrivateEncryptedNote, SharedEncryptedNote}; #[cfg(feature = "state-transition-signing")] @@ -210,4 +212,42 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 config_update_feature_version: Option, base_feature_version: Option, ) -> Result; + + #[cfg(feature = "state-transition-signing")] + #[allow(clippy::too_many_arguments)] + fn new_token_change_direct_purchase_price_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + token_pricing_schedule: Option, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + platform_version: &PlatformVersion, + batch_feature_version: Option, + config_update_feature_version: Option, + base_feature_version: Option, + ) -> Result; + + #[cfg(feature = "state-transition-signing")] + fn new_token_direct_purchase_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + amount: TokenAmount, + agreed_total_cost: Credits, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + platform_version: &PlatformVersion, + batch_feature_version: Option, + config_update_feature_version: Option, + base_feature_version: Option, + ) -> Result; } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs index 833f1e43727..25ef97e895e 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs @@ -27,7 +27,7 @@ use crate::state_transition::batch_transition::methods::v0::DocumentsBatchTransi use std::iter::Map; use std::slice::Iter; -use crate::state_transition::batch_transition::BatchTransitionV1; +use crate::state_transition::batch_transition::{BatchTransitionV1, TokenDirectPurchaseTransition, TokenSetPriceForDirectPurchaseTransition}; #[cfg(feature = "state-transition-signing")] use crate::state_transition::batch_transition::{TokenClaimTransition, TokenBurnTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenTransferTransition, TokenUnfreezeTransition}; #[cfg(feature = "state-transition-signing")] @@ -71,12 +71,14 @@ use crate::state_transition::batch_transition::token_claim_transition::TokenClai use crate::state_transition::batch_transition::token_config_update_transition::TokenConfigUpdateTransitionV0; #[cfg(feature = "state-transition-signing")] use crate::state_transition::batch_transition::token_destroy_frozen_funds_transition::TokenDestroyFrozenFundsTransitionV0; +use crate::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransitionV0; #[cfg(feature = "state-transition-signing")] use crate::state_transition::batch_transition::token_emergency_action_transition::TokenEmergencyActionTransitionV0; #[cfg(feature = "state-transition-signing")] use crate::state_transition::batch_transition::token_freeze_transition::TokenFreezeTransitionV0; #[cfg(feature = "state-transition-signing")] use crate::state_transition::batch_transition::token_mint_transition::TokenMintTransitionV0; +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransitionV0; #[cfg(feature = "state-transition-signing")] use crate::state_transition::batch_transition::token_transfer_transition::TokenTransferTransitionV0; #[cfg(feature = "state-transition-signing")] @@ -87,6 +89,7 @@ use crate::tokens::emergency_action::TokenEmergencyAction; use crate::tokens::{PrivateEncryptedNote, SharedEncryptedNote}; #[cfg(feature = "state-transition-signing")] use crate::tokens::token_payment_info::TokenPaymentInfo; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; impl DocumentsBatchTransitionAccessorsV0 for BatchTransitionV1 { type IterType<'a> @@ -1040,4 +1043,124 @@ impl DocumentsBatchTransitionMethodsV1 for BatchTransitionV1 { )?; Ok(state_transition) } + + #[cfg(feature = "state-transition-signing")] + fn new_token_direct_purchase_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + amount: TokenAmount, + agreed_total_cost: Credits, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _config_update_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let claim_transition = TokenDirectPurchaseTransition::V0(TokenDirectPurchaseTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + token_count: amount, + total_agreed_price: agreed_total_cost, + }); + + let batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(claim_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } + + fn new_token_change_direct_purchase_price_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + token_pricing_schedule: Option, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _config_update_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut change_direct_purchase_price_transition = + TokenSetPriceForDirectPurchaseTransition::V0( + TokenSetPriceForDirectPurchaseTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + price: token_pricing_schedule, + public_note, + }, + ); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = + change_direct_purchase_price_transition.calculate_action_id(owner_id); + change_direct_purchase_price_transition + .base_mut() + .set_using_group_info(Some(GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + })) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + change_direct_purchase_price_transition + .base_mut() + .set_using_group_info(Some(info)) + } + } + } + + let batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token( + change_direct_purchase_price_transition.into(), + )], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } } diff --git a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs index 1557075db17..663f94db0d2 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs @@ -25,10 +25,10 @@ use drive::drive::prefunded_specialized_balances::prefunded_specialized_balances use drive::drive::system::misc_path; use drive::drive::tokens::paths::{ token_distributions_root_path, token_timed_distributions_path, tokens_root_path, - TOKEN_BALANCES_KEY, TOKEN_BLOCK_TIMED_DISTRIBUTIONS_KEY, TOKEN_DISTRIBUTIONS_KEY, - TOKEN_EPOCH_TIMED_DISTRIBUTIONS_KEY, TOKEN_IDENTITY_INFO_KEY, TOKEN_MS_TIMED_DISTRIBUTIONS_KEY, - TOKEN_PERPETUAL_DISTRIBUTIONS_KEY, TOKEN_PRE_PROGRAMMED_DISTRIBUTIONS_KEY, - TOKEN_STATUS_INFO_KEY, TOKEN_TIMED_DISTRIBUTIONS_KEY, + TOKEN_BALANCES_KEY, TOKEN_BLOCK_TIMED_DISTRIBUTIONS_KEY, TOKEN_DIRECT_SELL_PRICE_KEY, + TOKEN_DISTRIBUTIONS_KEY, TOKEN_EPOCH_TIMED_DISTRIBUTIONS_KEY, TOKEN_IDENTITY_INFO_KEY, + TOKEN_MS_TIMED_DISTRIBUTIONS_KEY, TOKEN_PERPETUAL_DISTRIBUTIONS_KEY, + TOKEN_PRE_PROGRAMMED_DISTRIBUTIONS_KEY, TOKEN_STATUS_INFO_KEY, TOKEN_TIMED_DISTRIBUTIONS_KEY, }; use drive::drive::votes::paths::vote_end_date_queries_tree_path_vec; use drive::drive::RootTree; @@ -402,6 +402,15 @@ impl Platform { &platform_version.drive, )?; + self.drive.grove_insert_if_not_exists( + (&path).into(), + &[TOKEN_DIRECT_SELL_PRICE_KEY], + Element::empty_tree(), + Some(transaction), + None, + &platform_version.drive, + )?; + // The token distribution trees let token_distributions_path = token_distributions_root_path(); diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/mod.rs index 49646315c67..de6bf27f70d 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/mod.rs @@ -3,8 +3,10 @@ pub(crate) mod token_burn_transition_action; pub(crate) mod token_claim_transition_action; pub(crate) mod token_config_update_transition_action; pub(crate) mod token_destroy_frozen_funds_transition_action; +pub(crate) mod token_direct_purchase_transition_action; pub(crate) mod token_emergency_action_transition_action; pub(crate) mod token_freeze_transition_action; pub(crate) mod token_mint_transition_action; +pub(crate) mod token_set_price_for_direct_purchase_transition_action; pub(crate) mod token_transfer_transition_action; pub(crate) mod token_unfreeze_transition_action; diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_direct_purchase_transition_action/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_direct_purchase_transition_action/mod.rs new file mode 100644 index 00000000000..90f67dd23fd --- /dev/null +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_direct_purchase_transition_action/mod.rs @@ -0,0 +1,59 @@ +use dpp::block::block_info::BlockInfo; +use dpp::identifier::Identifier; +use dpp::validation::SimpleConsensusValidationResult; +use drive::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::TokenDirectPurchaseTransitionAction; +use dpp::version::PlatformVersion; +use drive::grovedb::TransactionArg; +use crate::error::Error; +use crate::error::execution::ExecutionError; +use crate::execution::types::state_transition_execution_context::StateTransitionExecutionContext; +use crate::execution::validation::state_transition::batch::action_validation::token::token_direct_purchase_transition_action::state_v0::TokenDirectPurchaseTransitionActionStateValidationV0; +use crate::platform_types::platform::PlatformStateRef; + +mod state_v0; + +pub trait TokenDirectPurchaseTransitionActionValidation { + fn validate_state( + &self, + platform: &PlatformStateRef, + owner_id: Identifier, + block_info: &BlockInfo, + execution_context: &mut StateTransitionExecutionContext, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result; +} + +impl TokenDirectPurchaseTransitionActionValidation for TokenDirectPurchaseTransitionAction { + fn validate_state( + &self, + platform: &PlatformStateRef, + owner_id: Identifier, + block_info: &BlockInfo, + execution_context: &mut StateTransitionExecutionContext, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result { + match platform_version + .drive_abci + .validation_and_processing + .state_transitions + .batch_state_transition + .token_direct_purchase_transition_state_validation + { + 0 => self.validate_state_v0( + platform, + owner_id, + block_info, + execution_context, + transaction, + platform_version, + ), + version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { + method: "TokenDirectPurchaseTransitionAction::validate_state".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_direct_purchase_transition_action/state_v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_direct_purchase_transition_action/state_v0/mod.rs new file mode 100644 index 00000000000..a172f48fb2e --- /dev/null +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_direct_purchase_transition_action/state_v0/mod.rs @@ -0,0 +1,106 @@ +use dpp::block::block_info::BlockInfo; +use dpp::consensus::ConsensusError; +use dpp::consensus::state::state_error::StateError; +use dpp::consensus::state::token::TokenMintPastMaxSupplyError; +use dpp::data_contract::accessors::v1::DataContractV1Getters; +use dpp::data_contract::associated_token::token_configuration::accessors::v0::TokenConfigurationV0Getters; +use dpp::prelude::Identifier; +use dpp::validation::SimpleConsensusValidationResult; +use drive::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::{TokenDirectPurchaseTransitionAction, TokenDirectPurchaseTransitionActionAccessorsV0}; +use dpp::version::PlatformVersion; +use drive::error::drive::DriveError; +use drive::query::TransactionArg; +use crate::error::Error; +use crate::execution::types::execution_operation::ValidationOperation; +use crate::execution::types::state_transition_execution_context::{StateTransitionExecutionContext, StateTransitionExecutionContextMethodsV0}; +use crate::execution::validation::state_transition::batch::action_validation::token::token_base_transition_action::TokenBaseTransitionActionValidation; +use crate::platform_types::platform::PlatformStateRef; + +pub(in crate::execution::validation::state_transition::state_transitions::batch::action_validation) trait TokenDirectPurchaseTransitionActionStateValidationV0 { + fn validate_state_v0( + &self, + platform: &PlatformStateRef, + owner_id: Identifier, + block_info: &BlockInfo, + execution_context: &mut StateTransitionExecutionContext, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result; +} +impl TokenDirectPurchaseTransitionActionStateValidationV0 for TokenDirectPurchaseTransitionAction { + fn validate_state_v0( + &self, + platform: &PlatformStateRef, + owner_id: Identifier, + block_info: &BlockInfo, + execution_context: &mut StateTransitionExecutionContext, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result { + let validation_result = self.base().validate_state( + platform, + owner_id, + block_info, + execution_context, + transaction, + platform_version, + )?; + if !validation_result.is_valid() { + return Ok(validation_result); + } + + let contract = &self.data_contract_fetch_info_ref().contract; + let token_configuration = contract.expected_token_configuration(self.token_position())?; + + if let Some(max_supply) = token_configuration.max_supply() { + // We have a max supply, let's get the current supply + let (token_total_supply, fee) = platform.drive.fetch_token_total_supply_with_cost( + self.token_id().to_buffer(), + block_info, + transaction, + platform_version, + )?; + execution_context.add_operation(ValidationOperation::PrecalculatedOperation(fee)); + if let Some(token_total_supply) = token_total_supply { + if let Some(total_supply_after_direct_purchase) = + token_total_supply.checked_add(self.token_count()) + { + if total_supply_after_direct_purchase > max_supply { + // By purchasing we are adding past the token total supply + return Ok(SimpleConsensusValidationResult::new_with_error( + ConsensusError::StateError(StateError::TokenMintPastMaxSupplyError( + TokenMintPastMaxSupplyError::new( + self.token_id(), + self.token_count(), + token_total_supply, + max_supply, + ), + )), + )); + } + } else { + // if we overflow we would also always go over max supply + return Ok(SimpleConsensusValidationResult::new_with_error( + ConsensusError::StateError(StateError::TokenMintPastMaxSupplyError( + TokenMintPastMaxSupplyError::new( + self.token_id(), + self.token_count(), + token_total_supply, + max_supply, + ), + )), + )); + } + } else { + return Err(Error::Drive(drive::error::Error::Drive( + DriveError::CorruptedDriveState(format!( + "token {} total supply not found", + self.token_id() + )), + ))); + } + } + + Ok(SimpleConsensusValidationResult::new()) + } +} diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_set_price_for_direct_purchase_transition_action/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_set_price_for_direct_purchase_transition_action/mod.rs new file mode 100644 index 00000000000..c2138fc380a --- /dev/null +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_set_price_for_direct_purchase_transition_action/mod.rs @@ -0,0 +1,62 @@ +use dpp::block::block_info::BlockInfo; +use dpp::identifier::Identifier; +use dpp::validation::SimpleConsensusValidationResult; +use drive::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::TokenSetPriceForDirectPurchaseTransitionAction; +use dpp::version::PlatformVersion; +use drive::grovedb::TransactionArg; +use crate::error::Error; +use crate::error::execution::ExecutionError; +use crate::execution::types::state_transition_execution_context::StateTransitionExecutionContext; +use crate::execution::validation::state_transition::batch::action_validation::token::token_set_price_for_direct_purchase_transition_action::state_v0::TokenSetPriceForDirectPurchaseTransitionActionStateValidationV0; +use crate::platform_types::platform::PlatformStateRef; + +mod state_v0; + +pub trait TokenSetPriceForDirectPurchaseTransitionActionValidation { + fn validate_state( + &self, + platform: &PlatformStateRef, + owner_id: Identifier, + block_info: &BlockInfo, + execution_context: &mut StateTransitionExecutionContext, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result; +} + +impl TokenSetPriceForDirectPurchaseTransitionActionValidation + for TokenSetPriceForDirectPurchaseTransitionAction +{ + fn validate_state( + &self, + platform: &PlatformStateRef, + owner_id: Identifier, + block_info: &BlockInfo, + execution_context: &mut StateTransitionExecutionContext, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result { + match platform_version + .drive_abci + .validation_and_processing + .state_transitions + .batch_state_transition + .token_set_price_for_direct_purchase_transition_state_validation + { + 0 => self.validate_state_v0( + platform, + owner_id, + block_info, + execution_context, + transaction, + platform_version, + ), + version => Err(Error::Execution(ExecutionError::UnknownVersionMismatch { + method: "TokenSetPriceForDirectPurchaseTransitionAction::validate_state" + .to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_set_price_for_direct_purchase_transition_action/state_v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_set_price_for_direct_purchase_transition_action/state_v0/mod.rs new file mode 100644 index 00000000000..4b39d0d696e --- /dev/null +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_set_price_for_direct_purchase_transition_action/state_v0/mod.rs @@ -0,0 +1,74 @@ +use dpp::block::block_info::BlockInfo; +use dpp::data_contract::accessors::v0::DataContractV0Getters; +use dpp::data_contract::accessors::v1::DataContractV1Getters; +use dpp::data_contract::associated_token::token_configuration::accessors::v0::TokenConfigurationV0Getters; +use dpp::data_contract::associated_token::token_distribution_rules::accessors::v0::TokenDistributionRulesV0Getters; +use dpp::prelude::Identifier; +use dpp::validation::SimpleConsensusValidationResult; +use drive::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::{TokenSetPriceForDirectPurchaseTransitionAction, TokenSetPriceForDirectPurchaseTransitionActionAccessorsV0}; +use dpp::version::PlatformVersion; +use drive::query::TransactionArg; +use crate::error::Error; +use crate::execution::types::state_transition_execution_context::StateTransitionExecutionContext; +use crate::execution::validation::state_transition::batch::action_validation::token::token_base_transition_action::TokenBaseTransitionActionValidation; +use crate::platform_types::platform::PlatformStateRef; + +pub(in crate::execution::validation::state_transition::state_transitions::batch::action_validation) trait TokenSetPriceForDirectPurchaseTransitionActionStateValidationV0 { + fn validate_state_v0( + &self, + platform: &PlatformStateRef, + owner_id: Identifier, + block_info: &BlockInfo, + execution_context: &mut StateTransitionExecutionContext, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result; +} +impl TokenSetPriceForDirectPurchaseTransitionActionStateValidationV0 + for TokenSetPriceForDirectPurchaseTransitionAction +{ + fn validate_state_v0( + &self, + platform: &PlatformStateRef, + owner_id: Identifier, + block_info: &BlockInfo, + execution_context: &mut StateTransitionExecutionContext, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result { + let validation_result = self.base().validate_state( + platform, + owner_id, + block_info, + execution_context, + transaction, + platform_version, + )?; + if !validation_result.is_valid() { + return Ok(validation_result); + } + + // Let's first check to see if we are authorized to perform this action + let contract = &self.data_contract_fetch_info_ref().contract; + let token_configuration = contract.expected_token_configuration(self.token_position())?; + let rules = token_configuration + .distribution_rules() + .change_direct_purchase_pricing_rules(); + let main_control_group = token_configuration.main_control_group(); + let validation_result = self.base().validate_group_action( + rules, + owner_id, + contract.owner_id(), + main_control_group, + contract.groups(), + "change_price_for_direct_purchase".to_string(), + token_configuration, + platform_version, + )?; + if !validation_result.is_valid() { + return Ok(validation_result); + } + + Ok(SimpleConsensusValidationResult::new()) + } +} diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/state/v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/state/v0/mod.rs index bf28e8c9e16..cf0443849ce 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/state/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/state/v0/mod.rs @@ -25,9 +25,11 @@ use crate::execution::validation::state_transition::batch::action_validation::to use crate::execution::validation::state_transition::batch::action_validation::token::token_claim_transition_action::TokenClaimTransitionActionValidation; use crate::execution::validation::state_transition::batch::action_validation::token::token_config_update_transition_action::TokenConfigUpdateTransitionActionValidation; use crate::execution::validation::state_transition::batch::action_validation::token::token_destroy_frozen_funds_transition_action::TokenDestroyFrozenFundsTransitionActionValidation; +use crate::execution::validation::state_transition::batch::action_validation::token::token_direct_purchase_transition_action::TokenDirectPurchaseTransitionActionValidation; use crate::execution::validation::state_transition::batch::action_validation::token::token_emergency_action_transition_action::TokenEmergencyActionTransitionActionValidation; use crate::execution::validation::state_transition::batch::action_validation::token::token_freeze_transition_action::TokenFreezeTransitionActionValidation; use crate::execution::validation::state_transition::batch::action_validation::token::token_mint_transition_action::TokenMintTransitionActionValidation; +use crate::execution::validation::state_transition::batch::action_validation::token::token_set_price_for_direct_purchase_transition_action::TokenSetPriceForDirectPurchaseTransitionActionValidation; use crate::execution::validation::state_transition::batch::action_validation::token::token_transfer_transition_action::TokenTransferTransitionActionValidation; use crate::execution::validation::state_transition::batch::action_validation::token::token_unfreeze_transition_action::TokenUnfreezeTransitionActionValidation; use crate::execution::validation::state_transition::batch::data_triggers::{data_trigger_bindings_list, DataTriggerExecutionContext, DataTriggerExecutor}; @@ -229,6 +231,26 @@ impl DocumentsBatchStateTransitionStateValidationV0 for BatchTransition { transaction, platform_version, )?, + TokenTransitionAction::DirectPurchaseAction(direct_purchase_action) => { + direct_purchase_action.validate_state( + platform, + owner_id, + block_info, + execution_context, + transaction, + platform_version, + )? + } + TokenTransitionAction::SetPriceForDirectPurchaseAction( + set_price_for_direct_purchase_action, + ) => set_price_for_direct_purchase_action.validate_state( + platform, + owner_id, + block_info, + execution_context, + transaction, + platform_version, + )?, }, BatchedTransitionAction::BumpIdentityDataContractNonce(_) => { return Err(Error::Execution(ExecutionError::CorruptedCodeExecution( diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs index cfbea99d230..b6b276dcd9c 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs @@ -24,6 +24,7 @@ use drive::drive::document::query::QueryDocumentsOutcomeV0Methods; use drive::drive::document::query::QueryDocumentsWithFlagsOutcomeV0Methods; use crate::execution::validation::state_transition::tests::add_tokens_to_identity; +use crate::execution::validation::state_transition::tests::process_test_state_transition; use crate::execution::validation::state_transition::tests::setup_identity; use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult; use crate::platform_types::state_transitions_processing_result::StateTransitionExecutionResult::PaidConsensusError; diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs index 6a1facda159..a2fc7abd4d0 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs @@ -1,5 +1,8 @@ +use super::*; + mod token_selling_tests { use super::*; + use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; #[test] fn test_successful_direct_purchase_single_price() { let platform_version = PlatformVersion::latest(); @@ -23,14 +26,17 @@ mod token_selling_tests { platform_version, ); + let platform_state = platform.state.load(); + // Seller sets single price let set_price_transition = - BatchTransition::new_token_set_price_for_direct_purchase_transition( + BatchTransition::new_token_change_direct_purchase_price_transition( token_id, seller.id(), contract.id(), 0, - Some(TokenPricingSchedule::SinglePrice(500)), // Price per token + Some(TokenPricingSchedule::SinglePrice(dash_to_credits!(1))), // Price per token + None, None, &seller_key, 2, @@ -43,10 +49,10 @@ mod token_selling_tests { ) .unwrap(); - process_state_transition( + process_test_state_transition( &mut platform, set_price_transition, - &platform.state.load(), + &platform_state, platform_version, ); @@ -56,8 +62,8 @@ mod token_selling_tests { buyer.id(), contract.id(), 0, - 10, // Buying 10 tokens - 500, // Agreed price per token + 10, // Buying 10 tokens + 500, &buyer_key, 2, 0, @@ -69,10 +75,10 @@ mod token_selling_tests { ) .unwrap(); - process_state_transition( + process_test_state_transition( &mut platform, purchase_transition, - &platform.state.load(), + &platform_state, platform_version, ); @@ -91,7 +97,7 @@ mod token_selling_tests { .drive .fetch_identity_balance(buyer.id().to_buffer(), None, platform_version) .expect("expected to fetch credit balance"); - assert_eq!(buyer_credit_balance, dash_to_credits!(5.0)); // 10.0 - 5.0 spent (10 tokens * 500 credits) + assert_eq!(buyer_credit_balance, Some(dash_to_credits!(9.0))); // 10.0 - 1.0 spent (10 tokens * 500 credits) } #[test] @@ -117,13 +123,17 @@ mod token_selling_tests { platform_version, ); + let platform_state = platform.state.load(); + + // Seller sets single price let set_price_transition = - BatchTransition::new_token_set_price_for_direct_purchase_transition( + BatchTransition::new_token_change_direct_purchase_price_transition( token_id, seller.id(), contract.id(), 0, - Some(TokenPricingSchedule::SinglePrice(5000)), // High price + Some(TokenPricingSchedule::SinglePrice(5000)), // Price per token + None, None, &seller_key, 2, @@ -136,10 +146,10 @@ mod token_selling_tests { ) .unwrap(); - process_state_transition( + process_test_state_transition( &mut platform, set_price_transition, - &platform.state.load(), + &platform_state, platform_version, ); @@ -161,17 +171,17 @@ mod token_selling_tests { ) .unwrap(); - let processing_result = process_state_transition( + let processing_result = process_test_state_transition( &mut platform, purchase_transition, - &platform.state.load(), + &platform_state, platform_version, ); assert_matches!( processing_result.execution_results().as_slice(), [StateTransitionExecutionResult::PaidConsensusError( - ConsensusError::BasicError(BasicError::InsufficientBalanceError(_)), + ConsensusError::StateError(StateError::IdentityInsufficientBalanceError(_)), _ )] ); diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/transformer/v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/transformer/v0/mod.rs index 9540f6a5e79..e1b752d89ce 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/transformer/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/transformer/v0/mod.rs @@ -60,6 +60,8 @@ use drive::state_transition_action::batch::batched_transition::token_transition: use drive::state_transition_action::batch::batched_transition::token_transition::token_freeze_transition_action::TokenFreezeTransitionAction; use drive::state_transition_action::batch::batched_transition::token_transition::token_mint_transition_action::TokenMintTransitionAction; use drive::state_transition_action::batch::batched_transition::token_transition::token_claim_transition_action::TokenClaimTransitionAction; +use drive::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::TokenDirectPurchaseTransitionAction; +use drive::state_transition_action::batch::batched_transition::token_transition::token_set_price_for_direct_purchase_transition_action::TokenSetPriceForDirectPurchaseTransitionAction; use drive::state_transition_action::batch::batched_transition::token_transition::token_transfer_transition_action::TokenTransferTransitionAction; use drive::state_transition_action::batch::batched_transition::token_transition::token_unfreeze_transition_action::TokenUnfreezeTransitionAction; use drive::state_transition_action::batch::batched_transition::token_transition::TokenTransitionAction; @@ -602,8 +604,28 @@ impl BatchTransitionInternalTransformerV0 for BatchTransition { Ok(batched_action) } - TokenTransition::Claim(release) => { - let (batched_action, fee_result) = TokenClaimTransitionAction::try_from_borrowed_token_claim_transition_with_contract_lookup(drive, owner_id, release, approximate_for_costs, transaction, block_info, user_fee_increase, |_identifier| { + TokenTransition::Claim(claim) => { + let (batched_action, fee_result) = TokenClaimTransitionAction::try_from_borrowed_token_claim_transition_with_contract_lookup(drive, owner_id, claim, approximate_for_costs, transaction, block_info, user_fee_increase, |_identifier| { + Ok(data_contract_fetch_info.clone()) + }, platform_version)?; + + execution_context + .add_operation(ValidationOperation::PrecalculatedOperation(fee_result)); + + Ok(batched_action) + } + TokenTransition::DirectPurchase(direct_purchase) => { + let (batched_action, fee_result) = TokenDirectPurchaseTransitionAction::try_from_borrowed_token_direct_purchase_transition_with_contract_lookup(drive, owner_id, direct_purchase, approximate_for_costs, transaction, block_info, user_fee_increase, |_identifier| { + Ok(data_contract_fetch_info.clone()) + }, platform_version)?; + + execution_context + .add_operation(ValidationOperation::PrecalculatedOperation(fee_result)); + + Ok(batched_action) + } + TokenTransition::SetPriceForDirectPurchase(set_price_for_direct_purchase) => { + let (batched_action, fee_result) = TokenSetPriceForDirectPurchaseTransitionAction::try_from_borrowed_token_set_price_for_direct_purchase_transition_with_contract_lookup(drive, owner_id, set_price_for_direct_purchase, approximate_for_costs, transaction, block_info, user_fee_increase, |_identifier| { Ok(data_contract_fetch_info.clone()) }, platform_version)?; diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs index fda795e8fcf..8b1b7f36db1 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs @@ -131,7 +131,6 @@ pub(in crate::execution) mod tests { use dpp::tokens::gas_fees_paid_by::GasFeesPaidBy; use dpp::tokens::token_amount_on_contract_token::{DocumentActionTokenCost, DocumentActionTokenEffect}; use dpp::data_contract::document_type::accessors::DocumentTypeV0MutGetters; - use crate::platform_types::platform::Platform; /// We add an identity, but we also add the same amount to system credits pub(in crate::execution) fn setup_identity_with_system_credits( @@ -2471,15 +2470,15 @@ pub(in crate::execution) mod tests { basic_token_contract } - pub(in crate::execution) fn process_state_transition( + pub(in crate::execution) fn process_test_state_transition( platform: &mut TempPlatform, state_transition: S, platform_state: &PlatformState, platform_version: &PlatformVersion, ) -> StateTransitionsProcessingResult { - let serialized_state_transition = state_transition - .serialize_to_bytes() - .expect("expected documents batch serialized state transition"); + let Ok(serialized_state_transition) = state_transition.serialize_to_bytes() else { + panic!("expected documents batch serialized state transition") + }; let transaction = platform.drive.grove.start_transaction(); diff --git a/packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs b/packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs index d299f56f73d..cc4a0a50ca6 100644 --- a/packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs +++ b/packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs @@ -4,14 +4,11 @@ use crate::platform_types::platform::Platform; use crate::platform_types::platform_state::PlatformState; use crate::query::QueryValidationResult; use dapi_grpc::platform::v0::get_group_actions_request::GetGroupActionsRequestV0; -use dapi_grpc::platform::v0::get_group_actions_response::get_group_actions_response_v0::{ - emergency_action_event, group_action_event, token_event, BurnEvent, DestroyFrozenFundsEvent, - EmergencyActionEvent, FreezeEvent, GroupActionEntry, GroupActionEvent, GroupActions, MintEvent, - TokenConfigUpdateEvent, TokenEvent as TokenEventResponse, UnfreezeEvent, -}; +use dapi_grpc::platform::v0::get_group_actions_response::get_group_actions_response_v0::{emergency_action_event, group_action_event, token_event, BurnEvent, DestroyFrozenFundsEvent, EmergencyActionEvent, FreezeEvent, GroupActionEntry, GroupActionEvent, GroupActions, MintEvent, TokenConfigUpdateEvent, TokenEvent as TokenEventResponse, UnfreezeEvent, UpdateDirectPurchasePriceEvent}; use dapi_grpc::platform::v0::get_group_actions_response::{ get_group_actions_response_v0, GetGroupActionsResponseV0, }; +use dapi_grpc::platform::v0::get_group_actions_response::get_group_actions_response_v0::update_direct_purchase_price_event::{Price, PriceForQuantity, PricingSchedule}; use dpp::check_validation_result_with_data; use dpp::data_contract::GroupContractPosition; use dpp::group::action_event; @@ -21,6 +18,7 @@ use dpp::identifier::Identifier; use dpp::serialization::PlatformSerializableWithPlatformVersion; use dpp::tokens::emergency_action::TokenEmergencyAction; use dpp::tokens::token_event::TokenEvent; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; use dpp::validation::ValidationResult; use dpp::version::PlatformVersion; use drive::error::query::QuerySyntaxError; @@ -180,9 +178,6 @@ impl Platform { )), }) } - TokenEvent::Transfer(..) => { - return None; - }, TokenEvent::EmergencyAction(action, public_note) => { group_action_event::EventType::TokenEvent(TokenEventResponse { r#type: Some(token_event::Type::EmergencyAction(EmergencyActionEvent { @@ -202,9 +197,32 @@ impl Platform { })), }) } - TokenEvent::Claim(..) => { - return None; + TokenEvent::SetPriceForDirectPurchase(pricing_schedule, public_note) => { + group_action_event::EventType::TokenEvent(TokenEventResponse { + r#type: Some(token_event::Type::UpdatePrice(UpdateDirectPurchasePriceEvent { + price: pricing_schedule.map(|pricing_schedule| { + match pricing_schedule { + TokenPricingSchedule::SinglePrice(price) => { + Price::FixedPrice(price) + } + TokenPricingSchedule::SetPrices(prices) => { + let schedule = PricingSchedule { + price_for_quantity: prices + .into_iter() + .map(|(quantity, price)| PriceForQuantity { quantity, price }) + .collect(), + }; + Price::VariablePrice(schedule) + } + } + }), + public_note, + })), + }) } + TokenEvent::Transfer(..) | TokenEvent::DirectPurchase(..) | TokenEvent::Claim(..) => { + return None; + }, }, }, }), diff --git a/packages/rs-drive/src/drive/initialization/v1/mod.rs b/packages/rs-drive/src/drive/initialization/v1/mod.rs index 9b0b8fad1d8..69839e9c386 100644 --- a/packages/rs-drive/src/drive/initialization/v1/mod.rs +++ b/packages/rs-drive/src/drive/initialization/v1/mod.rs @@ -6,10 +6,10 @@ use crate::util::batch::GroveDbOpBatch; use crate::drive::system::misc_path_vec; use crate::drive::tokens::paths::{ token_distributions_root_path_vec, token_timed_distributions_path_vec, tokens_root_path_vec, - TOKEN_BALANCES_KEY, TOKEN_BLOCK_TIMED_DISTRIBUTIONS_KEY, TOKEN_DISTRIBUTIONS_KEY, - TOKEN_EPOCH_TIMED_DISTRIBUTIONS_KEY, TOKEN_IDENTITY_INFO_KEY, TOKEN_MS_TIMED_DISTRIBUTIONS_KEY, - TOKEN_PERPETUAL_DISTRIBUTIONS_KEY, TOKEN_PRE_PROGRAMMED_DISTRIBUTIONS_KEY, - TOKEN_STATUS_INFO_KEY, TOKEN_TIMED_DISTRIBUTIONS_KEY, + TOKEN_BALANCES_KEY, TOKEN_BLOCK_TIMED_DISTRIBUTIONS_KEY, TOKEN_DIRECT_SELL_PRICE_KEY, + TOKEN_DISTRIBUTIONS_KEY, TOKEN_EPOCH_TIMED_DISTRIBUTIONS_KEY, TOKEN_IDENTITY_INFO_KEY, + TOKEN_MS_TIMED_DISTRIBUTIONS_KEY, TOKEN_PERPETUAL_DISTRIBUTIONS_KEY, + TOKEN_PRE_PROGRAMMED_DISTRIBUTIONS_KEY, TOKEN_STATUS_INFO_KEY, TOKEN_TIMED_DISTRIBUTIONS_KEY, }; use crate::drive::{Drive, RootTree}; use crate::error::Error; @@ -83,11 +83,17 @@ impl Drive { ); batch.add_insert( - tokens_root_path, + tokens_root_path.clone(), vec![TOKEN_DISTRIBUTIONS_KEY], Element::empty_tree(), ); + batch.add_insert( + tokens_root_path, + vec![TOKEN_DIRECT_SELL_PRICE_KEY], + Element::empty_tree(), + ); + // Token Distributions Subtree let token_distributions_path = token_distributions_root_path_vec(); diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs new file mode 100644 index 00000000000..e42e61cd5bb --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs @@ -0,0 +1,2 @@ +mod queries; +mod set_direct_purchase_price; diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/queries.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/queries.rs new file mode 100644 index 00000000000..8305f3c3cf4 --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/queries.rs @@ -0,0 +1,33 @@ +use crate::drive::tokens::paths::token_direct_selling_root_path_vec; +use crate::drive::Drive; +use crate::query::Query; +use grovedb::{PathQuery, SizedQuery}; + +impl Drive { + /// The query getting many tokens direct selling price + pub fn token_direct_purchase_prices_query(token_ids: &[[u8; 32]]) -> PathQuery { + let tokens_root = token_direct_selling_root_path_vec(); + + let mut query = Query::new(); + + for token_id in token_ids { + query.insert_key(token_id.to_vec()); + } + + PathQuery::new( + tokens_root, + SizedQuery::new(query, Some(token_ids.len() as u16), None), + ) + } + + /// The query getting a token direct selling price + pub fn token_direct_purchase_price_query(token_id: [u8; 32]) -> PathQuery { + let tokens_root = token_direct_selling_root_path_vec(); + + let mut query = Query::new(); + + query.insert_key(token_id.to_vec()); + + PathQuery::new(tokens_root, SizedQuery::new(query, Some(1), None)) + } +} diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/mod.rs new file mode 100644 index 00000000000..c8052b042bf --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/mod.rs @@ -0,0 +1,81 @@ +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use dpp::block::block_info::BlockInfo; +use dpp::fee::fee_result::FeeResult; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use grovedb::batch::KeyInfoPath; +use grovedb::{EstimatedLayerInformation, TransactionArg}; +use platform_version::version::PlatformVersion; +use std::collections::HashMap; +mod v0; + +impl Drive { + /// Mints (issues) new tokens by increasing the total supply and adding them to an identity's balance. + pub fn token_set_direct_purchase_price( + &self, + token_id: [u8; 32], + price: Option, + block_info: &BlockInfo, + apply: bool, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result { + let mut estimated_costs_only_with_layer_info = + if apply { None } else { Some(HashMap::new()) }; + + let batch_operations = self.token_set_direct_purchase_price_operations( + token_id, + price, + &mut estimated_costs_only_with_layer_info, + platform_version, + )?; + + let mut drive_operations = vec![]; + + self.apply_batch_low_level_drive_operations( + estimated_costs_only_with_layer_info, + transaction, + batch_operations, + &mut drive_operations, + &platform_version.drive, + )?; + + let fees = Drive::calculate_fee( + None, + Some(drive_operations), + &block_info.epoch, + self.config.epochs_per_era, + platform_version, + None, + )?; + + Ok(fees) + } + + /// Gathers the operations needed to mint tokens. + pub fn token_set_direct_purchase_price_operations( + &self, + token_id: [u8; 32], + price: Option, + estimated_costs_only_with_layer_info: &mut Option< + HashMap, + >, + platform_version: &PlatformVersion, + ) -> Result, Error> { + match platform_version.drive.methods.token.update.mint { + 0 => self.token_set_direct_purchase_price_operations_v0( + token_id, + price, + estimated_costs_only_with_layer_info, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "token_set_direct_purchase_price_operations".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs new file mode 100644 index 00000000000..3fe986f5304 --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs @@ -0,0 +1,49 @@ +use crate::drive::tokens::paths::token_direct_selling_root_path_vec; +use crate::drive::Drive; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use dpp::serialization::PlatformSerializableWithPlatformVersion; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use grovedb::batch::{KeyInfoPath, QualifiedGroveDbOp}; +use grovedb::{Element, EstimatedLayerInformation}; +use platform_version::version::PlatformVersion; +use std::collections::HashMap; + +impl Drive { + /// Sets the direct purchase price of a token + pub(super) fn token_set_direct_purchase_price_operations_v0( + &self, + token_id: [u8; 32], + price: Option, + estimated_costs_only_with_layer_info: &mut Option< + HashMap, + >, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let mut drive_operations = vec![]; + if let Some(estimated_costs_only_with_layer_info) = estimated_costs_only_with_layer_info { + Self::add_estimation_costs_for_token_selling_prices( + estimated_costs_only_with_layer_info, + &platform_version.drive, + )?; + } + + let direct_selling_path = token_direct_selling_root_path_vec(); + + if let Some(price) = price { + let serialized_price = + price.serialize_consume_to_bytes_with_platform_version(platform_version)?; + drive_operations.push(LowLevelDriveOperation::insert_for_known_path_key_element( + direct_selling_path, + token_id.to_vec(), + Element::new_item(serialized_price), + )); + } else { + drive_operations.push(LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::delete_op(direct_selling_path, token_id.to_vec()), + )); + } + + Ok(drive_operations) + } +} diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/mod.rs new file mode 100644 index 00000000000..2143b2c0a4f --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/mod.rs @@ -0,0 +1,55 @@ +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use dpp::version::drive_versions::DriveVersion; +use grovedb::batch::KeyInfoPath; +use grovedb::EstimatedLayerInformation; +use std::collections::HashMap; + +impl Drive { + /// Adds estimation costs for token selling prices changes based on the provided drive version. + /// + /// This method updates the `estimated_costs_only_with_layer_info` HashMap with entries + /// representing the estimated costs for different layers of the token selling prices tree. The method + /// adjusts its behavior depending on the provided `drive_version`, allowing it to support + /// different versioned implementations for cost estimation. + /// + /// # Parameters + /// - `token_id`: A 32-byte identifier for the token whose balance changes are being estimated. + /// - `estimated_costs_only_with_layer_info`: A mutable reference to a HashMap that holds + /// `KeyInfoPath` and `EstimatedLayerInformation` for each token balance layer. + /// - `drive_version`: The version of the drive to determine which estimation logic to apply. + /// + /// # Returns + /// - `Ok(())` if the operation is successful. + /// - `Err(DriveError::UnknownVersionMismatch)` if the provided `drive_version` does not match + /// any known supported versions. + /// + /// # Errors + /// This function will return an error if the provided `drive_version` does not match a known version. + pub(crate) fn add_estimation_costs_for_token_selling_prices( + estimated_costs_only_with_layer_info: &mut HashMap, + drive_version: &DriveVersion, + ) -> Result<(), Error> { + match drive_version + .methods + .identity + .cost_estimation + .for_token_selling_prices + { + 0 => { + Self::add_estimation_costs_for_token_selling_prices_v0( + estimated_costs_only_with_layer_info, + ); + Ok(()) + } + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "add_estimation_costs_for_token_selling_prices".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs new file mode 100644 index 00000000000..3415bcc8bc8 --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs @@ -0,0 +1,100 @@ +use crate::drive::Drive; + +use grovedb::batch::KeyInfoPath; +use grovedb::EstimatedLayerCount::EstimatedLevel; +use grovedb::EstimatedLayerSizes::{AllItems, AllSubtrees}; +use grovedb::{EstimatedLayerInformation, TreeType}; + +use crate::drive::tokens::paths::{token_direct_selling_root_path, tokens_root_path}; +use crate::util::type_constants::DEFAULT_HASH_SIZE_U8; +use grovedb::EstimatedSumTrees::{NoSumTrees, SomeSumTrees}; +use std::collections::HashMap; + +impl Drive { + /// Adds estimated storage costs related to token direct selling prices (v0). + /// + /// This function populates the provided `estimated_costs_only_with_layer_info` map with + /// `EstimatedLayerInformation` entries, which represent cost estimation hints for GroveDB + /// during query planning and fee calculations. It is specific to version 0 of the token + /// selling price schema. + /// + /// # Parameters + /// + /// * `estimated_costs_only_with_layer_info` - A mutable reference to a map storing + /// estimation data keyed by GroveDB paths. + /// + /// # Estimation Structure + /// + /// The following layers are estimated: + /// + /// 1. **Top-Level Structure (`/`)**: + /// - Represents the root of the document structure. + /// - Contains 1 subtree (contracts/documents). + /// - Tree type: Normal. + /// - Depth: 2 levels deep. + /// + /// 2. **Token Root Path (`/0` or `/tokens`)**: + /// - Represents the root layer under which token-related structures reside. + /// - Includes a mixture of normal trees and sum trees (e.g., for token balances). + /// - Estimated as 1 subtree with specific weights for different tree types. + /// - Tree type: Normal. + /// - Depth: 2 levels deep. + /// + /// 3. **Token Direct Selling Root Path (`/0/0` or `/tokens/prices`)**: + /// - Contains direct purchase price entries for tokens. + /// - Expected to hold a relatively flat key-value structure with binary-encoded price schedules. + /// - Tree type: Normal. + /// - Estimated to contain 8 items, each with hash-sized keys and no child trees. + /// - Estimated depth: 10 levels. + /// + /// This setup provides a balanced estimation model for token price operations, + /// which helps GroveDB optimize storage behavior and fee prediction. + pub(super) fn add_estimation_costs_for_token_selling_prices_v0( + estimated_costs_only_with_layer_info: &mut HashMap, + ) { + // we have constructed the top layer so contract/documents tree are at the top + // since balance will be on layer 3 (level 2 on left then left) + // updating will mean we will update: + // 1 normal tree (token balances) + // 1 normal tree (identities) + // 1 normal tree (contract/documents) + // hence we should give an equal weight to both + estimated_costs_only_with_layer_info.insert( + KeyInfoPath::from_known_path([]), + EstimatedLayerInformation { + tree_type: TreeType::NormalTree, + estimated_layer_count: EstimatedLevel(2, false), + estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), + }, + ); + + // there is one tree for the root path + estimated_costs_only_with_layer_info.insert( + KeyInfoPath::from_known_path(tokens_root_path()), + EstimatedLayerInformation { + tree_type: TreeType::NormalTree, + estimated_layer_count: EstimatedLevel(2, false), + estimated_layer_sizes: AllSubtrees( + 1, + SomeSumTrees { + sum_trees_weight: 1, + big_sum_trees_weight: 1, + count_trees_weight: 0, + count_sum_trees_weight: 0, + non_sum_trees_weight: 1, + }, + None, + ), + }, + ); + + estimated_costs_only_with_layer_info.insert( + KeyInfoPath::from_known_path(token_direct_selling_root_path()), + EstimatedLayerInformation { + tree_type: TreeType::NormalTree, + estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep + estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, 8, None), + }, + ); + } +} diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/mod.rs index 9afdf1164de..7282fe6d17f 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/mod.rs @@ -18,3 +18,6 @@ pub mod for_root_token_ms_interval_distribution; /// Module for handling operations related to token perpetual distribution pub mod for_token_perpetual_distribution; + +/// Module for handling operations related to direct selling prices +pub mod for_token_direct_selling_prices; diff --git a/packages/rs-drive/src/drive/tokens/mod.rs b/packages/rs-drive/src/drive/tokens/mod.rs index 917425b34b8..dbc65eaea9d 100644 --- a/packages/rs-drive/src/drive/tokens/mod.rs +++ b/packages/rs-drive/src/drive/tokens/mod.rs @@ -48,6 +48,7 @@ pub mod unfreeze; #[cfg(feature = "server")] pub mod calculate_total_tokens_balance; +mod direct_purchase; /// Distribution module pub mod distribution; /// Token paths diff --git a/packages/rs-drive/src/drive/tokens/paths.rs b/packages/rs-drive/src/drive/tokens/paths.rs index b85e6714f6c..aba5aef9942 100644 --- a/packages/rs-drive/src/drive/tokens/paths.rs +++ b/packages/rs-drive/src/drive/tokens/paths.rs @@ -15,6 +15,8 @@ pub const TOKEN_STATUS_INFO_KEY: u8 = 64; pub const TOKEN_IDENTITY_INFO_KEY: u8 = 192; /// Key for accessing token balances tree. pub const TOKEN_BALANCES_KEY: u8 = 128; +/// Key that sets the pricing schedule for directly buying the token. +pub const TOKEN_DIRECT_SELL_PRICE_KEY: u8 = 92; /// Key for token distributions sub level pub const TOKEN_DISTRIBUTIONS_KEY: u8 = 32; @@ -85,6 +87,22 @@ pub fn token_balances_root_path_vec() -> Vec> { vec![vec![RootTree::Tokens as u8], vec![TOKEN_BALANCES_KEY]] } +/// The root path of token direct selling price tree +pub fn token_direct_selling_root_path() -> [&'static [u8]; 2] { + [ + Into::<&[u8; 1]>::into(RootTree::Tokens), + &[TOKEN_DIRECT_SELL_PRICE_KEY], + ] +} + +/// The root path of token direct selling price tree +pub fn token_direct_selling_root_path_vec() -> Vec> { + vec![ + vec![RootTree::Tokens as u8], + vec![TOKEN_DIRECT_SELL_PRICE_KEY], + ] +} + /// Returns the root path for token identity information as a fixed-size array of byte slices. pub fn token_identity_infos_root_path() -> [&'static [u8]; 2] { [ diff --git a/packages/rs-drive/src/util/batch/drive_op_batch/token.rs b/packages/rs-drive/src/util/batch/drive_op_batch/token.rs index e77b5856cc4..dd21c08b9cf 100644 --- a/packages/rs-drive/src/util/batch/drive_op_batch/token.rs +++ b/packages/rs-drive/src/util/batch/drive_op_batch/token.rs @@ -299,12 +299,10 @@ impl DriveLowLevelOperationConverter for TokenOperationType { Ok(batch_operations) } TokenOperationType::TokenSetPriceForDirectPurchase { token_id, price } => { - let batch_operations = drive.set_token_direct_purchase_price_operations( - token_id, + let batch_operations = drive.token_set_direct_purchase_price_operations( + token_id.to_buffer(), price, - block_info, estimated_costs_only_with_layer_info, - transaction, platform_version, )?; Ok(batch_operations) diff --git a/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs b/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs index b037a7d9599..1efb54333f5 100644 --- a/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs +++ b/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs @@ -7,7 +7,7 @@ use crate::drive::credit_pools::epochs; use crate::drive::identity::IdentityRootStructure; use crate::drive::{credit_pools, tokens, RootTree}; use crate::util::batch::grovedb_op_batch::KnownPath::{ - TokenBalancesRoot, TokenDistributionRoot, TokenIdentityInfoRoot, + TokenBalancesRoot, TokenDirectSellPriceRoot, TokenDistributionRoot, TokenIdentityInfoRoot, TokenPerpetualDistributionRoot, TokenPreProgrammedDistributionRoot, TokenStatusRoot, TokenTimedDistributionRoot, }; @@ -57,6 +57,7 @@ enum KnownPath { TokenRoot, //Level 1 TokenBalancesRoot, //Level 2 TokenDistributionRoot, //Level 2 + TokenDirectSellPriceRoot, //Level 2 TokenTimedDistributionRoot, //Level 3 TokenPreProgrammedDistributionRoot, //Level 3 TokenPerpetualDistributionRoot, //Level 3 @@ -239,6 +240,9 @@ fn readable_key_info(known_path: KnownPath, key_info: &KeyInfo) -> (String, Opti tokens::paths::TOKEN_DISTRIBUTIONS_KEY => { (format!("Distribution({})", tokens::paths::TOKEN_DISTRIBUTIONS_KEY), Some(TokenDistributionRoot)) } + tokens::paths::TOKEN_DIRECT_SELL_PRICE_KEY => { + (format!("SellPrice({})", tokens::paths::TOKEN_DIRECT_SELL_PRICE_KEY), Some(TokenDirectSellPriceRoot)) + } tokens::paths::TOKEN_BALANCES_KEY => { (format!("Balances({})", tokens::paths::TOKEN_BALANCES_KEY), Some(TokenBalancesRoot)) } diff --git a/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs b/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs index 8001191e891..355b54e6e29 100644 --- a/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs +++ b/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs @@ -40,7 +40,7 @@ use dpp::state_transition::batch_transition::token_transfer_transition::v0::v0_m use dpp::state_transition::batch_transition::token_unfreeze_transition::v0::v0_methods::TokenUnfreezeTransitionV0Methods; use dpp::state_transition::masternode_vote_transition::accessors::MasternodeVoteTransitionAccessorsV0; use dpp::state_transition::proof_result::StateTransitionProofResult; -use dpp::state_transition::proof_result::StateTransitionProofResult::{VerifiedBalanceTransfer, VerifiedDataContract, VerifiedDocuments, VerifiedIdentity, VerifiedMasternodeVote, VerifiedPartialIdentity, VerifiedTokenActionWithDocument, VerifiedTokenBalance, VerifiedTokenIdentitiesBalances, VerifiedTokenIdentityInfo}; +use dpp::state_transition::proof_result::StateTransitionProofResult::{VerifiedBalanceTransfer, VerifiedDataContract, VerifiedDocuments, VerifiedIdentity, VerifiedMasternodeVote, VerifiedPartialIdentity, VerifiedTokenActionWithDocument, VerifiedTokenBalance, VerifiedTokenIdentitiesBalances, VerifiedTokenIdentityInfo, VerifiedTokenPricingSchedule}; use dpp::system_data_contracts::{load_system_data_contract, SystemDataContract}; use dpp::tokens::info::v0::IdentityTokenInfoV0Accessors; use dpp::voting::vote_polls::VotePoll; @@ -499,6 +499,45 @@ impl Drive { )) } } + TokenTransition::DirectPurchase(_) => { + if keeps_historical_document.keeps_direct_purchase_history() { + historical_query() + } else { + let (root_hash, Some(balance)) = + Drive::verify_token_balance_for_identity_id( + proof, + token_id.into_buffer(), + owner_id.into_buffer(), + false, + platform_version, + )? + else { + return Err(Error::Proof(ProofError::IncorrectProof( + format!("proof did not contain token balance for identity {} expected to exist because of state transition (token burn)", owner_id)))); + }; + Ok((root_hash, VerifiedTokenBalance(owner_id, balance))) + } + } + TokenTransition::SetPriceForDirectPurchase(_) => { + if keeps_historical_document.keeps_direct_pricing_history() { + historical_query() + } else { + let (root_hash, token_pricing_schedule) = + Drive::verify_token_direct_selling_price( + proof, + token_id.into_buffer(), + false, + platform_version, + )?; + Ok(( + root_hash, + VerifiedTokenPricingSchedule( + owner_id, + token_pricing_schedule, + ), + )) + } + } TokenTransition::DestroyFrozenFunds(_) | TokenTransition::EmergencyAction(_) | TokenTransition::ConfigUpdate(_) diff --git a/packages/rs-drive/src/verify/tokens/mod.rs b/packages/rs-drive/src/verify/tokens/mod.rs index ce99086b616..125832d8966 100644 --- a/packages/rs-drive/src/verify/tokens/mod.rs +++ b/packages/rs-drive/src/verify/tokens/mod.rs @@ -1,6 +1,7 @@ mod verify_token_balance_for_identity_id; mod verify_token_balances_for_identity_id; mod verify_token_balances_for_identity_ids; +mod verify_token_direct_selling_price; mod verify_token_info_for_identity_id; mod verify_token_infos_for_identity_id; mod verify_token_infos_for_identity_ids; diff --git a/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/mod.rs b/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/mod.rs new file mode 100644 index 00000000000..b3f3bd2e7fb --- /dev/null +++ b/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/mod.rs @@ -0,0 +1,67 @@ +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; + +use crate::verify::RootHash; + +use dpp::version::PlatformVersion; + +impl Drive { + /// Verifies the status of a token using a provided cryptographic proof. + /// + /// This function takes a cryptographic proof, a token ID, and other parameters to verify + /// the existence and status of a token in the data structure. It delegates the verification + /// process to the appropriate versioned implementation based on the platform version. + /// + /// # Parameters + /// + /// - `proof`: A slice of bytes representing the cryptographic proof of the token's status. + /// - `token_id`: A 32-byte identifier representing the unique ID of the token. + /// - `verify_subset_of_proof`: A boolean indicating whether to verify a subset of the provided proof. + /// - `platform_version`: A reference to the [PlatformVersion] object that specifies which version + /// of the function implementation to invoke. + /// + /// # Returns + /// + /// Returns a `Result` containing: + /// - `Ok((RootHash, Option))`: A tuple where: + /// - `RootHash`: The root hash of the data structure at the time the proof was created. + /// - `Option`: The status of the token if it exists, or `None` if the token does not exist. + /// - `Err(Error)`: An error if the verification fails due to an invalid proof, incorrect data, or version mismatch. + /// + /// # Errors + /// + /// This function can return an `Error` in the following cases: + /// - The proof is invalid or corrupted. + /// - The token's status data is missing or inconsistent. + /// - The platform version does not match any of the known implementations. + pub fn verify_token_direct_selling_price( + proof: &[u8], + token_id: [u8; 32], + verify_subset_of_proof: bool, + platform_version: &PlatformVersion, + ) -> Result<(RootHash, Option), Error> { + match platform_version + .drive + .methods + .verify + .token + .verify_token_direct_selling_price + { + 0 => Self::verify_token_direct_selling_price_v0( + proof, + token_id, + verify_subset_of_proof, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "verify_token_direct_selling_price".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/v0/mod.rs b/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/v0/mod.rs new file mode 100644 index 00000000000..803e66d2e6f --- /dev/null +++ b/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_price/v0/mod.rs @@ -0,0 +1,54 @@ +use crate::drive::Drive; +use grovedb::Element::Item; + +use crate::error::proof::ProofError; +use crate::error::Error; + +use crate::verify::RootHash; + +use dpp::serialization::PlatformDeserializable; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use grovedb::GroveDb; +use platform_version::version::PlatformVersion; + +impl Drive { + pub(super) fn verify_token_direct_selling_price_v0( + proof: &[u8], + token_id: [u8; 32], + verify_subset_of_proof: bool, + platform_version: &PlatformVersion, + ) -> Result<(RootHash, Option), Error> { + let path_query = Self::token_direct_purchase_price_query(token_id); + let (root_hash, mut proved_key_values) = if verify_subset_of_proof { + GroveDb::verify_subset_query_with_absence_proof( + proof, + &path_query, + &platform_version.drive.grove_version, + )? + } else { + GroveDb::verify_query_with_absence_proof( + proof, + &path_query, + &platform_version.drive.grove_version, + )? + }; + if proved_key_values.len() == 1 { + let proved_key_value = proved_key_values.remove(0); + match proved_key_value.2 { + Some(Item(value, ..)) => Ok(( + root_hash, + Some(TokenPricingSchedule::deserialize_from_bytes(&value)?), + )), + None => Ok((root_hash, None)), + _ => Err(Error::Proof(ProofError::IncorrectValueSize( + "proof did not point to an item", + ))), + } + } else { + Err(Error::Proof(ProofError::WrongElementCount { + expected: 1, + got: proved_key_values.len(), + })) + } + } +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs index 1a2526f4fe7..c1208115e50 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/mod.rs @@ -73,6 +73,7 @@ pub struct DriveIdentityCostEstimationMethodVersions { pub for_token_pre_programmed_distribution: FeatureVersion, pub for_root_token_ms_interval_distribution: FeatureVersion, pub for_token_perpetual_distribution: FeatureVersion, + pub for_token_selling_prices: FeatureVersion, } #[derive(Clone, Debug, Default)] diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs index beb79c65c18..be2bab51a7f 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_identity_method_versions/v1.rs @@ -134,6 +134,7 @@ pub const DRIVE_IDENTITY_METHOD_VERSIONS_V1: DriveIdentityMethodVersions = for_token_perpetual_distribution: 0, for_token_pre_programmed_distribution: 0, for_root_token_ms_interval_distribution: 0, + for_token_selling_prices: 0, }, withdrawals: DriveIdentityWithdrawalMethodVersions { document: DriveIdentityWithdrawalDocumentMethodVersions { diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs index f2b0049903e..ff205690c2f 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs @@ -64,6 +64,7 @@ pub struct DriveVerifyTokenMethodVersions { pub verify_token_info_for_identity_id: FeatureVersion, pub verify_token_status: FeatureVersion, pub verify_token_pre_programmed_distributions: FeatureVersion, + pub verify_token_direct_selling_price: FeatureVersion, } #[derive(Clone, Debug, Default)] diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs index 941cfba47ea..29e1a891bca 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs @@ -46,6 +46,7 @@ pub const DRIVE_VERIFY_METHOD_VERSIONS_V1: DriveVerifyMethodVersions = DriveVeri verify_token_info_for_identity_id: 0, verify_token_status: 0, verify_token_pre_programmed_distributions: 0, + verify_token_direct_selling_price: 0, }, single_document: DriveVerifySingleDocumentMethodVersions { verify_proof: 0, From ad05060605c331e10eba13a8ae19f3ce40c4a777 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Apr 2025 15:58:25 +0700 Subject: [PATCH 05/32] query --- .../protos/platform/v0/platform.proto | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index abc2aa85bbe..1a84caa719f 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -60,6 +60,7 @@ service Platform { rpc getIdentityTokenInfos(GetIdentityTokenInfosRequest) returns (GetIdentityTokenInfosResponse); rpc getIdentitiesTokenInfos(GetIdentitiesTokenInfosRequest) returns (GetIdentitiesTokenInfosResponse); rpc getTokenStatuses(GetTokenStatusesRequest) returns (GetTokenStatusesResponse); + rpc getTokenDirectPurchasePrices(GetTokenDirectPurchasePricesRequest) returns (GetTokenDirectPurchasePricesResponse); rpc getTokenPreProgrammedDistributions(GetTokenPreProgrammedDistributionsRequest) returns (GetTokenPreProgrammedDistributionsResponse); rpc getTokenTotalSupply(GetTokenTotalSupplyRequest) returns (GetTokenTotalSupplyResponse); rpc getGroupInfo(GetGroupInfoRequest) returns (GetGroupInfoResponse); @@ -1418,6 +1419,55 @@ message GetTokenStatusesResponse { } } + +message GetTokenDirectPurchasePricesRequest { + message GetTokenDirectPurchasePricesRequestV0 { + repeated bytes token_ids = 1; + bool prove = 2; + } + oneof version { + GetTokenDirectPurchasePricesRequestV0 v0 = 1; + } +} + +message GetTokenDirectPurchasePricesResponse { + message GetTokenDirectPurchasePricesResponseV0 { + message PriceForQuantity { + uint64 quantity = 1; + uint64 price = 2; + } + + message PricingSchedule { + repeated PriceForQuantity price_for_quantity = 1; + } + + message Price { + oneof price { + uint64 fixed_price = 1; + PricingSchedule variable_price = 2; + } + } + + message TokenDirectPurchasePriceEntry { + bytes token_id = 1; + optional Price price = 2; + } + + message TokenDirectPurchasePrices { + repeated TokenDirectPurchasePriceEntry token_direct_purchase_price = 1; + } + + oneof result { + TokenDirectPurchasePrices token_direct_purchase_prices = 1; + Proof proof = 2; + } + ResponseMetadata metadata = 3; + } + oneof version { + GetTokenDirectPurchasePricesResponseV0 v0 = 1; + } +} + message GetTokenPreProgrammedDistributionsRequest { message GetTokenPreProgrammedDistributionsRequestV0 { bytes token_id = 1; From 0cddb0094334c0effcbed12035a1980dd64d303f Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Apr 2025 18:55:06 +0700 Subject: [PATCH 06/32] a lot of fixes --- packages/rs-dpp/src/errors/consensus/codes.rs | 3 + .../src/errors/consensus/state/state_error.rs | 11 +- .../src/errors/consensus/state/token/mod.rs | 6 + .../token_amount_under_minimum_sale_amount.rs | 48 ++++ ...oken_direct_purchase_user_price_too_low.rs | 49 ++++ .../state/token/token_not_for_direct_sale.rs | 32 +++ .../batched_transition/token_transition.rs | 2 +- packages/rs-dpp/src/tokens/token_event.rs | 6 +- .../execution/types/execution_event/mod.rs | 4 +- .../batch/tests/token/direct_selling/mod.rs | 190 ++++++++++++-- .../group_queries/group_actions/v0/mod.rs | 2 +- packages/rs-drive-abci/src/query/service.rs | 10 +- .../fetch_token_direct_purchase_price/mod.rs | 120 +++++++++ .../v0/mod.rs | 70 +++++ .../src/drive/tokens/direct_purchase/mod.rs | 1 + .../drive/tokens/direct_purchase/queries.rs | 6 +- .../set_direct_purchase_price/v0/mod.rs | 4 +- .../for_token_direct_selling_prices/v0/mod.rs | 4 +- packages/rs-drive/src/drive/tokens/paths.rs | 4 +- ...et_price_for_direct_purchase_transition.rs | 4 +- .../batch/token/token_transition.rs | 2 +- .../transformer.rs | 51 ---- .../v0/transformer.rs | 248 ++++++++++-------- .../state_transition_action/batch/v0/mod.rs | 9 +- .../drive_token_method_versions/mod.rs | 1 + .../drive_token_method_versions/v1.rs | 1 + 26 files changed, 692 insertions(+), 196 deletions(-) create mode 100644 packages/rs-dpp/src/errors/consensus/state/token/token_amount_under_minimum_sale_amount.rs create mode 100644 packages/rs-dpp/src/errors/consensus/state/token/token_direct_purchase_user_price_too_low.rs create mode 100644 packages/rs-dpp/src/errors/consensus/state/token/token_not_for_direct_sale.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/v0/mod.rs diff --git a/packages/rs-dpp/src/errors/consensus/codes.rs b/packages/rs-dpp/src/errors/consensus/codes.rs index f58b0f07ccb..7202f29e76a 100644 --- a/packages/rs-dpp/src/errors/consensus/codes.rs +++ b/packages/rs-dpp/src/errors/consensus/codes.rs @@ -307,6 +307,9 @@ impl ErrorWithCode for StateError { Self::InvalidTokenClaimWrongClaimant(_) => 40717, Self::TokenTransferRecipientIdentityNotExistError(_) => 40718, Self::PreProgrammedDistributionTimestampInPastError(_) => 40719, + Self::TokenDirectPurchaseUserPriceTooLow(_) => 40720, + Self::TokenAmountUnderMinimumSaleAmount(_) => 40721, + Self::TokenNotForDirectSale(_) => 40722, // Group errors: 40800-40899 Self::IdentityNotMemberOfGroupError(_) => 40800, diff --git a/packages/rs-dpp/src/errors/consensus/state/state_error.rs b/packages/rs-dpp/src/errors/consensus/state/state_error.rs index e4b23ef0eb9..8151d017fee 100644 --- a/packages/rs-dpp/src/errors/consensus/state/state_error.rs +++ b/packages/rs-dpp/src/errors/consensus/state/state_error.rs @@ -41,7 +41,7 @@ use crate::consensus::state::identity::missing_transfer_key_error::MissingTransf use crate::consensus::state::identity::no_transfer_key_for_core_withdrawal_available_error::NoTransferKeyForCoreWithdrawalAvailableError; use crate::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_insufficient_error::PrefundedSpecializedBalanceInsufficientError; use crate::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_not_found_error::PrefundedSpecializedBalanceNotFoundError; -use crate::consensus::state::token::{IdentityDoesNotHaveEnoughTokenBalanceError, IdentityTokenAccountFrozenError, IdentityTokenAccountNotFrozenError, InvalidGroupPositionError, NewAuthorizedActionTakerGroupDoesNotExistError, NewAuthorizedActionTakerIdentityDoesNotExistError, NewAuthorizedActionTakerMainGroupNotSetError, NewTokensDestinationIdentityDoesNotExistError, TokenMintPastMaxSupplyError, TokenSettingMaxSupplyToLessThanCurrentSupplyError, UnauthorizedTokenActionError, IdentityTokenAccountAlreadyFrozenError, TokenAlreadyPausedError, TokenIsPausedError, TokenNotPausedError, InvalidTokenClaimPropertyMismatch, InvalidTokenClaimNoCurrentRewards, InvalidTokenClaimWrongClaimant, PreProgrammedDistributionTimestampInPastError, TokenTransferRecipientIdentityNotExistError, IdentityHasNotAgreedToPayRequiredTokenAmountError, RequiredTokenPaymentInfoNotSetError, IdentityTryingToPayWithWrongTokenError}; +use crate::consensus::state::token::{IdentityDoesNotHaveEnoughTokenBalanceError, IdentityTokenAccountFrozenError, IdentityTokenAccountNotFrozenError, InvalidGroupPositionError, NewAuthorizedActionTakerGroupDoesNotExistError, NewAuthorizedActionTakerIdentityDoesNotExistError, NewAuthorizedActionTakerMainGroupNotSetError, NewTokensDestinationIdentityDoesNotExistError, TokenMintPastMaxSupplyError, TokenSettingMaxSupplyToLessThanCurrentSupplyError, UnauthorizedTokenActionError, IdentityTokenAccountAlreadyFrozenError, TokenAlreadyPausedError, TokenIsPausedError, TokenNotPausedError, InvalidTokenClaimPropertyMismatch, InvalidTokenClaimNoCurrentRewards, InvalidTokenClaimWrongClaimant, PreProgrammedDistributionTimestampInPastError, TokenTransferRecipientIdentityNotExistError, IdentityHasNotAgreedToPayRequiredTokenAmountError, RequiredTokenPaymentInfoNotSetError, IdentityTryingToPayWithWrongTokenError, TokenDirectPurchaseUserPriceTooLow, TokenAmountUnderMinimumSaleAmount, TokenNotForDirectSale}; use crate::consensus::state::voting::masternode_incorrect_voter_identity_id_error::MasternodeIncorrectVoterIdentityIdError; use crate::consensus::state::voting::masternode_incorrect_voting_address_error::MasternodeIncorrectVotingAddressError; use crate::consensus::state::voting::masternode_not_found_error::MasternodeNotFoundError; @@ -289,6 +289,15 @@ pub enum StateError { #[error(transparent)] IdentityTryingToPayWithWrongTokenError(IdentityTryingToPayWithWrongTokenError), + + #[error(transparent)] + TokenDirectPurchaseUserPriceTooLow(TokenDirectPurchaseUserPriceTooLow), + + #[error(transparent)] + TokenAmountUnderMinimumSaleAmount(TokenAmountUnderMinimumSaleAmount), + + #[error(transparent)] + TokenNotForDirectSale(TokenNotForDirectSale), } impl From for ConsensusError { diff --git a/packages/rs-dpp/src/errors/consensus/state/token/mod.rs b/packages/rs-dpp/src/errors/consensus/state/token/mod.rs index bd63f021a6c..e42d7ae8b05 100644 --- a/packages/rs-dpp/src/errors/consensus/state/token/mod.rs +++ b/packages/rs-dpp/src/errors/consensus/state/token/mod.rs @@ -15,8 +15,11 @@ mod new_tokens_destination_identity_does_not_exist_error; mod pre_programmed_distribution_timestamp_in_past_error; mod required_token_payment_info_not_set_error; mod token_already_paused_error; +mod token_amount_under_minimum_sale_amount; +mod token_direct_purchase_user_price_too_low; mod token_is_paused_error; mod token_mint_past_max_supply_error; +mod token_not_for_direct_sale; mod token_not_paused_error; mod token_setting_max_supply_to_less_than_current_supply_error; mod token_transfer_recipient_identity_not_exist_error; @@ -39,8 +42,11 @@ pub use new_tokens_destination_identity_does_not_exist_error::*; pub use pre_programmed_distribution_timestamp_in_past_error::*; pub use required_token_payment_info_not_set_error::*; pub use token_already_paused_error::*; +pub use token_amount_under_minimum_sale_amount::*; +pub use token_direct_purchase_user_price_too_low::*; pub use token_is_paused_error::*; pub use token_mint_past_max_supply_error::*; +pub use token_not_for_direct_sale::*; pub use token_not_paused_error::*; pub use token_setting_max_supply_to_less_than_current_supply_error::*; pub use token_transfer_recipient_identity_not_exist_error::*; diff --git a/packages/rs-dpp/src/errors/consensus/state/token/token_amount_under_minimum_sale_amount.rs b/packages/rs-dpp/src/errors/consensus/state/token/token_amount_under_minimum_sale_amount.rs new file mode 100644 index 00000000000..921050fff49 --- /dev/null +++ b/packages/rs-dpp/src/errors/consensus/state/token/token_amount_under_minimum_sale_amount.rs @@ -0,0 +1,48 @@ +use crate::consensus::state::state_error::StateError; +use crate::consensus::ConsensusError; +use crate::ProtocolError; +use bincode::{Decode, Encode}; +use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; +use platform_value::Identifier; +use thiserror::Error; + +#[derive( + Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, +)] +#[error( + "Requested token amount {desired_amount} is below the minimum sale amount {minimum_amount} for token {token_id}." +)] +#[platform_serialize(unversioned)] +pub struct TokenAmountUnderMinimumSaleAmount { + token_id: Identifier, + desired_amount: u64, + minimum_amount: u64, +} + +impl TokenAmountUnderMinimumSaleAmount { + pub fn new(token_id: Identifier, desired_amount: u64, minimum_amount: u64) -> Self { + Self { + token_id, + desired_amount, + minimum_amount, + } + } + + pub fn token_id(&self) -> &Identifier { + &self.token_id + } + + pub fn desired_amount(&self) -> u64 { + self.desired_amount + } + + pub fn minimum_amount(&self) -> u64 { + self.minimum_amount + } +} + +impl From for ConsensusError { + fn from(err: TokenAmountUnderMinimumSaleAmount) -> Self { + Self::StateError(StateError::TokenAmountUnderMinimumSaleAmount(err)) + } +} diff --git a/packages/rs-dpp/src/errors/consensus/state/token/token_direct_purchase_user_price_too_low.rs b/packages/rs-dpp/src/errors/consensus/state/token/token_direct_purchase_user_price_too_low.rs new file mode 100644 index 00000000000..4824eeb5b9a --- /dev/null +++ b/packages/rs-dpp/src/errors/consensus/state/token/token_direct_purchase_user_price_too_low.rs @@ -0,0 +1,49 @@ +use crate::consensus::state::state_error::StateError; +use crate::consensus::ConsensusError; +use crate::fee::Credits; +use crate::ProtocolError; +use bincode::{Decode, Encode}; +use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; +use platform_value::Identifier; +use thiserror::Error; + +#[derive( + Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, +)] +#[error( + "Provided direct purchase price {user_price} is below the required price {required_price} for token {token_id}." +)] +#[platform_serialize(unversioned)] +pub struct TokenDirectPurchaseUserPriceTooLow { + token_id: Identifier, + user_price: Credits, + required_price: Credits, +} + +impl TokenDirectPurchaseUserPriceTooLow { + pub fn new(token_id: Identifier, user_price: Credits, required_price: Credits) -> Self { + Self { + token_id, + user_price, + required_price, + } + } + + pub fn token_id(&self) -> &Identifier { + &self.token_id + } + + pub fn user_price(&self) -> Credits { + self.user_price + } + + pub fn required_price(&self) -> Credits { + self.required_price + } +} + +impl From for ConsensusError { + fn from(err: TokenDirectPurchaseUserPriceTooLow) -> Self { + Self::StateError(StateError::TokenDirectPurchaseUserPriceTooLow(err)) + } +} diff --git a/packages/rs-dpp/src/errors/consensus/state/token/token_not_for_direct_sale.rs b/packages/rs-dpp/src/errors/consensus/state/token/token_not_for_direct_sale.rs new file mode 100644 index 00000000000..7eb0921798b --- /dev/null +++ b/packages/rs-dpp/src/errors/consensus/state/token/token_not_for_direct_sale.rs @@ -0,0 +1,32 @@ +use crate::consensus::state::state_error::StateError; +use crate::consensus::ConsensusError; +use crate::ProtocolError; +use bincode::{Decode, Encode}; +use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; +use platform_value::Identifier; +use thiserror::Error; + +#[derive( + Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, +)] +#[error("Token {token_id} is not available for direct sale.")] +#[platform_serialize(unversioned)] +pub struct TokenNotForDirectSale { + token_id: Identifier, +} + +impl TokenNotForDirectSale { + pub fn new(token_id: Identifier) -> Self { + Self { token_id } + } + + pub fn token_id(&self) -> &Identifier { + &self.token_id + } +} + +impl From for ConsensusError { + fn from(err: TokenNotForDirectSale) -> Self { + Self::StateError(StateError::TokenNotForDirectSale(err)) + } +} diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs index fa7c3f2590f..5ca7d10bb2e 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition.rs @@ -481,7 +481,7 @@ impl TokenTransitionV0Methods for TokenTransition { direct_purchase.total_agreed_price(), ), TokenTransition::SetPriceForDirectPurchase(set_price_transition) => { - TokenEvent::SetPriceForDirectPurchase( + TokenEvent::ChangePriceForDirectPurchase( set_price_transition.price().cloned(), set_price_transition.public_note().cloned(), ) diff --git a/packages/rs-dpp/src/tokens/token_event.rs b/packages/rs-dpp/src/tokens/token_event.rs index 2e3408fa109..ed3d9bfa840 100644 --- a/packages/rs-dpp/src/tokens/token_event.rs +++ b/packages/rs-dpp/src/tokens/token_event.rs @@ -58,7 +58,7 @@ pub enum TokenEvent { ), EmergencyAction(TokenEmergencyAction, TokenEventPublicNote), ConfigUpdate(TokenConfigurationChangeItem, TokenEventPublicNote), - SetPriceForDirectPurchase(Option, TokenEventPublicNote), + ChangePriceForDirectPurchase(Option, TokenEventPublicNote), DirectPurchase(TokenAmount, Credits), } @@ -75,7 +75,7 @@ impl TokenEvent { TokenEvent::EmergencyAction(..) => "emergencyAction", TokenEvent::ConfigUpdate(..) => "configUpdate", TokenEvent::DirectPurchase(..) => "directPurchase", - TokenEvent::SetPriceForDirectPurchase(..) => "setPriceForDirectPurchase", + TokenEvent::ChangePriceForDirectPurchase(..) => "directPricing", } } @@ -253,7 +253,7 @@ impl TokenEvent { } properties } - TokenEvent::SetPriceForDirectPurchase(price, note) => { + TokenEvent::ChangePriceForDirectPurchase(price, note) => { let mut properties = BTreeMap::from([("tokenId".to_string(), token_id.into())]); if let Some(price_schedule) = price { diff --git a/packages/rs-drive-abci/src/execution/types/execution_event/mod.rs b/packages/rs-drive-abci/src/execution/types/execution_event/mod.rs index 3b3ee0e299f..a0eb4605360 100644 --- a/packages/rs-drive-abci/src/execution/types/execution_event/mod.rs +++ b/packages/rs-drive-abci/src/execution/types/execution_event/mod.rs @@ -162,9 +162,9 @@ impl ExecutionEvent<'_> { ))) } } - StateTransitionAction::BatchAction(document_batch_action) => { + StateTransitionAction::BatchAction(batch_action) => { let user_fee_increase = action.user_fee_increase(); - let removed_balance = document_batch_action.all_used_balances()?; + let removed_balance = batch_action.all_used_balances()?; let operations = action.into_high_level_drive_operations(epoch, platform_version)?; if let Some(identity) = identity { diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs index a2fc7abd4d0..d1ded56c94b 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs @@ -20,7 +20,19 @@ mod token_selling_tests { let (contract, token_id) = create_token_contract_with_owner_identity( &mut platform, seller.id(), - None::, + Some(|token_configuration: &mut TokenConfiguration| { + token_configuration + .distribution_rules_mut() + .set_change_direct_purchase_pricing_rules(ChangeControlRules::V0( + ChangeControlRulesV0 { + authorized_to_make_change: AuthorizedActionTakers::ContractOwner, + admin_action_takers: AuthorizedActionTakers::NoOne, + changing_authorized_action_takers_to_no_one_allowed: false, + changing_admin_action_takers_to_no_one_allowed: false, + self_changing_admin_action_takers_allowed: false, + }, + )); + }), None, None, platform_version, @@ -49,21 +61,145 @@ mod token_selling_tests { ) .unwrap(); - process_test_state_transition( + let processing_result = process_test_state_transition( + &mut platform, + set_price_transition, + &platform_state, + platform_version, + ); + + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::SuccessfulExecution(..)] + ); + + // Buyer purchases tokens + let purchase_transition = BatchTransition::new_token_direct_purchase_transition( + token_id, + buyer.id(), + contract.id(), + 0, + 3, // Buying 3 tokens + dash_to_credits!(3), + &buyer_key, + 2, + 0, + &buyer_signer, + platform_version, + None, + None, + None, + ) + .unwrap(); + + let processing_result = process_test_state_transition( + &mut platform, + purchase_transition, + &platform_state, + platform_version, + ); + + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::SuccessfulExecution(..)] + ); + + let token_balance = platform + .drive + .fetch_identity_token_balance( + token_id.to_buffer(), + buyer.id().to_buffer(), + None, + platform_version, + ) + .expect("expected to fetch token balance"); + assert_eq!(token_balance, Some(3)); + + let buyer_credit_balance = platform + .drive + .fetch_identity_balance(buyer.id().to_buffer(), None, platform_version) + .expect("expected to fetch credit balance"); + assert_eq!(buyer_credit_balance, Some(699_868_054_220)); // 10.0 - 3.0 spent - fees =~ 7 dash left + } + + #[test] + fn test_direct_purchase_single_price_not_paying_full_price() { + let platform_version = PlatformVersion::latest(); + let mut platform = TestPlatformBuilder::new() + .with_latest_protocol_version() + .build_with_mock_rpc() + .set_genesis_state(); + + let mut rng = StdRng::seed_from_u64(12345); + let (seller, seller_signer, seller_key) = + setup_identity(&mut platform, rng.gen(), dash_to_credits!(1.0)); + let (buyer, buyer_signer, buyer_key) = + setup_identity(&mut platform, rng.gen(), dash_to_credits!(10.0)); + + let (contract, token_id) = create_token_contract_with_owner_identity( + &mut platform, + seller.id(), + Some(|token_configuration: &mut TokenConfiguration| { + token_configuration + .distribution_rules_mut() + .set_change_direct_purchase_pricing_rules(ChangeControlRules::V0( + ChangeControlRulesV0 { + authorized_to_make_change: AuthorizedActionTakers::ContractOwner, + admin_action_takers: AuthorizedActionTakers::NoOne, + changing_authorized_action_takers_to_no_one_allowed: false, + changing_admin_action_takers_to_no_one_allowed: false, + self_changing_admin_action_takers_allowed: false, + }, + )); + }), + None, + None, + platform_version, + ); + + let platform_state = platform.state.load(); + + // Seller sets single price + let set_price_transition = + BatchTransition::new_token_change_direct_purchase_price_transition( + token_id, + seller.id(), + contract.id(), + 0, + Some(TokenPricingSchedule::SinglePrice(dash_to_credits!(1))), // Price per token + None, + None, + &seller_key, + 2, + 0, + &seller_signer, + platform_version, + None, + None, + None, + ) + .unwrap(); + + let processing_result = process_test_state_transition( &mut platform, set_price_transition, &platform_state, platform_version, ); + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::SuccessfulExecution(..)] + ); + // Buyer purchases tokens let purchase_transition = BatchTransition::new_token_direct_purchase_transition( token_id, buyer.id(), contract.id(), 0, - 10, // Buying 10 tokens - 500, + 3, // Buying 3 tokens + dash_to_credits!(2), // Not enough &buyer_key, 2, 0, @@ -75,13 +211,21 @@ mod token_selling_tests { ) .unwrap(); - process_test_state_transition( + let processing_result = process_test_state_transition( &mut platform, purchase_transition, &platform_state, platform_version, ); + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::PaidConsensusError( + ConsensusError::StateError(StateError::TokenDirectPurchaseUserPriceTooLow(_)), + _ + )] + ); + let token_balance = platform .drive .fetch_identity_token_balance( @@ -91,13 +235,13 @@ mod token_selling_tests { platform_version, ) .expect("expected to fetch token balance"); - assert_eq!(token_balance, Some(10)); + assert_eq!(token_balance, None); let buyer_credit_balance = platform .drive .fetch_identity_balance(buyer.id().to_buffer(), None, platform_version) .expect("expected to fetch credit balance"); - assert_eq!(buyer_credit_balance, Some(dash_to_credits!(9.0))); // 10.0 - 1.0 spent (10 tokens * 500 credits) + assert_eq!(buyer_credit_balance, Some(999_987_872_760)); // 10.0 - bump action fees } #[test] @@ -117,7 +261,19 @@ mod token_selling_tests { let (contract, token_id) = create_token_contract_with_owner_identity( &mut platform, seller.id(), - None::, + Some(|token_configuration: &mut TokenConfiguration| { + token_configuration + .distribution_rules_mut() + .set_change_direct_purchase_pricing_rules(ChangeControlRules::V0( + ChangeControlRulesV0 { + authorized_to_make_change: AuthorizedActionTakers::ContractOwner, + admin_action_takers: AuthorizedActionTakers::NoOne, + changing_authorized_action_takers_to_no_one_allowed: false, + changing_admin_action_takers_to_no_one_allowed: false, + self_changing_admin_action_takers_allowed: false, + }, + )); + }), None, None, platform_version, @@ -132,7 +288,7 @@ mod token_selling_tests { seller.id(), contract.id(), 0, - Some(TokenPricingSchedule::SinglePrice(5000)), // Price per token + Some(TokenPricingSchedule::SinglePrice(dash_to_credits!(1.0))), // Price per token None, None, &seller_key, @@ -146,20 +302,25 @@ mod token_selling_tests { ) .unwrap(); - process_test_state_transition( + let processing_result = process_test_state_transition( &mut platform, set_price_transition, &platform_state, platform_version, ); + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::SuccessfulExecution(..)] + ); + let purchase_transition = BatchTransition::new_token_direct_purchase_transition( token_id, buyer.id(), contract.id(), 0, - 1, // Buying 1 token - 5000, // Agreed price per token + 1, // Buying 1 token + dash_to_credits!(1.0), // Agreed price per token &buyer_key, 2, 0, @@ -180,9 +341,8 @@ mod token_selling_tests { assert_matches!( processing_result.execution_results().as_slice(), - [StateTransitionExecutionResult::PaidConsensusError( - ConsensusError::StateError(StateError::IdentityInsufficientBalanceError(_)), - _ + [StateTransitionExecutionResult::UnpaidConsensusError( + ConsensusError::StateError(StateError::IdentityInsufficientBalanceError(_)) )] ); diff --git a/packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs b/packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs index cc4a0a50ca6..0db9f666932 100644 --- a/packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs +++ b/packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs @@ -197,7 +197,7 @@ impl Platform { })), }) } - TokenEvent::SetPriceForDirectPurchase(pricing_schedule, public_note) => { + TokenEvent::ChangePriceForDirectPurchase(pricing_schedule, public_note) => { group_action_event::EventType::TokenEvent(TokenEventResponse { r#type: Some(token_event::Type::UpdatePrice(UpdateDirectPurchasePriceEvent { price: pricing_schedule.map(|pricing_schedule| { diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 0ae0c535475..178d2409a81 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -37,7 +37,8 @@ use dapi_grpc::platform::v0::{ GetPrefundedSpecializedBalanceResponse, GetProofsRequest, GetProofsResponse, GetProtocolVersionUpgradeStateRequest, GetProtocolVersionUpgradeStateResponse, GetProtocolVersionUpgradeVoteStatusRequest, GetProtocolVersionUpgradeVoteStatusResponse, - GetStatusRequest, GetStatusResponse, GetTokenPreProgrammedDistributionsRequest, + GetStatusRequest, GetStatusResponse, GetTokenDirectPurchasePricesRequest, + GetTokenDirectPurchasePricesResponse, GetTokenPreProgrammedDistributionsRequest, GetTokenPreProgrammedDistributionsResponse, GetTokenStatusesRequest, GetTokenStatusesResponse, GetTokenTotalSupplyRequest, GetTokenTotalSupplyResponse, GetTotalCreditsInPlatformRequest, GetTotalCreditsInPlatformResponse, GetVotePollsByEndDateRequest, GetVotePollsByEndDateResponse, @@ -748,6 +749,13 @@ impl PlatformService for QueryService { ) .await } + + async fn get_token_direct_purchase_prices( + &self, + request: Request, + ) -> Result, Status> { + todo!() + } } fn query_error_into_status(error: QueryError) -> Status { diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/mod.rs new file mode 100644 index 00000000000..d56b8e7444c --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/mod.rs @@ -0,0 +1,120 @@ +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use dpp::block::block_info::BlockInfo; +use dpp::fee::fee_result::FeeResult; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Fetches the Token direct_purchase_price from the backing store. + /// + /// # Arguments + /// + /// * `token_id` - The ID of the token. + /// * `transaction` - The current transaction. + /// * `platform_version` - The platform version to use. + /// + /// # Returns + /// + /// * `Result, Error>` - The token direct_purchase_price if successful, or an error. + pub fn fetch_token_direct_purchase_price( + &self, + token_id: [u8; 32], + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + match platform_version + .drive + .methods + .token + .fetch + .token_direct_purchase_price + { + 0 => self.fetch_token_direct_purchase_price_v0(token_id, transaction, platform_version), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "fetch_token_direct_purchase_price".to_string(), + known_versions: vec![0], + received: version, + })), + } + } + + /// Fetches the Token direct_purchase_price with costs (if `apply = true`) and returns associated fee result. + pub fn fetch_token_direct_purchase_price_with_costs( + &self, + token_id: [u8; 32], + block_info: &BlockInfo, + apply: bool, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result<(Option, FeeResult), Error> { + let mut drive_operations: Vec = vec![]; + let value = self.fetch_token_direct_purchase_price_operations( + token_id, + apply, + transaction, + &mut drive_operations, + platform_version, + )?; + + let fees = Drive::calculate_fee( + None, + Some(drive_operations), + &block_info.epoch, + self.config.epochs_per_era, + platform_version, + None, + )?; + + Ok((value, fees)) + } + + /// Creates the operations to get Token's direct_purchase_price from the backing store. + /// If `apply` is false, the operations are stateless and only used for cost estimation. + /// + /// # Arguments + /// + /// * `token_id` - The ID of the token. + /// * `apply` - Whether to fetch actual stateful data (true) or just estimate costs (false). + /// * `transaction` - The current transaction. + /// * `drive_operations` - The drive operations vector to populate. + /// * `platform_version` - The platform version to use. + /// + /// # Returns + /// + /// * `Result, Error>` - The token info of the Identity if successful, or an error. + pub fn fetch_token_direct_purchase_price_operations( + &self, + token_id: [u8; 32], + apply: bool, + transaction: TransactionArg, + drive_operations: &mut Vec, + platform_version: &PlatformVersion, + ) -> Result, Error> { + match platform_version + .drive + .methods + .token + .fetch + .token_direct_purchase_price + { + 0 => self.fetch_token_direct_purchase_price_operations_v0( + token_id, + apply, + transaction, + drive_operations, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "fetch_token_direct_purchase_price_operations".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/v0/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/v0/mod.rs new file mode 100644 index 00000000000..d51a4dc985e --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_token_direct_purchase_price/v0/mod.rs @@ -0,0 +1,70 @@ +use crate::drive::tokens::paths::token_direct_purchase_root_path; +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use crate::util::grove_operations::DirectQueryType; +use crate::util::grove_operations::QueryTarget::QueryTargetValue; +use dpp::serialization::PlatformDeserializable; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use dpp::version::PlatformVersion; +use grovedb::Element::Item; +use grovedb::{TransactionArg, TreeType}; + +impl Drive { + pub(super) fn fetch_token_direct_purchase_price_v0( + &self, + token_id: [u8; 32], + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + self.fetch_token_direct_purchase_price_operations_v0( + token_id, + true, + transaction, + &mut vec![], + platform_version, + ) + } + + pub(super) fn fetch_token_direct_purchase_price_operations_v0( + &self, + token_id: [u8; 32], + apply: bool, + transaction: TransactionArg, + drive_operations: &mut Vec, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let direct_query_type = if apply { + DirectQueryType::StatefulDirectQuery + } else { + DirectQueryType::StatelessDirectQuery { + in_tree_type: TreeType::NormalTree, + query_target: QueryTargetValue(8), + } + }; + + let token_direct_purchase_prices_root_path = token_direct_purchase_root_path(); + + match self.grove_get_raw_optional( + (&token_direct_purchase_prices_root_path).into(), + &token_id, + direct_query_type, + transaction, + drive_operations, + &platform_version.drive, + ) { + Ok(Some(Item(info, _))) => Ok(Some(TokenPricingSchedule::deserialize_from_bytes( + info.as_slice(), + )?)), + + Ok(None) | Err(Error::GroveDB(grovedb::Error::PathKeyNotFound(_))) => Ok(None), + + Ok(Some(_)) => Err(Error::Drive(DriveError::CorruptedElementType( + "token direct_purchase_price was present but was not an item", + ))), + + Err(e) => Err(e), + } + } +} diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs index e42e61cd5bb..762d05d2879 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs @@ -1,2 +1,3 @@ +mod fetch_token_direct_purchase_price; mod queries; mod set_direct_purchase_price; diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/queries.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/queries.rs index 8305f3c3cf4..82b249bb0d5 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/queries.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/queries.rs @@ -1,4 +1,4 @@ -use crate::drive::tokens::paths::token_direct_selling_root_path_vec; +use crate::drive::tokens::paths::token_direct_purchase_root_path_vec; use crate::drive::Drive; use crate::query::Query; use grovedb::{PathQuery, SizedQuery}; @@ -6,7 +6,7 @@ use grovedb::{PathQuery, SizedQuery}; impl Drive { /// The query getting many tokens direct selling price pub fn token_direct_purchase_prices_query(token_ids: &[[u8; 32]]) -> PathQuery { - let tokens_root = token_direct_selling_root_path_vec(); + let tokens_root = token_direct_purchase_root_path_vec(); let mut query = Query::new(); @@ -22,7 +22,7 @@ impl Drive { /// The query getting a token direct selling price pub fn token_direct_purchase_price_query(token_id: [u8; 32]) -> PathQuery { - let tokens_root = token_direct_selling_root_path_vec(); + let tokens_root = token_direct_purchase_root_path_vec(); let mut query = Query::new(); diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs index 3fe986f5304..9c05f3bcd29 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs @@ -1,4 +1,4 @@ -use crate::drive::tokens::paths::token_direct_selling_root_path_vec; +use crate::drive::tokens::paths::token_direct_purchase_root_path_vec; use crate::drive::Drive; use crate::error::Error; use crate::fees::op::LowLevelDriveOperation; @@ -28,7 +28,7 @@ impl Drive { )?; } - let direct_selling_path = token_direct_selling_root_path_vec(); + let direct_selling_path = token_direct_purchase_root_path_vec(); if let Some(price) = price { let serialized_price = diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs index 3415bcc8bc8..00a2ab0979c 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs @@ -5,7 +5,7 @@ use grovedb::EstimatedLayerCount::EstimatedLevel; use grovedb::EstimatedLayerSizes::{AllItems, AllSubtrees}; use grovedb::{EstimatedLayerInformation, TreeType}; -use crate::drive::tokens::paths::{token_direct_selling_root_path, tokens_root_path}; +use crate::drive::tokens::paths::{token_direct_purchase_root_path, tokens_root_path}; use crate::util::type_constants::DEFAULT_HASH_SIZE_U8; use grovedb::EstimatedSumTrees::{NoSumTrees, SomeSumTrees}; use std::collections::HashMap; @@ -89,7 +89,7 @@ impl Drive { ); estimated_costs_only_with_layer_info.insert( - KeyInfoPath::from_known_path(token_direct_selling_root_path()), + KeyInfoPath::from_known_path(token_direct_purchase_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep diff --git a/packages/rs-drive/src/drive/tokens/paths.rs b/packages/rs-drive/src/drive/tokens/paths.rs index aba5aef9942..1bb4bb8c44e 100644 --- a/packages/rs-drive/src/drive/tokens/paths.rs +++ b/packages/rs-drive/src/drive/tokens/paths.rs @@ -88,7 +88,7 @@ pub fn token_balances_root_path_vec() -> Vec> { } /// The root path of token direct selling price tree -pub fn token_direct_selling_root_path() -> [&'static [u8]; 2] { +pub fn token_direct_purchase_root_path() -> [&'static [u8]; 2] { [ Into::<&[u8; 1]>::into(RootTree::Tokens), &[TOKEN_DIRECT_SELL_PRICE_KEY], @@ -96,7 +96,7 @@ pub fn token_direct_selling_root_path() -> [&'static [u8]; 2] { } /// The root path of token direct selling price tree -pub fn token_direct_selling_root_path_vec() -> Vec> { +pub fn token_direct_purchase_root_path_vec() -> Vec> { vec![ vec![RootTree::Tokens as u8], vec![TOKEN_DIRECT_SELL_PRICE_KEY], diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs index 50e54709054..51c92301eb2 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_set_price_for_direct_purchase_transition.rs @@ -52,7 +52,7 @@ impl DriveHighLevelBatchOperationConverter for TokenSetPriceForDirectPurchaseTra .. }) = self.base().store_in_group() { - let event = TokenEvent::SetPriceForDirectPurchase( + let event = TokenEvent::ChangePriceForDirectPurchase( self.price().cloned(), self.public_note().cloned(), ); @@ -87,7 +87,7 @@ impl DriveHighLevelBatchOperationConverter for TokenSetPriceForDirectPurchaseTra token_id: self.token_id(), owner_id, nonce: identity_contract_nonce, - event: TokenEvent::SetPriceForDirectPurchase( + event: TokenEvent::ChangePriceForDirectPurchase( self.price().cloned(), self.public_note_owned(), ), diff --git a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_transition.rs b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_transition.rs index 372240091c0..156608bcf14 100644 --- a/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_transition.rs +++ b/packages/rs-drive/src/state_transition_action/action_convert_to_operations/batch/token/token_transition.rs @@ -129,7 +129,7 @@ impl TokenTransitionAction { ) } TokenTransitionAction::SetPriceForDirectPurchaseAction(set_price_action) => { - TokenEvent::SetPriceForDirectPurchase( + TokenEvent::ChangePriceForDirectPurchase( set_price_action.price().cloned(), set_price_action.public_note().cloned(), ) diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/transformer.rs index 30138f16ecd..110b25e6046 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/transformer.rs @@ -15,57 +15,6 @@ use crate::state_transition_action::batch::BatchedTransitionAction; /// Implement methods to transform a `TokenDirectPurchaseTransition` into a `TokenDirectPurchaseTransitionAction`. impl TokenDirectPurchaseTransitionAction { - /// Transform a `TokenDirectPurchaseTransition` into a `TokenDirectPurchaseTransitionAction` using the provided data contract lookup. - /// - /// # Arguments - /// - /// * `drive` - A reference to the `Drive` instance used for accessing the system. - /// * `owner_id` - The identifier of the owner initiating the direct_purchase transition. - /// * `transaction` - The transaction argument used for state changes. - /// * `value` - A `TokenDirectPurchaseTransition` instance. - /// * `approximate_without_state_for_costs` - A flag indicating whether to approximate state costs without full state. - /// * `drive_operations` - A mutable reference to the vector of low-level operations that need to be performed. - /// * `get_data_contract` - A closure that fetches the `DataContractFetchInfo` given a contract ID. - /// * `platform_version` - The platform version for the context in which the transition is being executed. - /// - /// # Returns - /// - /// * `Result<(ConsensusValidationResult, FeeResult), Error>` - A `TokenDirectPurchaseTransitionAction` if successful, otherwise `ProtocolError`. - #[allow(clippy::too_many_arguments)] - pub fn try_from_token_direct_purchase_transition_with_contract_lookup( - drive: &Drive, - owner_id: Identifier, - value: TokenDirectPurchaseTransition, - approximate_without_state_for_costs: bool, - transaction: TransactionArg, - block_info: &BlockInfo, - user_fee_increase: UserFeeIncrease, - get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, - platform_version: &PlatformVersion, - ) -> Result< - ( - ConsensusValidationResult, - FeeResult, - ), - Error, - > { - match value { - TokenDirectPurchaseTransition::V0(v0) => { - TokenDirectPurchaseTransitionActionV0::try_from_token_direct_purchase_transition_with_contract_lookup( - drive, - owner_id, - v0, - approximate_without_state_for_costs, - transaction, - block_info, - user_fee_increase, - get_data_contract, - platform_version, - ) - } - } - } - /// Transform a borrowed `TokenDirectPurchaseTransition` into a `TokenDirectPurchaseTransitionAction` using the provided data contract lookup. /// /// # Arguments diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs index 26ae2099797..da5fad0b6e5 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs @@ -1,6 +1,9 @@ use std::sync::Arc; use grovedb::TransactionArg; use dpp::block::block_info::BlockInfo; +use dpp::consensus::ConsensusError; +use dpp::consensus::state::state_error::StateError; +use dpp::consensus::state::token::{TokenAmountUnderMinimumSaleAmount, TokenDirectPurchaseUserPriceTooLow, TokenNotForDirectSale}; use dpp::identifier::Identifier; use dpp::state_transition::batch_transition::token_direct_purchase_transition::v0::TokenDirectPurchaseTransitionV0; use dpp::ProtocolError; @@ -9,6 +12,8 @@ use crate::state_transition_action::batch::batched_transition::token_transition: use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::v0::TokenDirectPurchaseTransitionActionV0; use dpp::fee::fee_result::FeeResult; use dpp::prelude::{ConsensusValidationResult, UserFeeIncrease}; +use dpp::state_transition::batch_transition::token_base_transition::v0::v0_methods::TokenBaseTransitionV0Methods; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; use platform_version::version::PlatformVersion; use crate::drive::Drive; use crate::error::Error; @@ -17,111 +22,6 @@ use crate::state_transition_action::batch::BatchedTransitionAction; use crate::state_transition_action::system::bump_identity_data_contract_nonce_action::BumpIdentityDataContractNonceAction; impl TokenDirectPurchaseTransitionActionV0 { - /// Converts a `TokenDirectPurchaseTransitionV0` into a `TokenDirectPurchaseTransitionActionV0` using the provided contract lookup. - /// - /// This method processes the token direct_purchase transition and returns the corresponding transition action - /// while looking up necessary data contracts and applying the relevant logic for direct purchasing. - /// - /// # Arguments - /// - /// * `drive` - A reference to the `Drive` instance which handles data storage and retrieval. - /// * `owner_id` - The identifier of the owner initiating the direct_purchaseing transition. This is typically the identity - /// performing the transaction, such as the user's ID. - /// * `transaction` - A transaction context that includes the necessary state and other details for the transition. - /// * `value` - The `TokenDirectPurchaseTransitionV0` struct containing the transition data, including token amount and recipient. - /// * `approximate_without_state_for_costs` - A flag to determine if costs should be approximated without considering - /// the full state for the operation. Useful for optimizing the transaction cost calculations. - /// * `block_info` - Information about the current block to calculate fees. - /// * `get_data_contract` - A closure function that takes a contract identifier and returns a `DataContractFetchInfo` - /// containing the data contract details, including token configurations. - /// * `platform_version` - A reference to the platform version, ensuring the transition respects version-specific logic. - /// - /// # Returns - /// - /// * `Result, Error>` - Returns the constructed `TokenDirectPurchaseTransitionActionV0` if successful, - /// or an error if any issue arises, such as missing data or an invalid state transition. - #[allow(clippy::too_many_arguments)] - pub fn try_from_token_direct_purchase_transition_with_contract_lookup( - drive: &Drive, - owner_id: Identifier, - value: TokenDirectPurchaseTransitionV0, - approximate_without_state_for_costs: bool, - transaction: TransactionArg, - block_info: &BlockInfo, - user_fee_increase: UserFeeIncrease, - get_data_contract: impl Fn(Identifier) -> Result, ProtocolError>, - platform_version: &PlatformVersion, - ) -> Result< - ( - ConsensusValidationResult, - FeeResult, - ), - Error, - > { - let TokenDirectPurchaseTransitionV0 { - base, - token_count, - total_agreed_price, - } = value; - - let mut drive_operations = vec![]; - - let base_action_validation_result = - TokenBaseTransitionAction::try_from_borrowed_base_transition_with_contract_lookup( - drive, - owner_id, - &base, - approximate_without_state_for_costs, - transaction, - &mut drive_operations, - get_data_contract, - platform_version, - )?; - - let fee_result = Drive::calculate_fee( - None, - Some(drive_operations), - &block_info.epoch, - drive.config.epochs_per_era, - platform_version, - None, - )?; - - let base_action = match base_action_validation_result.is_valid() { - true => base_action_validation_result.into_data()?, - false => { - let bump_action = BumpIdentityDataContractNonceAction::from_token_base_transition( - base, - owner_id, - user_fee_increase, - ); - let batched_action = - BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); - - return Ok(( - ConsensusValidationResult::new_with_data_and_errors( - batched_action, - base_action_validation_result.errors, - ), - fee_result, - )); - } - }; - - Ok(( - BatchedTransitionAction::TokenAction(TokenTransitionAction::DirectPurchaseAction( - TokenDirectPurchaseTransitionActionV0 { - base: base_action, - token_count, - total_agreed_price, - } - .into(), - )) - .into(), - fee_result, - )) - } - /// Converts a borrowed `TokenDirectPurchaseTransitionV0` into a `TokenDirectPurchaseTransitionActionV0` using the provided contract lookup. /// /// This method processes the token direct_purchaseing transition and constructs the corresponding transition action while @@ -187,7 +87,7 @@ impl TokenDirectPurchaseTransitionActionV0 { platform_version, )?; - let fee_result = Drive::calculate_fee( + let mut fee_result = Drive::calculate_fee( None, Some(drive_operations), &block_info.epoch, @@ -218,12 +118,146 @@ impl TokenDirectPurchaseTransitionActionV0 { } }; + // We need to make sure the amount we want to pay is the amount we are expected to pay + + let (pricing_schedule, fetch_token_direct_purchase_fee) = drive + .fetch_token_direct_purchase_price_with_costs( + base.token_id().to_buffer(), + block_info, + true, + transaction, + platform_version, + )?; + + fee_result.checked_add_assign(fetch_token_direct_purchase_fee)?; + + let Some(pricing_schedule) = pricing_schedule else { + let bump_action = + BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( + base, + owner_id, + user_fee_increase, + ); + let batched_action = + BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); + + return Ok(( + ConsensusValidationResult::new_with_data_and_errors( + batched_action, + vec![ConsensusError::StateError( + StateError::TokenNotForDirectSale(TokenNotForDirectSale::new( + base.token_id(), + )), + )], + ), + fee_result, + )); + }; + + let required_price = match pricing_schedule { + TokenPricingSchedule::SinglePrice(price_per_token) => { + // We've already checked the user set price in structure validation + // Hence we can do a saturating mul. + let required_price = price_per_token.saturating_mul(*token_count); + if *total_agreed_price < required_price { + let bump_action = + BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( + base, + owner_id, + user_fee_increase, + ); + let batched_action = + BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); + + return Ok(( + ConsensusValidationResult::new_with_data_and_errors( + batched_action, + vec![ConsensusError::StateError( + StateError::TokenDirectPurchaseUserPriceTooLow( + TokenDirectPurchaseUserPriceTooLow::new( + base.token_id(), + *total_agreed_price, + required_price, + ), + ), + )], + ), + fee_result, + )); + } + required_price + } + TokenPricingSchedule::SetPrices(set_prices) => { + match set_prices.range(..=token_count).next_back() { + Some((_matched_quantity, matched_price)) => { + // Use matched_quantity and matched_price to compute required cost + let required_total = *matched_price * token_count; + + if *total_agreed_price < required_total { + let bump_action = + BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( + base, + owner_id, + user_fee_increase, + ); + let batched_action = + BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); + + return Ok(( + ConsensusValidationResult::new_with_data_and_errors( + batched_action, + vec![ConsensusError::StateError( + StateError::TokenDirectPurchaseUserPriceTooLow( + TokenDirectPurchaseUserPriceTooLow::new( + base.token_id(), + *total_agreed_price, + required_total, + ), + ), + )], + ), + fee_result, + )); + } + required_total + } + None => { + // Token count is below all defined thresholds — this is an invalid purchase + let bump_action = + BumpIdentityDataContractNonceAction::from_borrowed_token_base_transition( + base, + owner_id, + user_fee_increase, + ); + let batched_action = + BatchedTransitionAction::BumpIdentityDataContractNonce(bump_action); + + return Ok(( + ConsensusValidationResult::new_with_data_and_errors( + batched_action, + vec![ConsensusError::StateError( + StateError::TokenAmountUnderMinimumSaleAmount( + TokenAmountUnderMinimumSaleAmount::new( + base.token_id(), + *token_count, + *set_prices.keys().next().expect("Map is not empty"), + ), + ), + )], + ), + fee_result, + )); + } + } + } + }; + Ok(( BatchedTransitionAction::TokenAction(TokenTransitionAction::DirectPurchaseAction( TokenDirectPurchaseTransitionActionV0 { base: base_action, token_count: *token_count, - total_agreed_price: *total_agreed_price, + total_agreed_price: required_price, } .into(), )) diff --git a/packages/rs-drive/src/state_transition_action/batch/v0/mod.rs b/packages/rs-drive/src/state_transition_action/batch/v0/mod.rs index 380fba6af73..83b4928e4b8 100644 --- a/packages/rs-drive/src/state_transition_action/batch/v0/mod.rs +++ b/packages/rs-drive/src/state_transition_action/batch/v0/mod.rs @@ -6,6 +6,8 @@ use dpp::ProtocolError; use crate::state_transition_action::batch::batched_transition::BatchedTransitionAction; use crate::state_transition_action::batch::batched_transition::document_transition::document_create_transition_action::DocumentCreateTransitionActionAccessorsV0; use crate::state_transition_action::batch::batched_transition::document_transition::document_purchase_transition_action::DocumentPurchaseTransitionActionAccessorsV0; +use crate::state_transition_action::batch::batched_transition::token_transition::token_direct_purchase_transition_action::TokenDirectPurchaseTransitionActionAccessorsV0; +use crate::state_transition_action::batch::batched_transition::token_transition::TokenTransitionAction; /// action v0 #[derive(Default, Debug, Clone)] @@ -37,8 +39,11 @@ impl BatchTransitionActionV0 { .iter() .filter_map(|transition| match transition { BatchedTransitionAction::DocumentAction( - DocumentTransitionAction::PurchaseAction(purchase), - ) => Some(purchase.price()), + DocumentTransitionAction::PurchaseAction(document_purchase), + ) => Some(document_purchase.price()), + BatchedTransitionAction::TokenAction( + TokenTransitionAction::DirectPurchaseAction(token_purchase), + ) => Some(token_purchase.total_agreed_price()), _ => None, }) .fold((None, false), |(acc, _), price| match acc { diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/mod.rs index d6489b93774..db20e4365c3 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/mod.rs @@ -34,6 +34,7 @@ pub struct DriveTokenFetchMethodVersions { pub pre_programmed_distributions: FeatureVersion, pub perpetual_distribution_last_paid_time: FeatureVersion, pub pre_programmed_distribution_last_paid_time: FeatureVersion, + pub token_direct_purchase_price: FeatureVersion, } #[derive(Clone, Debug, Default)] diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/v1.rs index e18655ffc3f..257fb1eedce 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/v1.rs @@ -18,6 +18,7 @@ pub const DRIVE_TOKEN_METHOD_VERSIONS_V1: DriveTokenMethodVersions = DriveTokenM pre_programmed_distributions: 0, perpetual_distribution_last_paid_time: 0, pre_programmed_distribution_last_paid_time: 0, + token_direct_purchase_price: 0, }, prove: DriveTokenProveMethodVersions { identity_token_balance: 0, From 57097206699c761728855c8b10fd389ca9bf5b83 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Apr 2025 19:23:57 +0700 Subject: [PATCH 07/32] wasm fixes --- .../token_transition/direct_purchase.rs | 12 ++++++++++++ .../batch_transition/token_transition/mod.rs | 16 ++++++++++++++++ .../set_price_for_direct_purchase.rs | 14 ++++++++++++++ .../src/errors/consensus/consensus_error.rs | 11 ++++++++++- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/direct_purchase.rs create mode 100644 packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/set_price_for_direct_purchase.rs diff --git a/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/direct_purchase.rs b/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/direct_purchase.rs new file mode 100644 index 00000000000..a1c87142cca --- /dev/null +++ b/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/direct_purchase.rs @@ -0,0 +1,12 @@ +use dpp::state_transition::batch_transition::TokenDirectPurchaseTransition; +use wasm_bindgen::prelude::wasm_bindgen; + +#[wasm_bindgen(js_name=TokenDirectPurchaseTransition)] +#[derive(Debug, Clone)] +pub struct TokenDirectPurchaseTransitionWasm(TokenDirectPurchaseTransition); + +impl From for TokenDirectPurchaseTransitionWasm { + fn from(value: TokenDirectPurchaseTransition) -> Self { + Self(value) + } +} diff --git a/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/mod.rs b/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/mod.rs index 15e9a4a52e5..16659a63dde 100644 --- a/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/mod.rs +++ b/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/mod.rs @@ -2,9 +2,11 @@ pub mod burn; mod claim; pub mod config; pub mod destroy; +pub mod direct_purchase; pub mod emergency_action; pub mod freeze; pub mod mint; +pub mod set_price_for_direct_purchase; pub mod transfer; pub mod unfreeze; @@ -12,9 +14,11 @@ use crate::batch_transition::token_transition::burn::TokenBurnTransitionWasm; use crate::batch_transition::token_transition::claim::TokenClaimTransitionWasm; use crate::batch_transition::token_transition::config::TokenConfigUpdateTransitionWasm; use crate::batch_transition::token_transition::destroy::TokenDestroyFrozenFundsTransitionWasm; +use crate::batch_transition::token_transition::direct_purchase::TokenDirectPurchaseTransitionWasm; use crate::batch_transition::token_transition::emergency_action::TokenEmergencyActionTransitionWasm; use crate::batch_transition::token_transition::freeze::TokenFreezeTransitionWasm; use crate::batch_transition::token_transition::mint::TokenMintTransitionWasm; +use crate::batch_transition::token_transition::set_price_for_direct_purchase::TokenSetPriceForDirectPurchaseTransitionWasm; use crate::batch_transition::token_transition::transfer::TokenTransferTransitionWasm; use crate::batch_transition::token_transition::unfreeze::TokenUnfreezeTransitionWasm; use crate::identifier::IdentifierWrapper; @@ -38,6 +42,8 @@ pub enum TokenTransitionType { Claim, EmergencyAction, ConfigUpdate, + DirectPurchase, + SetPriceForDirectPurchase, } impl From<&TokenTransition> for TokenTransitionType { @@ -52,6 +58,10 @@ impl From<&TokenTransition> for TokenTransitionType { TokenTransition::EmergencyAction(_) => TokenTransitionType::EmergencyAction, TokenTransition::ConfigUpdate(_) => TokenTransitionType::ConfigUpdate, TokenTransition::Claim(_) => TokenTransitionType::Claim, + TokenTransition::DirectPurchase(_) => TokenTransitionType::DirectPurchase, + TokenTransition::SetPriceForDirectPurchase(_) => { + TokenTransitionType::SetPriceForDirectPurchase + } } } } @@ -133,6 +143,12 @@ impl TokenTransitionWasm { TokenConfigUpdateTransitionWasm::from(config_update.clone()).into() } TokenTransition::Claim(claim) => TokenClaimTransitionWasm::from(claim.clone()).into(), + TokenTransition::DirectPurchase(direct_purchase) => { + TokenDirectPurchaseTransitionWasm::from(direct_purchase.clone()).into() + } + TokenTransition::SetPriceForDirectPurchase(set_price) => { + TokenSetPriceForDirectPurchaseTransitionWasm::from(set_price.clone()).into() + } } } } diff --git a/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/set_price_for_direct_purchase.rs b/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/set_price_for_direct_purchase.rs new file mode 100644 index 00000000000..20652e70bc7 --- /dev/null +++ b/packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition/set_price_for_direct_purchase.rs @@ -0,0 +1,14 @@ +use dpp::state_transition::batch_transition::TokenSetPriceForDirectPurchaseTransition; +use wasm_bindgen::prelude::wasm_bindgen; + +#[wasm_bindgen(js_name=TokenSetPriceForDirectPurchaseTransition)] +#[derive(Debug, Clone)] +pub struct TokenSetPriceForDirectPurchaseTransitionWasm(TokenSetPriceForDirectPurchaseTransition); + +impl From + for TokenSetPriceForDirectPurchaseTransitionWasm +{ + fn from(value: TokenSetPriceForDirectPurchaseTransition) -> Self { + Self(value) + } +} diff --git a/packages/wasm-dpp/src/errors/consensus/consensus_error.rs b/packages/wasm-dpp/src/errors/consensus/consensus_error.rs index 33d3d1b2d13..85adcc177da 100644 --- a/packages/wasm-dpp/src/errors/consensus/consensus_error.rs +++ b/packages/wasm-dpp/src/errors/consensus/consensus_error.rs @@ -84,7 +84,7 @@ use dpp::consensus::state::identity::no_transfer_key_for_core_withdrawal_availab use dpp::consensus::state::identity::RecipientIdentityDoesNotExistError; use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_insufficient_error::PrefundedSpecializedBalanceInsufficientError; use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_not_found_error::PrefundedSpecializedBalanceNotFoundError; -use dpp::consensus::state::token::{IdentityDoesNotHaveEnoughTokenBalanceError, IdentityTokenAccountNotFrozenError, IdentityTokenAccountFrozenError, TokenIsPausedError, IdentityTokenAccountAlreadyFrozenError, UnauthorizedTokenActionError, TokenSettingMaxSupplyToLessThanCurrentSupplyError, TokenMintPastMaxSupplyError, NewTokensDestinationIdentityDoesNotExistError, NewAuthorizedActionTakerIdentityDoesNotExistError, NewAuthorizedActionTakerGroupDoesNotExistError, NewAuthorizedActionTakerMainGroupNotSetError, InvalidGroupPositionError, TokenAlreadyPausedError, TokenNotPausedError, InvalidTokenClaimPropertyMismatch, InvalidTokenClaimNoCurrentRewards, InvalidTokenClaimWrongClaimant, TokenTransferRecipientIdentityNotExistError, PreProgrammedDistributionTimestampInPastError, IdentityHasNotAgreedToPayRequiredTokenAmountError, RequiredTokenPaymentInfoNotSetError, IdentityTryingToPayWithWrongTokenError}; +use dpp::consensus::state::token::{IdentityDoesNotHaveEnoughTokenBalanceError, IdentityTokenAccountNotFrozenError, IdentityTokenAccountFrozenError, TokenIsPausedError, IdentityTokenAccountAlreadyFrozenError, UnauthorizedTokenActionError, TokenSettingMaxSupplyToLessThanCurrentSupplyError, TokenMintPastMaxSupplyError, NewTokensDestinationIdentityDoesNotExistError, NewAuthorizedActionTakerIdentityDoesNotExistError, NewAuthorizedActionTakerGroupDoesNotExistError, NewAuthorizedActionTakerMainGroupNotSetError, InvalidGroupPositionError, TokenAlreadyPausedError, TokenNotPausedError, InvalidTokenClaimPropertyMismatch, InvalidTokenClaimNoCurrentRewards, InvalidTokenClaimWrongClaimant, TokenTransferRecipientIdentityNotExistError, PreProgrammedDistributionTimestampInPastError, IdentityHasNotAgreedToPayRequiredTokenAmountError, RequiredTokenPaymentInfoNotSetError, IdentityTryingToPayWithWrongTokenError, TokenDirectPurchaseUserPriceTooLow, TokenAmountUnderMinimumSaleAmount, TokenNotForDirectSale}; use dpp::consensus::state::voting::masternode_incorrect_voter_identity_id_error::MasternodeIncorrectVoterIdentityIdError; use dpp::consensus::state::voting::masternode_incorrect_voting_address_error::MasternodeIncorrectVotingAddressError; use dpp::consensus::state::voting::masternode_not_found_error::MasternodeNotFoundError; @@ -399,6 +399,15 @@ pub fn from_state_error(state_error: &StateError) -> JsValue { StateError::IdentityTryingToPayWithWrongTokenError(e) => { generic_consensus_error!(IdentityTryingToPayWithWrongTokenError, e).into() } + StateError::TokenDirectPurchaseUserPriceTooLow(e) => { + generic_consensus_error!(TokenDirectPurchaseUserPriceTooLow, e).into() + } + StateError::TokenAmountUnderMinimumSaleAmount(e) => { + generic_consensus_error!(TokenAmountUnderMinimumSaleAmount, e).into() + } + StateError::TokenNotForDirectSale(e) => { + generic_consensus_error!(TokenNotForDirectSale, e).into() + } } } From 771229df5bf1c98455c90487e4c472a6a6f4a2f8 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Apr 2025 19:27:45 +0700 Subject: [PATCH 08/32] another add --- packages/rs-drive/src/verify/tokens/mod.rs | 1 + .../verify_token_direct_selling_prices/mod.rs | 69 +++++++++++++++++++ .../v0/mod.rs | 65 +++++++++++++++++ .../drive_verify_method_versions/mod.rs | 1 + 4 files changed, 136 insertions(+) create mode 100644 packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/mod.rs create mode 100644 packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/v0/mod.rs diff --git a/packages/rs-drive/src/verify/tokens/mod.rs b/packages/rs-drive/src/verify/tokens/mod.rs index 125832d8966..81a5095c09f 100644 --- a/packages/rs-drive/src/verify/tokens/mod.rs +++ b/packages/rs-drive/src/verify/tokens/mod.rs @@ -2,6 +2,7 @@ mod verify_token_balance_for_identity_id; mod verify_token_balances_for_identity_id; mod verify_token_balances_for_identity_ids; mod verify_token_direct_selling_price; +mod verify_token_direct_selling_prices; mod verify_token_info_for_identity_id; mod verify_token_infos_for_identity_id; mod verify_token_infos_for_identity_ids; diff --git a/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/mod.rs b/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/mod.rs new file mode 100644 index 00000000000..bebfb9286bd --- /dev/null +++ b/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/mod.rs @@ -0,0 +1,69 @@ +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; + +use crate::verify::RootHash; + +use dpp::version::PlatformVersion; + +impl Drive { + /// Verifies the direct_selling_prices of multiple tokens using a cryptographic proof. + /// + /// This method validates the cryptographic proof to retrieve the direct_selling_prices of the specified token IDs. + /// It dispatches to version-specific implementations based on the provided platform version. + /// + /// # Parameters + /// - `proof`: The cryptographic proof to verify. + /// - `token_ids`: A list of token IDs to verify (each a 32-byte array). + /// - `verify_subset_of_proof`: Whether to verify only a subset of the proof. + /// - `platform_version`: The current platform version. + /// + /// # Returns + /// - `Ok((RootHash, T))`: + /// - `RootHash`: The verified root hash of the database. + /// - `T`: A collection of `(token ID, token pricing schedule)` pairs. + /// + /// # Errors + /// - `Error::Drive(DriveError::UnknownVersionMismatch)`: + /// - Occurs when the platform version does not match any known version for this method. + /// - `Error::Proof(ProofError::WrongElementCount)`: + /// - If the number of elements in the proof does not match the number of token IDs. + /// - `Error::Proof(ProofError::IncorrectValueSize)`: + /// - If the token ID size or proof value size is invalid. + /// - `Error::Proof(ProofError::DeserializationFailed)`: + /// - If the token status cannot be deserialized from the proof. + /// - `Error::Proof(ProofError::InvalidItemType)`: + /// - If the proof element is not an expected item type (e.g., `Item`). + pub fn verify_token_direct_selling_prices< + T: FromIterator<(I, Option)>, + I: From<[u8; 32]>, + >( + proof: &[u8], + token_ids: &[[u8; 32]], + verify_subset_of_proof: bool, + platform_version: &PlatformVersion, + ) -> Result<(RootHash, T), Error> { + match platform_version + .drive + .methods + .verify + .token + .verify_token_direct_selling_prices + { + 0 => Self::verify_token_direct_selling_prices_v0( + proof, + token_ids, + verify_subset_of_proof, + platform_version, + ), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "verify_token_direct_selling_prices".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/v0/mod.rs b/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/v0/mod.rs new file mode 100644 index 00000000000..174038c6da7 --- /dev/null +++ b/packages/rs-drive/src/verify/tokens/verify_token_direct_selling_prices/v0/mod.rs @@ -0,0 +1,65 @@ +use crate::drive::Drive; +use grovedb::Element::Item; + +use crate::error::proof::ProofError; +use crate::error::Error; + +use crate::verify::RootHash; + +use dpp::serialization::PlatformDeserializable; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use grovedb::GroveDb; +use platform_version::version::PlatformVersion; + +impl Drive { + pub(super) fn verify_token_direct_selling_prices_v0< + T: FromIterator<(I, Option)>, + I: From<[u8; 32]>, + >( + proof: &[u8], + token_ids: &[[u8; 32]], + verify_subset_of_proof: bool, + platform_version: &PlatformVersion, + ) -> Result<(RootHash, T), Error> { + let path_query = Self::token_direct_purchase_prices_query(token_ids); + let (root_hash, proved_key_values) = if verify_subset_of_proof { + GroveDb::verify_subset_query_with_absence_proof( + proof, + &path_query, + &platform_version.drive.grove_version, + )? + } else { + GroveDb::verify_query_with_absence_proof( + proof, + &path_query, + &platform_version.drive.grove_version, + )? + }; + if proved_key_values.len() == token_ids.len() { + let values = proved_key_values + .into_iter() + .map(|proved_key_value| { + let token_id: [u8; 32] = proved_key_value.1.try_into().map_err(|_| { + Error::Proof(ProofError::IncorrectValueSize("token id size")) + })?; + match proved_key_value.2 { + Some(Item(value, ..)) => Ok(( + token_id.into(), + Some(TokenPricingSchedule::deserialize_from_bytes(&value)?), + )), + None => Ok((token_id.into(), None)), + _ => Err(Error::Proof(ProofError::IncorrectValueSize( + "proof did not point to an item as expected for token info", + ))), + } + }) + .collect::>()?; + Ok((root_hash, values)) + } else { + Err(Error::Proof(ProofError::WrongElementCount { + expected: token_ids.len(), + got: proved_key_values.len(), + })) + } + } +} diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs index ff205690c2f..9f41792d6fc 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/mod.rs @@ -65,6 +65,7 @@ pub struct DriveVerifyTokenMethodVersions { pub verify_token_status: FeatureVersion, pub verify_token_pre_programmed_distributions: FeatureVersion, pub verify_token_direct_selling_price: FeatureVersion, + pub verify_token_direct_selling_prices: FeatureVersion, } #[derive(Clone, Debug, Default)] From 7085951eb56951c7af91003f5680e9b8db68db64 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Apr 2025 19:29:47 +0700 Subject: [PATCH 09/32] another add --- .../version/drive_versions/drive_verify_method_versions/v1.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs index 29e1a891bca..aa132651b95 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v1.rs @@ -47,6 +47,7 @@ pub const DRIVE_VERIFY_METHOD_VERSIONS_V1: DriveVerifyMethodVersions = DriveVeri verify_token_status: 0, verify_token_pre_programmed_distributions: 0, verify_token_direct_selling_price: 0, + verify_token_direct_selling_prices: 0, }, single_document: DriveVerifySingleDocumentMethodVersions { verify_proof: 0, From f27f4a1548c11e8a93af878c98cc5a42682f4355 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Thu, 10 Apr 2025 10:17:17 +0700 Subject: [PATCH 10/32] added a new token direct purchase transition --- .../document/batch_transition/methods/v1/mod.rs | 1 + .../document/batch_transition/v1/v0_methods.rs | 1 + packages/rs-dpp/src/tokens/token_event.rs | 14 +++++--------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs index c9695e9c724..5ed96fb8214 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs @@ -234,6 +234,7 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 ) -> Result; #[cfg(feature = "state-transition-signing")] + #[allow(clippy::too_many_arguments)] fn new_token_direct_purchase_transition( token_id: Identifier, owner_id: Identifier, diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs index 25ef97e895e..54316f7412d 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs @@ -1090,6 +1090,7 @@ impl DocumentsBatchTransitionMethodsV1 for BatchTransitionV1 { Ok(state_transition) } + #[cfg(feature = "state-transition-signing")] fn new_token_change_direct_purchase_price_transition( token_id: Identifier, owner_id: Identifier, diff --git a/packages/rs-dpp/src/tokens/token_event.rs b/packages/rs-dpp/src/tokens/token_event.rs index ed3d9bfa840..3ca925cf231 100644 --- a/packages/rs-dpp/src/tokens/token_event.rs +++ b/packages/rs-dpp/src/tokens/token_event.rs @@ -271,15 +271,11 @@ impl TokenEvent { properties } - TokenEvent::DirectPurchase(amount, total_cost) => { - let properties = BTreeMap::from([ - ("tokenId".to_string(), token_id.into()), - ("tokenAmount".to_string(), amount.into()), - ("purchaseCost".to_string(), total_cost.into()), - ]); - - properties - } + TokenEvent::DirectPurchase(amount, total_cost) => BTreeMap::from([ + ("tokenId".to_string(), token_id.into()), + ("tokenAmount".to_string(), amount.into()), + ("purchaseCost".to_string(), total_cost.into()), + ]), }; let document: Document = DocumentV0 { From 10df859030ac9004223ccda552e0451d7733c028 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Thu, 10 Apr 2025 11:11:32 +0700 Subject: [PATCH 11/32] clippy fixes --- packages/rs-drive-abci/src/query/service.rs | 2 +- .../tests/strategy_tests/voting_tests.rs | 678 +++++++++--------- .../v0/transformer.rs | 2 +- .../v0/transformer.rs | 2 +- 4 files changed, 355 insertions(+), 329 deletions(-) diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 178d2409a81..ab3d299caa5 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -752,7 +752,7 @@ impl PlatformService for QueryService { async fn get_token_direct_purchase_prices( &self, - request: Request, + _request: Request, ) -> Result, Status> { todo!() } diff --git a/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs index 08c4b833bf1..6b55d7532d3 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs @@ -1303,342 +1303,363 @@ mod tests { #[test] fn run_chain_with_voting_after_won_by_identity_no_specialized_funds_distribution() { - // In this test we try to insert two state transitions with the same unique index - // We use the DPNS contract, and we insert two documents both with the same "name" - // This is a common scenario we should see quite often - let config = PlatformConfig { - testing_configs: PlatformTestConfig::default_minimal_verifications(), - chain_lock: ChainLockConfig::default_100_67(), - instant_lock: InstantLockConfig::default_100_67(), - execution: ExecutionConfig { - //we disable document triggers because we are using dpns and dpns needs a preorder - use_document_triggers: false, + // Define the desired stack size + let stack_size = 4 * 1024 * 1024; //Let's set the stack size to be higher than the default 2MB - ..Default::default() - }, - block_spacing_ms: 3000, - ..Default::default() - }; - let mut platform = TestPlatformBuilder::new() - .with_config(config.clone()) - .with_initial_protocol_version(7) - .build_with_mock_rpc(); + let builder = std::thread::Builder::new() + .stack_size(stack_size) + .name("custom_stack_size_thread".into()); - let platform_version = PlatformVersion::get(7).unwrap(); + let handler = builder + .spawn(|| { + // In this test we try to insert two state transitions with the same unique index + // We use the DPNS contract, and we insert two documents both with the same "name" + // This is a common scenario we should see quite often + let config = PlatformConfig { + testing_configs: PlatformTestConfig::default_minimal_verifications(), + chain_lock: ChainLockConfig::default_100_67(), + instant_lock: InstantLockConfig::default_100_67(), + execution: ExecutionConfig { + //we disable document triggers because we are using dpns and dpns needs a preorder + use_document_triggers: false, - let mut rng = StdRng::seed_from_u64(567); + ..Default::default() + }, + block_spacing_ms: 3000, + ..Default::default() + }; + let mut platform = TestPlatformBuilder::new() + .with_config(config.clone()) + .with_initial_protocol_version(7) + .build_with_mock_rpc(); - let mut simple_signer = SimpleSigner::default(); + let platform_version = PlatformVersion::get(7).unwrap(); - let (mut identity1, keys1) = Identity::random_identity_with_main_keys_with_private_key::< - Vec<_>, - >(2, &mut rng, platform_version) - .unwrap(); + let mut rng = StdRng::seed_from_u64(567); - simple_signer.add_keys(keys1); + let mut simple_signer = SimpleSigner::default(); - let (mut identity2, keys2) = Identity::random_identity_with_main_keys_with_private_key::< - Vec<_>, - >(2, &mut rng, platform_version) - .unwrap(); + let (mut identity1, keys1) = + Identity::random_identity_with_main_keys_with_private_key::>( + 2, + &mut rng, + platform_version, + ) + .unwrap(); - simple_signer.add_keys(keys2); + simple_signer.add_keys(keys1); - let start_identities: Vec<(Identity, Option)> = - create_state_transitions_for_identities( - vec![&mut identity1, &mut identity2], - &(dash_to_duffs!(1)..=dash_to_duffs!(1)), - &simple_signer, - &mut rng, - platform_version, - ) - .into_iter() - .map(|(identity, transition)| (identity, Some(transition))) - .collect(); + let (mut identity2, keys2) = + Identity::random_identity_with_main_keys_with_private_key::>( + 2, + &mut rng, + platform_version, + ) + .unwrap(); - let dpns_contract = platform - .drive - .cache - .system_data_contracts - .load_dpns() - .as_ref() - .clone(); + simple_signer.add_keys(keys2); - let document_type = dpns_contract - .document_type_for_name("domain") - .expect("expected a profile document type") - .to_owned_document_type(); + let start_identities: Vec<(Identity, Option)> = + create_state_transitions_for_identities( + vec![&mut identity1, &mut identity2], + &(dash_to_duffs!(1)..=dash_to_duffs!(1)), + &simple_signer, + &mut rng, + platform_version, + ) + .into_iter() + .map(|(identity, transition)| (identity, Some(transition))) + .collect(); - let identity1_id = start_identities.first().unwrap().0.id(); - let identity2_id = start_identities.last().unwrap().0.id(); - let document_op_1 = DocumentOp { - contract: dpns_contract.clone(), - action: DocumentAction::DocumentActionInsertSpecific( - BTreeMap::from([ - ("label".into(), "quantum".into()), - ("normalizedLabel".into(), "quantum".into()), - ("normalizedParentDomainName".into(), "dash".into()), - ( - "records".into(), - BTreeMap::from([("identity", Value::from(identity1_id))]).into(), + let dpns_contract = platform + .drive + .cache + .system_data_contracts + .load_dpns() + .as_ref() + .clone(); + + let document_type = dpns_contract + .document_type_for_name("domain") + .expect("expected a profile document type") + .to_owned_document_type(); + + let identity1_id = start_identities.first().unwrap().0.id(); + let identity2_id = start_identities.last().unwrap().0.id(); + let document_op_1 = DocumentOp { + contract: dpns_contract.clone(), + action: DocumentAction::DocumentActionInsertSpecific( + BTreeMap::from([ + ("label".into(), "quantum".into()), + ("normalizedLabel".into(), "quantum".into()), + ("normalizedParentDomainName".into(), "dash".into()), + ( + "records".into(), + BTreeMap::from([("identity", Value::from(identity1_id))]).into(), + ), + ]), + Some(start_identities.first().unwrap().0.id()), + DocumentFieldFillType::FillIfNotRequired, + DocumentFieldFillSize::AnyDocumentFillSize, ), - ]), - Some(start_identities.first().unwrap().0.id()), - DocumentFieldFillType::FillIfNotRequired, - DocumentFieldFillSize::AnyDocumentFillSize, - ), - document_type: document_type.clone(), - }; + document_type: document_type.clone(), + }; - let document_op_2 = DocumentOp { - contract: dpns_contract.clone(), - action: DocumentAction::DocumentActionInsertSpecific( - BTreeMap::from([ - ("label".into(), "quantum".into()), - ("normalizedLabel".into(), "quantum".into()), - ("normalizedParentDomainName".into(), "dash".into()), - ( - "records".into(), - BTreeMap::from([( - "identity", - Value::from(start_identities.last().unwrap().0.id()), - )]) - .into(), + let document_op_2 = DocumentOp { + contract: dpns_contract.clone(), + action: DocumentAction::DocumentActionInsertSpecific( + BTreeMap::from([ + ("label".into(), "quantum".into()), + ("normalizedLabel".into(), "quantum".into()), + ("normalizedParentDomainName".into(), "dash".into()), + ( + "records".into(), + BTreeMap::from([( + "identity", + Value::from(start_identities.last().unwrap().0.id()), + )]) + .into(), + ), + ]), + Some(start_identities.last().unwrap().0.id()), + DocumentFieldFillType::FillIfNotRequired, + DocumentFieldFillSize::AnyDocumentFillSize, ), - ]), - Some(start_identities.last().unwrap().0.id()), - DocumentFieldFillType::FillIfNotRequired, - DocumentFieldFillSize::AnyDocumentFillSize, - ), - document_type: document_type.clone(), - }; + document_type: document_type.clone(), + }; - let strategy = NetworkStrategy { - strategy: Strategy { - start_contracts: vec![], - operations: vec![ - Operation { - op_type: OperationType::Document(document_op_1), - frequency: Frequency { - times_per_block_range: 1..2, - chance_per_block: None, - }, - }, - Operation { - op_type: OperationType::Document(document_op_2), - frequency: Frequency { - times_per_block_range: 1..2, - chance_per_block: None, + let strategy = NetworkStrategy { + strategy: Strategy { + start_contracts: vec![], + operations: vec![ + Operation { + op_type: OperationType::Document(document_op_1), + frequency: Frequency { + times_per_block_range: 1..2, + chance_per_block: None, + }, + }, + Operation { + op_type: OperationType::Document(document_op_2), + frequency: Frequency { + times_per_block_range: 1..2, + chance_per_block: None, + }, + }, + ], + start_identities: StartIdentities { + hard_coded: start_identities, + ..Default::default() }, + identity_inserts: Default::default(), + + identity_contract_nonce_gaps: None, + signer: Some(simple_signer), }, - ], - start_identities: StartIdentities { - hard_coded: start_identities, - ..Default::default() - }, - identity_inserts: Default::default(), + total_hpmns: 100, + extra_normal_mns: 0, + validator_quorum_count: 24, + chain_lock_quorum_count: 24, + upgrading_info: None, - identity_contract_nonce_gaps: None, - signer: Some(simple_signer), - }, - total_hpmns: 100, - extra_normal_mns: 0, - validator_quorum_count: 24, - chain_lock_quorum_count: 24, - upgrading_info: None, + proposer_strategy: Default::default(), + rotate_quorums: false, + failure_testing: None, + query_testing: None, + verify_state_transition_results: true, + ..Default::default() + }; - proposer_strategy: Default::default(), - rotate_quorums: false, - failure_testing: None, - query_testing: None, - verify_state_transition_results: true, - ..Default::default() - }; + let mut voting_signer = Some(SimpleSigner::default()); - let mut voting_signer = Some(SimpleSigner::default()); + // On the first block we only have identities and contracts + let ChainExecutionOutcome { + abci_app, + proposers, + validator_quorums, + current_validator_quorum_hash, + instant_lock_quorums, + current_proposer_versions, + end_time_ms, + identity_nonce_counter, + identity_contract_nonce_counter, + state_transition_results_per_block, + .. + } = run_chain_for_strategy( + &mut platform, + 2, + strategy.clone(), + config.clone(), + 15, + &mut voting_signer, + ); - // On the first block we only have identities and contracts - let ChainExecutionOutcome { - abci_app, - proposers, - validator_quorums, - current_validator_quorum_hash, - instant_lock_quorums, - current_proposer_versions, - end_time_ms, - identity_nonce_counter, - identity_contract_nonce_counter, - state_transition_results_per_block, - .. - } = run_chain_for_strategy( - &mut platform, - 2, - strategy.clone(), - config.clone(), - 15, - &mut voting_signer, - ); + let platform = abci_app.platform; - let platform = abci_app.platform; + let platform_state = platform.state.load(); - let platform_state = platform.state.load(); + let state_transitions_block_2 = state_transition_results_per_block + .get(&2) + .expect("expected to get block 2"); - let state_transitions_block_2 = state_transition_results_per_block - .get(&2) - .expect("expected to get block 2"); + let first_document_insert_result = &state_transitions_block_2 + .first() + .as_ref() + .expect("expected a document insert") + .1; + assert_eq!(first_document_insert_result.code, 0); - let first_document_insert_result = &state_transitions_block_2 - .first() - .as_ref() - .expect("expected a document insert") - .1; - assert_eq!(first_document_insert_result.code, 0); + let second_document_insert_result = &state_transitions_block_2 + .get(1) + .as_ref() + .expect("expected a document insert") + .1; - let second_document_insert_result = &state_transitions_block_2 - .get(1) - .as_ref() - .expect("expected a document insert") - .1; + assert_eq!(second_document_insert_result.code, 0); // we expect the second to also be insertable as they are both contested - assert_eq!(second_document_insert_result.code, 0); // we expect the second to also be insertable as they are both contested + let block_start = platform_state + .last_committed_block_info() + .as_ref() + .unwrap() + .basic_info() + .height + + 1; + let day_in_ms = 1000 * 60 * 60 * 24; + let config = PlatformConfig { + chain_lock: ChainLockConfig::default_100_67(), + instant_lock: InstantLockConfig::default_100_67(), + execution: ExecutionConfig { + //we disable document triggers because we are using dpns and dpns needs a preorder + use_document_triggers: false, - let block_start = platform_state - .last_committed_block_info() - .as_ref() - .unwrap() - .basic_info() - .height - + 1; - let day_in_ms = 1000 * 60 * 60 * 24; - let config = PlatformConfig { - chain_lock: ChainLockConfig::default_100_67(), - instant_lock: InstantLockConfig::default_100_67(), - execution: ExecutionConfig { - //we disable document triggers because we are using dpns and dpns needs a preorder - use_document_triggers: false, + ..Default::default() + }, + block_spacing_ms: day_in_ms, + ..Default::default() + }; - ..Default::default() - }, - block_spacing_ms: day_in_ms, - ..Default::default() - }; + let outcome = continue_chain_for_strategy( + abci_app, + ChainExecutionParameters { + block_start, + core_height_start: 1, + block_count: 16, + proposers, + validator_quorums, + current_validator_quorum_hash, + instant_lock_quorums, + current_proposer_versions: Some(current_proposer_versions.clone()), + current_identity_nonce_counter: identity_nonce_counter, + current_identity_contract_nonce_counter: identity_contract_nonce_counter, + current_votes: BTreeMap::default(), + start_time_ms: 1681094380000, + current_time_ms: end_time_ms, + current_identities: Vec::new(), + }, + NetworkStrategy { + strategy: Strategy { + start_contracts: vec![], + operations: vec![Operation { + op_type: OperationType::ResourceVote(ResourceVoteOp { + resolved_vote_poll: + ContestedDocumentResourceVotePollWithContractInfo { + contract: + DataContractOwnedResolvedInfo::OwnedDataContract( + dpns_contract.clone(), + ), + document_type_name: "domain".to_string(), + index_name: "parentNameAndLabel".to_string(), + index_values: vec!["dash".into(), "quantum".into()], + }, + action: VoteAction { + vote_choices_with_weights: vec![ + (ResourceVoteChoice::Abstain, 1), + (ResourceVoteChoice::Lock, 1), + (ResourceVoteChoice::TowardsIdentity(identity1_id), 2), + (ResourceVoteChoice::TowardsIdentity(identity2_id), 10), + ], + }, + }), + frequency: Frequency { + times_per_block_range: 1..3, + chance_per_block: None, + }, + }], + start_identities: StartIdentities::default(), + identity_inserts: Default::default(), - let outcome = continue_chain_for_strategy( - abci_app, - ChainExecutionParameters { - block_start, - core_height_start: 1, - block_count: 16, - proposers, - validator_quorums, - current_validator_quorum_hash, - instant_lock_quorums, - current_proposer_versions: Some(current_proposer_versions.clone()), - current_identity_nonce_counter: identity_nonce_counter, - current_identity_contract_nonce_counter: identity_contract_nonce_counter, - current_votes: BTreeMap::default(), - start_time_ms: 1681094380000, - current_time_ms: end_time_ms, - current_identities: Vec::new(), - }, - NetworkStrategy { - strategy: Strategy { - start_contracts: vec![], - operations: vec![Operation { - op_type: OperationType::ResourceVote(ResourceVoteOp { - resolved_vote_poll: ContestedDocumentResourceVotePollWithContractInfo { - contract: DataContractOwnedResolvedInfo::OwnedDataContract( - dpns_contract.clone(), - ), - document_type_name: "domain".to_string(), - index_name: "parentNameAndLabel".to_string(), - index_values: vec!["dash".into(), "quantum".into()], - }, - action: VoteAction { - vote_choices_with_weights: vec![ - (ResourceVoteChoice::Abstain, 1), - (ResourceVoteChoice::Lock, 1), - (ResourceVoteChoice::TowardsIdentity(identity1_id), 2), - (ResourceVoteChoice::TowardsIdentity(identity2_id), 10), - ], - }, - }), - frequency: Frequency { - times_per_block_range: 1..3, - chance_per_block: None, + identity_contract_nonce_gaps: None, + signer: voting_signer, }, - }], - start_identities: StartIdentities::default(), - identity_inserts: Default::default(), - - identity_contract_nonce_gaps: None, - signer: voting_signer, - }, - total_hpmns: 100, - extra_normal_mns: 0, - validator_quorum_count: 24, - chain_lock_quorum_count: 24, - upgrading_info: None, + total_hpmns: 100, + extra_normal_mns: 0, + validator_quorum_count: 24, + chain_lock_quorum_count: 24, + upgrading_info: None, - proposer_strategy: Default::default(), - rotate_quorums: false, - failure_testing: None, - query_testing: None, - verify_state_transition_results: true, - ..Default::default() - }, - config.clone(), - StrategyRandomness::SeedEntropy(9), - ); + proposer_strategy: Default::default(), + rotate_quorums: false, + failure_testing: None, + query_testing: None, + verify_state_transition_results: true, + ..Default::default() + }, + config.clone(), + StrategyRandomness::SeedEntropy(9), + ); - let platform = outcome.abci_app.platform; + let platform = outcome.abci_app.platform; - // Now let's run a query for the vote totals + // Now let's run a query for the vote totals - let config = bincode::config::standard() - .with_big_endian() - .with_no_limit(); + let config = bincode::config::standard() + .with_big_endian() + .with_no_limit(); - let dash_encoded = bincode::encode_to_vec(Value::Text("dash".to_string()), config) - .expect("expected to encode the word dash"); + let dash_encoded = bincode::encode_to_vec(Value::Text("dash".to_string()), config) + .expect("expected to encode the word dash"); - let quantum_encoded = bincode::encode_to_vec(Value::Text("quantum".to_string()), config) - .expect("expected to encode the word quantum"); + let quantum_encoded = + bincode::encode_to_vec(Value::Text("quantum".to_string()), config) + .expect("expected to encode the word quantum"); - let index_name = "parentNameAndLabel".to_string(); + let index_name = "parentNameAndLabel".to_string(); - let query_validation_result = platform - .query_contested_resource_vote_state( - GetContestedResourceVoteStateRequest { - version: Some(get_contested_resource_vote_state_request::Version::V0( - GetContestedResourceVoteStateRequestV0 { - contract_id: dpns_contract.id().to_vec(), - document_type_name: document_type.name().clone(), - index_name: index_name.clone(), - index_values: vec![dash_encoded.clone(), quantum_encoded.clone()], - result_type: ResultType::DocumentsAndVoteTally as i32, - allow_include_locked_and_abstaining_vote_tally: true, - start_at_identifier_info: None, - count: None, - prove: false, + let query_validation_result = platform + .query_contested_resource_vote_state( + GetContestedResourceVoteStateRequest { + version: Some(get_contested_resource_vote_state_request::Version::V0( + GetContestedResourceVoteStateRequestV0 { + contract_id: dpns_contract.id().to_vec(), + document_type_name: document_type.name().clone(), + index_name: index_name.clone(), + index_values: vec![ + dash_encoded.clone(), + quantum_encoded.clone(), + ], + result_type: ResultType::DocumentsAndVoteTally as i32, + allow_include_locked_and_abstaining_vote_tally: true, + start_at_identifier_info: None, + count: None, + prove: false, + }, + )), }, - )), - }, - &platform_state, - platform_version, - ) - .expect("expected to execute query") - .into_data() - .expect("expected query to be valid"); + &platform_state, + platform_version, + ) + .expect("expected to execute query") + .into_data() + .expect("expected query to be valid"); - let get_contested_resource_vote_state_response::Version::V0( - GetContestedResourceVoteStateResponseV0 { - metadata: _, - result, - }, - ) = query_validation_result.version.expect("expected a version"); + let get_contested_resource_vote_state_response::Version::V0( + GetContestedResourceVoteStateResponseV0 { + metadata: _, + result, + }, + ) = query_validation_result.version.expect("expected a version"); - let Some( + let Some( get_contested_resource_vote_state_response_v0::Result::ContestedResourceContenders( get_contested_resource_vote_state_response_v0::ContestedResourceContenders { contenders, @@ -1652,52 +1673,57 @@ mod tests { panic!("expected contenders") }; - assert_eq!(contenders.len(), 2); + assert_eq!(contenders.len(), 2); - let first_contender = contenders.first().unwrap(); + let first_contender = contenders.first().unwrap(); - let second_contender = contenders.last().unwrap(); + let second_contender = contenders.last().unwrap(); - assert_eq!(first_contender.identifier, identity2_id.to_vec()); + assert_eq!(first_contender.identifier, identity2_id.to_vec()); - assert_eq!(second_contender.identifier, identity1_id.to_vec()); + assert_eq!(second_contender.identifier, identity1_id.to_vec()); - // All vote counts are weighted, so for evonodes, these are in multiples of 4 + // All vote counts are weighted, so for evonodes, these are in multiples of 4 - assert_eq!(first_contender.vote_count, Some(60)); + assert_eq!(first_contender.vote_count, Some(60)); - assert_eq!(second_contender.vote_count, Some(4)); + assert_eq!(second_contender.vote_count, Some(4)); - assert_eq!(lock_vote_tally, Some(4)); + assert_eq!(lock_vote_tally, Some(4)); - assert_eq!(abstain_vote_tally, Some(8)); + assert_eq!(abstain_vote_tally, Some(8)); - assert_eq!( - finished_vote_info, - Some(FinishedVoteInfo { - finished_vote_outcome: FinishedVoteOutcome::TowardsIdentity.into(), - won_by_identity_id: Some(identity2_id.to_vec()), - finished_at_block_height: 17, - finished_at_core_block_height: 1, - finished_at_block_time_ms: 1682303986000, - finished_at_epoch: 1 - }) - ); + assert_eq!( + finished_vote_info, + Some(FinishedVoteInfo { + finished_vote_outcome: FinishedVoteOutcome::TowardsIdentity.into(), + won_by_identity_id: Some(identity2_id.to_vec()), + finished_at_block_height: 17, + finished_at_core_block_height: 1, + finished_at_block_time_ms: 1682303986000, + finished_at_epoch: 1 + }) + ); - // not let's see how much is in processing pools + // not let's see how much is in processing pools - let processing_fees = platform - .drive - .get_epoch_processing_credits_for_distribution( - &Epoch::new(1).unwrap(), - None, - platform_version, - ) - .expect("expected to get processing fees made in epoch"); + let processing_fees = platform + .drive + .get_epoch_processing_credits_for_distribution( + &Epoch::new(1).unwrap(), + None, + platform_version, + ) + .expect("expected to get processing fees made in epoch"); + + // A vote costs 10_000_000 + // Hence we did 5 votes in this epoch + assert_eq!(processing_fees, 50_000_000); + }) + .expect("Failed to create thread with custom stack size"); - // A vote costs 10_000_000 - // Hence we did 5 votes in this epoch - assert_eq!(processing_fees, 50_000_000); + // Wait for the thread to finish and assert that it didn't panic. + handler.join().expect("Thread has panicked"); } #[test] diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs index da5fad0b6e5..ff8188c3916 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs @@ -79,7 +79,7 @@ impl TokenDirectPurchaseTransitionActionV0 { TokenBaseTransitionAction::try_from_borrowed_base_transition_with_contract_lookup( drive, owner_id, - &base, + base, approximate_without_state_for_costs, transaction, &mut drive_operations, diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs index e4d85e41fac..8d629cbb319 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_set_price_for_direct_purchase_transition_action/v0/transformer.rs @@ -181,7 +181,7 @@ impl TokenSetPriceForDirectPurchaseTransitionActionV0 { TokenBaseTransitionAction::try_from_borrowed_base_transition_with_contract_lookup( drive, owner_id, - &base, + base, approximate_without_state_for_costs, transaction, &mut drive_operations, From 5ff335e8064ee535d46bfacf630eeedb9dc63c11 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Thu, 10 Apr 2025 11:19:26 +0700 Subject: [PATCH 12/32] added autogenerated code --- .../dash/platform/dapi/v0/PlatformGrpc.java | 86 +- .../platform/v0/nodejs/platform_pbjs.js | 2840 ++++++++++++- .../platform/v0/nodejs/platform_protoc.js | 3509 +++++++++++++++-- .../platform/v0/objective-c/Platform.pbobjc.h | 267 ++ .../platform/v0/objective-c/Platform.pbobjc.m | 731 ++++ .../platform/v0/objective-c/Platform.pbrpc.h | 13 + .../platform/v0/objective-c/Platform.pbrpc.m | 20 + .../platform/v0/python/platform_pb2.py | 900 ++++- .../platform/v0/python/platform_pb2_grpc.py | 33 + .../clients/platform/v0/web/platform_pb.d.ts | 350 ++ .../clients/platform/v0/web/platform_pb.js | 2671 ++++++++++++- .../platform/v0/web/platform_pb_service.d.ts | 19 + .../platform/v0/web/platform_pb_service.js | 40 + 13 files changed, 10916 insertions(+), 563 deletions(-) diff --git a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java index f0d139c5183..3542de18c38 100644 --- a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java +++ b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java @@ -1162,6 +1162,37 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenStatusesResponse> getGetTok return getGetTokenStatusesMethod; } + private static volatile io.grpc.MethodDescriptor getGetTokenDirectPurchasePricesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "getTokenDirectPurchasePrices", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetTokenDirectPurchasePricesMethod() { + io.grpc.MethodDescriptor getGetTokenDirectPurchasePricesMethod; + if ((getGetTokenDirectPurchasePricesMethod = PlatformGrpc.getGetTokenDirectPurchasePricesMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getGetTokenDirectPurchasePricesMethod = PlatformGrpc.getGetTokenDirectPurchasePricesMethod) == null) { + PlatformGrpc.getGetTokenDirectPurchasePricesMethod = getGetTokenDirectPurchasePricesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getTokenDirectPurchasePrices")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getTokenDirectPurchasePrices")) + .build(); + } + } + } + return getGetTokenDirectPurchasePricesMethod; + } + private static volatile io.grpc.MethodDescriptor getGetTokenPreProgrammedDistributionsMethod; @@ -1670,6 +1701,13 @@ public void getTokenStatuses(org.dash.platform.dapi.v0.PlatformOuterClass.GetTok io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTokenStatusesMethod(), responseObserver); } + /** + */ + public void getTokenDirectPurchasePrices(org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTokenDirectPurchasePricesMethod(), responseObserver); + } + /** */ public void getTokenPreProgrammedDistributions(org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenPreProgrammedDistributionsRequest request, @@ -1973,6 +2011,13 @@ public void getGroupActionSigners(org.dash.platform.dapi.v0.PlatformOuterClass.G org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenStatusesRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenStatusesResponse>( this, METHODID_GET_TOKEN_STATUSES))) + .addMethod( + getGetTokenDirectPurchasePricesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesResponse>( + this, METHODID_GET_TOKEN_DIRECT_PURCHASE_PRICES))) .addMethod( getGetTokenPreProgrammedDistributionsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -2344,6 +2389,14 @@ public void getTokenStatuses(org.dash.platform.dapi.v0.PlatformOuterClass.GetTok getChannel().newCall(getGetTokenStatusesMethod(), getCallOptions()), request, responseObserver); } + /** + */ + public void getTokenDirectPurchasePrices(org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTokenDirectPurchasePricesMethod(), getCallOptions()), request, responseObserver); + } + /** */ public void getTokenPreProgrammedDistributions(org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenPreProgrammedDistributionsRequest request, @@ -2681,6 +2734,13 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenStatusesResponse get getChannel(), getGetTokenStatusesMethod(), getCallOptions(), request); } + /** + */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesResponse getTokenDirectPurchasePrices(org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTokenDirectPurchasePricesMethod(), getCallOptions(), request); + } + /** */ public org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenPreProgrammedDistributionsResponse getTokenPreProgrammedDistributions(org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenPreProgrammedDistributionsRequest request) { @@ -3049,6 +3109,14 @@ public com.google.common.util.concurrent.ListenableFuture getTokenDirectPurchasePrices( + org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTokenDirectPurchasePricesMethod(), getCallOptions()), request); + } + /** */ public com.google.common.util.concurrent.ListenableFuture getTokenPreProgrammedDistributions( @@ -3135,12 +3203,13 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -3307,6 +3376,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getTokenStatuses((org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenStatusesRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_TOKEN_DIRECT_PURCHASE_PRICES: + serviceImpl.getTokenDirectPurchasePrices((org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenDirectPurchasePricesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_GET_TOKEN_PRE_PROGRAMMED_DISTRIBUTIONS: serviceImpl.getTokenPreProgrammedDistributions((org.dash.platform.dapi.v0.PlatformOuterClass.GetTokenPreProgrammedDistributionsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -3429,6 +3502,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetIdentityTokenInfosMethod()) .addMethod(getGetIdentitiesTokenInfosMethod()) .addMethod(getGetTokenStatusesMethod()) + .addMethod(getGetTokenDirectPurchasePricesMethod()) .addMethod(getGetTokenPreProgrammedDistributionsMethod()) .addMethod(getGetTokenTotalSupplyMethod()) .addMethod(getGetGroupInfoMethod()) diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js index 6cf6ca064c2..55c71d624e1 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -1307,6 +1307,39 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenDirectPurchasePrices}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenDirectPurchasePricesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} [response] GetTokenDirectPurchasePricesResponse + */ + + /** + * Calls getTokenDirectPurchasePrices. + * @function getTokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenDirectPurchasePricesCallback} callback Node-style callback called with the error, if any, and GetTokenDirectPurchasePricesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenDirectPurchasePrices = function getTokenDirectPurchasePrices(request, callback) { + return this.rpcCall(getTokenDirectPurchasePrices, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, request, callback); + }, "name", { value: "getTokenDirectPurchasePrices" }); + + /** + * Calls getTokenDirectPurchasePrices. + * @function getTokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenPreProgrammedDistributions}. * @memberof org.dash.platform.dapi.v0.Platform @@ -55031,6 +55064,2057 @@ $root.org = (function() { return GetTokenStatusesResponse; })(); + v0.GetTokenDirectPurchasePricesRequest = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenDirectPurchasePricesRequest + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null} [v0] GetTokenDirectPurchasePricesRequest v0 + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenDirectPurchasePricesRequest. + * @implements IGetTokenDirectPurchasePricesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + */ + GetTokenDirectPurchasePricesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest instance + */ + GetTokenDirectPurchasePricesRequest.create = function create(properties) { + return new GetTokenDirectPurchasePricesRequest(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + */ + GetTokenDirectPurchasePricesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @interface IGetTokenDirectPurchasePricesRequestV0 + * @property {Array.|null} [tokenIds] GetTokenDirectPurchasePricesRequestV0 tokenIds + * @property {boolean|null} [prove] GetTokenDirectPurchasePricesRequestV0 prove + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @classdesc Represents a GetTokenDirectPurchasePricesRequestV0. + * @implements IGetTokenDirectPurchasePricesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + */ + GetTokenDirectPurchasePricesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetTokenDirectPurchasePricesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + */ + GetTokenDirectPurchasePricesRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenDirectPurchasePricesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 instance + */ + GetTokenDirectPurchasePricesRequestV0.create = function create(properties) { + return new GetTokenDirectPurchasePricesRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + */ + GetTokenDirectPurchasePricesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) + object.prove = false; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenDirectPurchasePricesRequestV0; + })(); + + return GetTokenDirectPurchasePricesRequest; + })(); + + v0.GetTokenDirectPurchasePricesResponse = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenDirectPurchasePricesResponse + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null} [v0] GetTokenDirectPurchasePricesResponse v0 + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenDirectPurchasePricesResponse. + * @implements IGetTokenDirectPurchasePricesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + */ + GetTokenDirectPurchasePricesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse instance + */ + GetTokenDirectPurchasePricesResponse.create = function create(properties) { + return new GetTokenDirectPurchasePricesResponse(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + */ + GetTokenDirectPurchasePricesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @interface IGetTokenDirectPurchasePricesResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null} [tokenDirectPurchasePrices] GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenDirectPurchasePricesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenDirectPurchasePricesResponseV0 metadata + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @classdesc Represents a GetTokenDirectPurchasePricesResponseV0. + * @implements IGetTokenDirectPurchasePricesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null|undefined} tokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.tokenDirectPurchasePrices = null; + + /** + * GetTokenDirectPurchasePricesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.proof = null; + + /** + * GetTokenDirectPurchasePricesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesResponseV0 result. + * @member {"tokenDirectPurchasePrices"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenDirectPurchasePrices", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 instance + */ + GetTokenDirectPurchasePricesResponseV0.create = function create(properties) { + return new GetTokenDirectPurchasePricesResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDirectPurchasePrices != null && Object.hasOwnProperty.call(message, "tokenDirectPurchasePrices")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.encode(message.tokenDirectPurchasePrices, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify(message.tokenDirectPurchasePrices); + if (error) + return "tokenDirectPurchasePrices." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + */ + GetTokenDirectPurchasePricesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); + if (object.tokenDirectPurchasePrices != null) { + if (typeof object.tokenDirectPurchasePrices !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.tokenDirectPurchasePrices: object expected"); + message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.fromObject(object.tokenDirectPurchasePrices); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { + object.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(message.tokenDirectPurchasePrices, options); + if (options.oneofs) + object.result = "tokenDirectPurchasePrices"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = (function() { + + /** + * Properties of a PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface IPriceForQuantity + * @property {number|Long|null} [quantity] PriceForQuantity quantity + * @property {number|Long|null} [price] PriceForQuantity price + */ + + /** + * Constructs a new PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a PriceForQuantity. + * @implements IPriceForQuantity + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set + */ + function PriceForQuantity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceForQuantity quantity. + * @member {number|Long} quantity + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PriceForQuantity price. + * @member {number|Long} price + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PriceForQuantity instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity instance + */ + PriceForQuantity.create = function create(properties) { + return new PriceForQuantity(properties); + }; + + /** + * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); + return writer; + }; + + /** + * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.uint64(); + break; + case 2: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceForQuantity message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceForQuantity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.price != null && message.hasOwnProperty("price")) + if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) + return "price: integer|Long expected"; + return null; + }; + + /** + * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + */ + PriceForQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + if (object.price != null) + if ($util.Long) + (message.price = $util.Long.fromValue(object.price)).unsigned = true; + else if (typeof object.price === "string") + message.price = parseInt(object.price, 10); + else if (typeof object.price === "number") + message.price = object.price; + else if (typeof object.price === "object") + message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} message PriceForQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceForQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.quantity = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.price = options.longs === String ? "0" : 0; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (message.price != null && message.hasOwnProperty("price")) + if (typeof message.price === "number") + object.price = options.longs === String ? String(message.price) : message.price; + else + object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; + return object; + }; + + /** + * Converts this PriceForQuantity to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + * @returns {Object.} JSON object + */ + PriceForQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceForQuantity; + })(); + + GetTokenDirectPurchasePricesResponseV0.PricingSchedule = (function() { + + /** + * Properties of a PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface IPricingSchedule + * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity + */ + + /** + * Constructs a new PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a PricingSchedule. + * @implements IPricingSchedule + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set + */ + function PricingSchedule(properties) { + this.priceForQuantity = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PricingSchedule priceForQuantity. + * @member {Array.} priceForQuantity + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @instance + */ + PricingSchedule.prototype.priceForQuantity = $util.emptyArray; + + /** + * Creates a new PricingSchedule instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule instance + */ + PricingSchedule.create = function create(properties) { + return new PricingSchedule(properties); + }; + + /** + * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priceForQuantity != null && message.priceForQuantity.length) + for (var i = 0; i < message.priceForQuantity.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.priceForQuantity && message.priceForQuantity.length)) + message.priceForQuantity = []; + message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PricingSchedule message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PricingSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { + if (!Array.isArray(message.priceForQuantity)) + return "priceForQuantity: array expected"; + for (var i = 0; i < message.priceForQuantity.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify(message.priceForQuantity[i]); + if (error) + return "priceForQuantity." + error; + } + } + return null; + }; + + /** + * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + */ + PricingSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); + if (object.priceForQuantity) { + if (!Array.isArray(object.priceForQuantity)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: array expected"); + message.priceForQuantity = []; + for (var i = 0; i < object.priceForQuantity.length; ++i) { + if (typeof object.priceForQuantity[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: object expected"); + message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.fromObject(object.priceForQuantity[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} message PricingSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PricingSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.priceForQuantity = []; + if (message.priceForQuantity && message.priceForQuantity.length) { + object.priceForQuantity = []; + for (var j = 0; j < message.priceForQuantity.length; ++j) + object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject(message.priceForQuantity[j], options); + } + return object; + }; + + /** + * Converts this PricingSchedule to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @instance + * @returns {Object.} JSON object + */ + PricingSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PricingSchedule; + })(); + + GetTokenDirectPurchasePricesResponseV0.Price = (function() { + + /** + * Properties of a Price. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface IPrice + * @property {number|Long|null} [fixedPrice] Price fixedPrice + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null} [variablePrice] Price variablePrice + */ + + /** + * Constructs a new Price. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a Price. + * @implements IPrice + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice=} [properties] Properties to set + */ + function Price(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Price fixedPrice. + * @member {number|Long} fixedPrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @instance + */ + Price.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Price variablePrice. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null|undefined} variablePrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @instance + */ + Price.prototype.variablePrice = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Price price. + * @member {"fixedPrice"|"variablePrice"|undefined} price + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @instance + */ + Object.defineProperty(Price.prototype, "price", { + get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Price instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price instance + */ + Price.create = function create(properties) { + return new Price(properties); + }; + + /** + * Encodes the specified Price message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice} message Price message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Price.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.fixedPrice); + if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Price message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice} message Price message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Price.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Price message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Price.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fixedPrice = reader.uint64(); + break; + case 2: + message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Price message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Price.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Price message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Price.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + properties.price = 1; + if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) + return "fixedPrice: integer|Long expected"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + if (properties.price === 1) + return "price: multiple values"; + properties.price = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify(message.variablePrice); + if (error) + return "variablePrice." + error; + } + } + return null; + }; + + /** + * Creates a Price message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price + */ + Price.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price(); + if (object.fixedPrice != null) + if ($util.Long) + (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; + else if (typeof object.fixedPrice === "string") + message.fixedPrice = parseInt(object.fixedPrice, 10); + else if (typeof object.fixedPrice === "number") + message.fixedPrice = object.fixedPrice; + else if (typeof object.fixedPrice === "object") + message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); + if (object.variablePrice != null) { + if (typeof object.variablePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.variablePrice: object expected"); + message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.fromObject(object.variablePrice); + } + return message; + }; + + /** + * Creates a plain object from a Price message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} message Price + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Price.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + if (typeof message.fixedPrice === "number") + object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; + else + object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; + if (options.oneofs) + object.price = "fixedPrice"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + object.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(message.variablePrice, options); + if (options.oneofs) + object.price = "variablePrice"; + } + return object; + }; + + /** + * Converts this Price to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price + * @instance + * @returns {Object.} JSON object + */ + Price.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Price; + })(); + + GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = (function() { + + /** + * Properties of a TokenDirectPurchasePriceEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface ITokenDirectPurchasePriceEntry + * @property {Uint8Array|null} [tokenId] TokenDirectPurchasePriceEntry tokenId + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice|null} [price] TokenDirectPurchasePriceEntry price + */ + + /** + * Constructs a new TokenDirectPurchasePriceEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a TokenDirectPurchasePriceEntry. + * @implements ITokenDirectPurchasePriceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set + */ + function TokenDirectPurchasePriceEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDirectPurchasePriceEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + TokenDirectPurchasePriceEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenDirectPurchasePriceEntry price. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice|null|undefined} price + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + TokenDirectPurchasePriceEntry.prototype.price = null; + + /** + * Creates a new TokenDirectPurchasePriceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry instance + */ + TokenDirectPurchasePriceEntry.create = function create(properties) { + return new TokenDirectPurchasePriceEntry(properties); + }; + + /** + * Encodes the specified TokenDirectPurchasePriceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePriceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.encode(message.price, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDirectPurchasePriceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePriceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePriceEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePriceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDirectPurchasePriceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDirectPurchasePriceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.price != null && message.hasOwnProperty("price")) { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify(message.price); + if (error) + return "price." + error; + } + return null; + }; + + /** + * Creates a TokenDirectPurchasePriceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + */ + TokenDirectPurchasePriceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.price != null) { + if (typeof object.price !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.price: object expected"); + message.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.fromObject(object.price); + } + return message; + }; + + /** + * Creates a plain object from a TokenDirectPurchasePriceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDirectPurchasePriceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.price = null; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.price != null && message.hasOwnProperty("price")) + object.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(message.price, options); + return object; + }; + + /** + * Converts this TokenDirectPurchasePriceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + * @returns {Object.} JSON object + */ + TokenDirectPurchasePriceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDirectPurchasePriceEntry; + })(); + + GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = (function() { + + /** + * Properties of a TokenDirectPurchasePrices. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface ITokenDirectPurchasePrices + * @property {Array.|null} [tokenDirectPurchasePrice] TokenDirectPurchasePrices tokenDirectPurchasePrice + */ + + /** + * Constructs a new TokenDirectPurchasePrices. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a TokenDirectPurchasePrices. + * @implements ITokenDirectPurchasePrices + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set + */ + function TokenDirectPurchasePrices(properties) { + this.tokenDirectPurchasePrice = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDirectPurchasePrices tokenDirectPurchasePrice. + * @member {Array.} tokenDirectPurchasePrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @instance + */ + TokenDirectPurchasePrices.prototype.tokenDirectPurchasePrice = $util.emptyArray; + + /** + * Creates a new TokenDirectPurchasePrices instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices instance + */ + TokenDirectPurchasePrices.create = function create(properties) { + return new TokenDirectPurchasePrices(properties); + }; + + /** + * Encodes the specified TokenDirectPurchasePrices message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePrices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDirectPurchasePrice != null && message.tokenDirectPurchasePrice.length) + for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.encode(message.tokenDirectPurchasePrice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDirectPurchasePrices message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePrices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePrices.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length)) + message.tokenDirectPurchasePrice = []; + message.tokenDirectPurchasePrice.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePrices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDirectPurchasePrices message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDirectPurchasePrices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenDirectPurchasePrice != null && message.hasOwnProperty("tokenDirectPurchasePrice")) { + if (!Array.isArray(message.tokenDirectPurchasePrice)) + return "tokenDirectPurchasePrice: array expected"; + for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify(message.tokenDirectPurchasePrice[i]); + if (error) + return "tokenDirectPurchasePrice." + error; + } + } + return null; + }; + + /** + * Creates a TokenDirectPurchasePrices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + */ + TokenDirectPurchasePrices.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); + if (object.tokenDirectPurchasePrice) { + if (!Array.isArray(object.tokenDirectPurchasePrice)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: array expected"); + message.tokenDirectPurchasePrice = []; + for (var i = 0; i < object.tokenDirectPurchasePrice.length; ++i) { + if (typeof object.tokenDirectPurchasePrice[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: object expected"); + message.tokenDirectPurchasePrice[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.fromObject(object.tokenDirectPurchasePrice[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenDirectPurchasePrices message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} message TokenDirectPurchasePrices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDirectPurchasePrices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenDirectPurchasePrice = []; + if (message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length) { + object.tokenDirectPurchasePrice = []; + for (var j = 0; j < message.tokenDirectPurchasePrice.length; ++j) + object.tokenDirectPurchasePrice[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject(message.tokenDirectPurchasePrice[j], options); + } + return object; + }; + + /** + * Converts this TokenDirectPurchasePrices to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @instance + * @returns {Object.} JSON object + */ + TokenDirectPurchasePrices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDirectPurchasePrices; + })(); + + return GetTokenDirectPurchasePricesResponseV0; + })(); + + return GetTokenDirectPurchasePricesResponse; + })(); + v0.GetTokenPreProgrammedDistributionsRequest = (function() { /** @@ -64907,6 +66991,724 @@ $root.org = (function() { return TokenConfigUpdateEvent; })(); + GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent = (function() { + + /** + * Properties of an UpdateDirectPurchasePriceEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IUpdateDirectPurchasePriceEvent + * @property {number|Long|null} [fixedPrice] UpdateDirectPurchasePriceEvent fixedPrice + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null} [variablePrice] UpdateDirectPurchasePriceEvent variablePrice + * @property {string|null} [publicNote] UpdateDirectPurchasePriceEvent publicNote + */ + + /** + * Constructs a new UpdateDirectPurchasePriceEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an UpdateDirectPurchasePriceEvent. + * @implements IUpdateDirectPurchasePriceEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set + */ + function UpdateDirectPurchasePriceEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDirectPurchasePriceEvent fixedPrice. + * @member {number|Long} fixedPrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UpdateDirectPurchasePriceEvent variablePrice. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null|undefined} variablePrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.variablePrice = null; + + /** + * UpdateDirectPurchasePriceEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.publicNote = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateDirectPurchasePriceEvent price. + * @member {"fixedPrice"|"variablePrice"|undefined} price + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + Object.defineProperty(UpdateDirectPurchasePriceEvent.prototype, "price", { + get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateDirectPurchasePriceEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent instance + */ + UpdateDirectPurchasePriceEvent.create = function create(properties) { + return new UpdateDirectPurchasePriceEvent(properties); + }; + + /** + * Encodes the specified UpdateDirectPurchasePriceEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDirectPurchasePriceEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.fixedPrice); + if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified UpdateDirectPurchasePriceEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDirectPurchasePriceEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDirectPurchasePriceEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fixedPrice = reader.uint64(); + break; + case 2: + message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.decode(reader, reader.uint32()); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDirectPurchasePriceEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDirectPurchasePriceEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDirectPurchasePriceEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + properties.price = 1; + if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) + return "fixedPrice: integer|Long expected"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + if (properties.price === 1) + return "price: multiple values"; + properties.price = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify(message.variablePrice); + if (error) + return "variablePrice." + error; + } + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an UpdateDirectPurchasePriceEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + */ + UpdateDirectPurchasePriceEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); + if (object.fixedPrice != null) + if ($util.Long) + (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; + else if (typeof object.fixedPrice === "string") + message.fixedPrice = parseInt(object.fixedPrice, 10); + else if (typeof object.fixedPrice === "number") + message.fixedPrice = object.fixedPrice; + else if (typeof object.fixedPrice === "object") + message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); + if (object.variablePrice != null) { + if (typeof object.variablePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.variablePrice: object expected"); + message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.fromObject(object.variablePrice); + } + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an UpdateDirectPurchasePriceEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDirectPurchasePriceEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.publicNote = ""; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + if (typeof message.fixedPrice === "number") + object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; + else + object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; + if (options.oneofs) + object.price = "fixedPrice"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + object.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(message.variablePrice, options); + if (options.oneofs) + object.price = "variablePrice"; + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this UpdateDirectPurchasePriceEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + * @returns {Object.} JSON object + */ + UpdateDirectPurchasePriceEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UpdateDirectPurchasePriceEvent.PriceForQuantity = (function() { + + /** + * Properties of a PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @interface IPriceForQuantity + * @property {number|Long|null} [quantity] PriceForQuantity quantity + * @property {number|Long|null} [price] PriceForQuantity price + */ + + /** + * Constructs a new PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @classdesc Represents a PriceForQuantity. + * @implements IPriceForQuantity + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set + */ + function PriceForQuantity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceForQuantity quantity. + * @member {number|Long} quantity + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PriceForQuantity price. + * @member {number|Long} price + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PriceForQuantity instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity instance + */ + PriceForQuantity.create = function create(properties) { + return new PriceForQuantity(properties); + }; + + /** + * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); + return writer; + }; + + /** + * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.uint64(); + break; + case 2: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceForQuantity message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceForQuantity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.price != null && message.hasOwnProperty("price")) + if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) + return "price: integer|Long expected"; + return null; + }; + + /** + * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + */ + PriceForQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + if (object.price != null) + if ($util.Long) + (message.price = $util.Long.fromValue(object.price)).unsigned = true; + else if (typeof object.price === "string") + message.price = parseInt(object.price, 10); + else if (typeof object.price === "number") + message.price = object.price; + else if (typeof object.price === "object") + message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} message PriceForQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceForQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.quantity = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.price = options.longs === String ? "0" : 0; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (message.price != null && message.hasOwnProperty("price")) + if (typeof message.price === "number") + object.price = options.longs === String ? String(message.price) : message.price; + else + object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; + return object; + }; + + /** + * Converts this PriceForQuantity to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + * @returns {Object.} JSON object + */ + PriceForQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceForQuantity; + })(); + + UpdateDirectPurchasePriceEvent.PricingSchedule = (function() { + + /** + * Properties of a PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @interface IPricingSchedule + * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity + */ + + /** + * Constructs a new PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @classdesc Represents a PricingSchedule. + * @implements IPricingSchedule + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set + */ + function PricingSchedule(properties) { + this.priceForQuantity = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PricingSchedule priceForQuantity. + * @member {Array.} priceForQuantity + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @instance + */ + PricingSchedule.prototype.priceForQuantity = $util.emptyArray; + + /** + * Creates a new PricingSchedule instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule instance + */ + PricingSchedule.create = function create(properties) { + return new PricingSchedule(properties); + }; + + /** + * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priceForQuantity != null && message.priceForQuantity.length) + for (var i = 0; i < message.priceForQuantity.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.priceForQuantity && message.priceForQuantity.length)) + message.priceForQuantity = []; + message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PricingSchedule message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PricingSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { + if (!Array.isArray(message.priceForQuantity)) + return "priceForQuantity: array expected"; + for (var i = 0; i < message.priceForQuantity.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify(message.priceForQuantity[i]); + if (error) + return "priceForQuantity." + error; + } + } + return null; + }; + + /** + * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + */ + PricingSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); + if (object.priceForQuantity) { + if (!Array.isArray(object.priceForQuantity)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: array expected"); + message.priceForQuantity = []; + for (var i = 0; i < object.priceForQuantity.length; ++i) { + if (typeof object.priceForQuantity[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: object expected"); + message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.fromObject(object.priceForQuantity[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} message PricingSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PricingSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.priceForQuantity = []; + if (message.priceForQuantity && message.priceForQuantity.length) { + object.priceForQuantity = []; + for (var j = 0; j < message.priceForQuantity.length; ++j) + object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject(message.priceForQuantity[j], options); + } + return object; + }; + + /** + * Converts this PricingSchedule to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @instance + * @returns {Object.} JSON object + */ + PricingSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PricingSchedule; + })(); + + return UpdateDirectPurchasePriceEvent; + })(); + GetGroupActionsResponseV0.GroupActionEvent = (function() { /** @@ -66013,6 +68815,7 @@ $root.org = (function() { * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null} [destroyFrozenFunds] TokenEvent destroyFrozenFunds * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null} [emergencyAction] TokenEvent emergencyAction * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null} [tokenConfigUpdate] TokenEvent tokenConfigUpdate + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null} [updatePrice] TokenEvent updatePrice */ /** @@ -66086,17 +68889,25 @@ $root.org = (function() { */ TokenEvent.prototype.tokenConfigUpdate = null; + /** + * TokenEvent updatePrice. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null|undefined} updatePrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.updatePrice = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * TokenEvent type. - * @member {"mint"|"burn"|"freeze"|"unfreeze"|"destroyFrozenFunds"|"emergencyAction"|"tokenConfigUpdate"|undefined} type + * @member {"mint"|"burn"|"freeze"|"unfreeze"|"destroyFrozenFunds"|"emergencyAction"|"tokenConfigUpdate"|"updatePrice"|undefined} type * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent * @instance */ Object.defineProperty(TokenEvent.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["mint", "burn", "freeze", "unfreeze", "destroyFrozenFunds", "emergencyAction", "tokenConfigUpdate"]), + get: $util.oneOfGetter($oneOfFields = ["mint", "burn", "freeze", "unfreeze", "destroyFrozenFunds", "emergencyAction", "tokenConfigUpdate", "updatePrice"]), set: $util.oneOfSetter($oneOfFields) }); @@ -66138,6 +68949,8 @@ $root.org = (function() { $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.encode(message.emergencyAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.tokenConfigUpdate != null && Object.hasOwnProperty.call(message, "tokenConfigUpdate")) $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.encode(message.tokenConfigUpdate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updatePrice != null && Object.hasOwnProperty.call(message, "updatePrice")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.encode(message.updatePrice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -66193,6 +69006,9 @@ $root.org = (function() { case 7: message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.decode(reader, reader.uint32()); break; + case 8: + message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -66297,6 +69113,16 @@ $root.org = (function() { return "tokenConfigUpdate." + error; } } + if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify(message.updatePrice); + if (error) + return "updatePrice." + error; + } + } return null; }; @@ -66347,6 +69173,11 @@ $root.org = (function() { throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.tokenConfigUpdate: object expected"); message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.fromObject(object.tokenConfigUpdate); } + if (object.updatePrice != null) { + if (typeof object.updatePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.updatePrice: object expected"); + message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.fromObject(object.updatePrice); + } return message; }; @@ -66398,6 +69229,11 @@ $root.org = (function() { if (options.oneofs) object.type = "tokenConfigUpdate"; } + if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { + object.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(message.updatePrice, options); + if (options.oneofs) + object.type = "updatePrice"; + } return object; }; diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js index db423372350..a59a591a607 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js @@ -13,7 +13,7 @@ var jspb = require('google-protobuf'); var goog = jspb; -const proto = {}; +var global = Function('return this')(); var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js'); goog.object.extend(proto, google_protobuf_wrappers_pb); @@ -21,424 +21,441 @@ var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_ goog.object.extend(proto, google_protobuf_struct_pb); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); goog.object.extend(proto, google_protobuf_timestamp_pb); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.AllKeys', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.StartCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.StartCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.TypeCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.TypeCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.EventTypeCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.TypeCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ResultCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyPurpose', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyRequestType', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.Proof', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.ResponseMetadata', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.SearchKey', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.SpecificKeys', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.VersionCase', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.AllKeys', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetContestedResourcesResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.StartCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEpochsInfoResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.StartCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.TypeCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.TypeCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.EventTypeCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.TypeCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfosResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityNonceResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPathElementsResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.RequestTypeCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProofsResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ResultCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyPurpose', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyRequestType', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.Proof', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.ResponseMetadata', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SearchKey', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SpecificKeys', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.VersionCase', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0', null, global); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.ResultCase', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -5122,6 +5139,195 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -6004,6 +6210,69 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.displayName = 'proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.displayName = 'proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.displayName = 'proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.displayName = 'proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -54791,6 +55060,1757 @@ proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.prototype.hasV0 = funct +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + tokenIdsList: msg.getTokenIdsList_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addTokenIds(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * repeated bytes token_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes token_ids = 1; + * This is a type-conversion wrapper around `getTokenIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getTokenIdsList())); +}; + + +/** + * repeated bytes token_ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getTokenIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setTokenIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.addTokenIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.clearTokenIdsList = function() { + return this.setTokenIdsList([]); +}; + + +/** + * optional bool prove = 2; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional GetTokenDirectPurchasePricesRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.serializeBinaryToWriter + ); + } +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase = { + RESULT_NOT_SET: 0, + TOKEN_DIRECT_PURCHASE_PRICES: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject = function(includeInstance, msg) { + var f, obj = { + tokenDirectPurchasePrices: (f = msg.getTokenDirectPurchasePrices()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.deserializeBinaryFromReader); + msg.setTokenDirectPurchasePrices(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenDirectPurchasePrices(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject = function(includeInstance, msg) { + var f, obj = { + quantity: jspb.Message.getFieldWithDefault(msg, 1, 0), + price: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setQuantity(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setPrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQuantity(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getPrice(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional uint64 quantity = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.getQuantity = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.setQuantity = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 price = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.getPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.setPrice = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject = function(includeInstance, msg) { + var f, obj = { + priceForQuantityList: jspb.Message.toObjectList(msg.getPriceForQuantityList(), + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.deserializeBinaryFromReader); + msg.addPriceForQuantity(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPriceForQuantityList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated PriceForQuantity price_for_quantity = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.getPriceForQuantityList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.setPriceForQuantityList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.addPriceForQuantity = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.clearPriceForQuantityList = function() { + return this.setPriceForQuantityList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase = { + PRICE_NOT_SET: 0, + FIXED_PRICE: 1, + VARIABLE_PRICE: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getPriceCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject = function(includeInstance, msg) { + var f, obj = { + fixedPrice: jspb.Message.getFieldWithDefault(msg, 1, 0), + variablePrice: (f = msg.getVariablePrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setFixedPrice(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader); + msg.setVariablePrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeUint64( + 1, + f + ); + } + f = message.getVariablePrice(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter + ); + } +}; + + +/** + * optional uint64 fixed_price = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getFixedPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.setFixedPrice = function(value) { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.clearFixedPrice = function() { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.hasFixedPrice = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PricingSchedule variable_price = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getVariablePrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.setVariablePrice = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.clearVariablePrice = function() { + return this.setVariablePrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.hasVariablePrice = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject = function(includeInstance, msg) { + var f, obj = { + tokenId: msg.getTokenId_asB64(), + price: (f = msg.getPrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTokenId(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader); + msg.setPrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getPrice(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes token_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getTokenId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes token_id = 1; + * This is a type-conversion wrapper around `getTokenId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getTokenId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTokenId())); +}; + + +/** + * optional bytes token_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getTokenId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTokenId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional Price price = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getPrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setPrice = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.clearPrice = function() { + return this.setPrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.hasPrice = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject = function(includeInstance, msg) { + var f, obj = { + tokenDirectPurchasePriceList: jspb.Message.toObjectList(msg.getTokenDirectPurchasePriceList(), + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.deserializeBinaryFromReader); + msg.addTokenDirectPurchasePrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenDirectPurchasePriceList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated TokenDirectPurchasePriceEntry token_direct_purchase_price = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.getTokenDirectPurchasePriceList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.setTokenDirectPurchasePriceList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.addTokenDirectPurchasePrice = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.clearTokenDirectPurchasePriceList = function() { + return this.setTokenDirectPurchasePriceList([]); +}; + + +/** + * optional TokenDirectPurchasePrices token_direct_purchase_prices = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.getTokenDirectPurchasePrices = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.setTokenDirectPurchasePrices = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.clearTokenDirectPurchasePrices = function() { + return this.setTokenDirectPurchasePrices(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.hasTokenDirectPurchasePrices = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional GetTokenDirectPurchasePricesResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -63406,6 +65426,599 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceCase = { + PRICE_NOT_SET: 0, + FIXED_PRICE: 1, + VARIABLE_PRICE: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceCase} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.getPriceCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject = function(includeInstance, msg) { + var f, obj = { + fixedPrice: jspb.Message.getFieldWithDefault(msg, 1, 0), + variablePrice: (f = msg.getVariablePrice()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(includeInstance, f), + publicNote: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent; + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setFixedPrice(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.deserializeBinaryFromReader); + msg.setVariablePrice(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPublicNote(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeUint64( + 1, + f + ); + } + f = message.getVariablePrice(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject = function(includeInstance, msg) { + var f, obj = { + quantity: jspb.Message.getFieldWithDefault(msg, 1, 0), + price: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity; + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setQuantity(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setPrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQuantity(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getPrice(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional uint64 quantity = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.getQuantity = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.setQuantity = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 price = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.getPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.setPrice = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject = function(includeInstance, msg) { + var f, obj = { + priceForQuantityList: jspb.Message.toObjectList(msg.getPriceForQuantityList(), + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule; + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.deserializeBinaryFromReader); + msg.addPriceForQuantity(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPriceForQuantityList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated PriceForQuantity price_for_quantity = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.getPriceForQuantityList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} returns this +*/ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.setPriceForQuantityList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.addPriceForQuantity = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.clearPriceForQuantityList = function() { + return this.setPriceForQuantityList([]); +}; + + +/** + * optional uint64 fixed_price = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.getFixedPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.setFixedPrice = function(value) { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.clearFixedPrice = function() { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.hasFixedPrice = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PricingSchedule variable_price = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.getVariablePrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this +*/ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.setVariablePrice = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.clearVariablePrice = function() { + return this.setVariablePrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.hasVariablePrice = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string public_note = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.getPublicNote = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.setPublicNote = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.clearPublicNote = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.hasPublicNote = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -64354,7 +66967,7 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.oneofGroups_ = [[1,2,3,4,5,6,7]]; +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.oneofGroups_ = [[1,2,3,4,5,6,7,8]]; /** * @enum {number} @@ -64367,7 +66980,8 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV UNFREEZE: 4, DESTROY_FROZEN_FUNDS: 5, EMERGENCY_ACTION: 6, - TOKEN_CONFIG_UPDATE: 7 + TOKEN_CONFIG_UPDATE: 7, + UPDATE_PRICE: 8 }; /** @@ -64414,7 +67028,8 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV unfreeze: (f = msg.getUnfreeze()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.toObject(includeInstance, f), destroyFrozenFunds: (f = msg.getDestroyFrozenFunds()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.toObject(includeInstance, f), emergencyAction: (f = msg.getEmergencyAction()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.toObject(includeInstance, f), - tokenConfigUpdate: (f = msg.getTokenConfigUpdate()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(includeInstance, f) + tokenConfigUpdate: (f = msg.getTokenConfigUpdate()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(includeInstance, f), + updatePrice: (f = msg.getUpdatePrice()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(includeInstance, f) }; if (includeInstance) { @@ -64486,6 +67101,11 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.deserializeBinaryFromReader); msg.setTokenConfigUpdate(value); break; + case 8: + var value = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.deserializeBinaryFromReader); + msg.setUpdatePrice(value); + break; default: reader.skipField(); break; @@ -64571,6 +67191,14 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.serializeBinaryToWriter ); } + f = message.getUpdatePrice(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.serializeBinaryToWriter + ); + } }; @@ -64833,6 +67461,43 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV }; +/** + * optional UpdateDirectPurchasePriceEvent update_price = 8; + * @return {?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.prototype.getUpdatePrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent, 8)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} returns this +*/ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.prototype.setUpdatePrice = function(value) { + return jspb.Message.setOneofWrapperField(this, 8, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.prototype.clearUpdatePrice = function() { + return this.setUpdatePrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.prototype.hasUpdatePrice = function() { + return jspb.Message.getField(this, 8) != null; +}; + + diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h index 88b3f2576d5..37789dc9ffc 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h @@ -102,6 +102,9 @@ CF_EXTERN_C_BEGIN @class GetGroupActionsResponse_GetGroupActionsResponseV0_TokenConfigUpdateEvent; @class GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent; @class GetGroupActionsResponse_GetGroupActionsResponseV0_UnfreezeEvent; +@class GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent; +@class GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity; +@class GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule; @class GetGroupInfoRequest_GetGroupInfoRequestV0; @class GetGroupInfoResponse_GetGroupInfoResponseV0; @class GetGroupInfoResponse_GetGroupInfoResponseV0_GroupInfo; @@ -191,6 +194,13 @@ CF_EXTERN_C_BEGIN @class GetStatusResponse_GetStatusResponseV0_Version_Protocol_Drive; @class GetStatusResponse_GetStatusResponseV0_Version_Protocol_Tenderdash; @class GetStatusResponse_GetStatusResponseV0_Version_Software; +@class GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0; +@class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0; +@class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price; +@class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity; +@class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule; +@class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry; +@class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices; @class GetTokenPreProgrammedDistributionsRequest_GetTokenPreProgrammedDistributionsRequestV0; @class GetTokenPreProgrammedDistributionsRequest_GetTokenPreProgrammedDistributionsRequestV0_StartAtInfo; @class GetTokenPreProgrammedDistributionsResponse_GetTokenPreProgrammedDistributionsResponseV0; @@ -5855,6 +5865,192 @@ GPB_FINAL @interface GetTokenStatusesResponse_GetTokenStatusesResponseV0_TokenSt @end +#pragma mark - GetTokenDirectPurchasePricesRequest + +typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_FieldNumber) { + GetTokenDirectPurchasePricesRequest_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_Version_OneOfCase) { + GetTokenDirectPurchasePricesRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, + GetTokenDirectPurchasePricesRequest_Version_OneOfCase_V0 = 1, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesRequest : GPBMessage + +@property(nonatomic, readonly) GetTokenDirectPurchasePricesRequest_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 *v0; + +@end + +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void GetTokenDirectPurchasePricesRequest_ClearVersionOneOfCase(GetTokenDirectPurchasePricesRequest *message); + +#pragma mark - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 + +typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber) { + GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_TokenIdsArray = 1, + GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_Prove = 2, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenIdsArray; +/** The number of items in @c tokenIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger tokenIdsArray_Count; + +@property(nonatomic, readwrite) BOOL prove; + +@end + +#pragma mark - GetTokenDirectPurchasePricesResponse + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_FieldNumber) { + GetTokenDirectPurchasePricesResponse_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_Version_OneOfCase) { + GetTokenDirectPurchasePricesResponse_Version_OneOfCase_GPBUnsetOneOfCase = 0, + GetTokenDirectPurchasePricesResponse_Version_OneOfCase_V0 = 1, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse : GPBMessage + +@property(nonatomic, readonly) GetTokenDirectPurchasePricesResponse_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 *v0; + +@end + +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void GetTokenDirectPurchasePricesResponse_ClearVersionOneOfCase(GetTokenDirectPurchasePricesResponse *message); + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_FieldNumber) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_FieldNumber_TokenDirectPurchasePrices = 1, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_FieldNumber_Proof = 2, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_FieldNumber_Metadata = 3, +}; + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Result_OneOfCase) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Result_OneOfCase_GPBUnsetOneOfCase = 0, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Result_OneOfCase_TokenDirectPurchasePrices = 1, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Result_OneOfCase_Proof = 2, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 : GPBMessage + +@property(nonatomic, readonly) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Result_OneOfCase resultOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices *tokenDirectPurchasePrices; + +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; + +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + +/** + * Clears whatever value was set for the oneof 'result'. + **/ +void GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_ClearResultOneOfCase(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 *message); + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity_FieldNumber) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity_FieldNumber_Quantity = 1, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity_FieldNumber_Price = 2, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity : GPBMessage + +@property(nonatomic, readwrite) uint64_t quantity; + +@property(nonatomic, readwrite) uint64_t price; + +@end + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule_FieldNumber) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule_FieldNumber_PriceForQuantityArray = 1, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *priceForQuantityArray; +/** The number of items in @c priceForQuantityArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger priceForQuantityArray_Count; + +@end + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber_FixedPrice = 1, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber_VariablePrice = 2, +}; + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase_GPBUnsetOneOfCase = 0, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase_FixedPrice = 1, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase_VariablePrice = 2, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price : GPBMessage + +@property(nonatomic, readonly) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase priceOneOfCase; + +@property(nonatomic, readwrite) uint64_t fixedPrice; + +@property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule *variablePrice; + +@end + +/** + * Clears whatever value was set for the oneof 'price'. + **/ +void GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_ClearPriceOneOfCase(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price *message); + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_TokenId = 1, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_Price = 2, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *tokenId; + +@property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price *price; +/** Test to see if @c price has been set. */ +@property(nonatomic, readwrite) BOOL hasPrice; + +@end + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices + +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber_TokenDirectPurchasePriceArray = 1, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenDirectPurchasePriceArray; +/** The number of items in @c tokenDirectPurchasePriceArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger tokenDirectPurchasePriceArray_Count; + +@end + #pragma mark - GetTokenPreProgrammedDistributionsRequest typedef GPB_ENUM(GetTokenPreProgrammedDistributionsRequest_FieldNumber) { @@ -6815,6 +7011,72 @@ GPB_FINAL @interface GetGroupActionsResponse_GetGroupActionsResponseV0_TokenConf @end +#pragma mark - GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent + +typedef GPB_ENUM(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_FieldNumber) { + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_FieldNumber_FixedPrice = 1, + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_FieldNumber_VariablePrice = 2, + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_FieldNumber_PublicNote = 3, +}; + +typedef GPB_ENUM(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_Price_OneOfCase) { + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_Price_OneOfCase_GPBUnsetOneOfCase = 0, + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_Price_OneOfCase_FixedPrice = 1, + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_Price_OneOfCase_VariablePrice = 2, +}; + +/** + * UpdatePrice event + **/ +GPB_FINAL @interface GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent : GPBMessage + +@property(nonatomic, readonly) GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_Price_OneOfCase priceOneOfCase; + +@property(nonatomic, readwrite) uint64_t fixedPrice; + +@property(nonatomic, readwrite, strong, null_resettable) GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule *variablePrice; + +/** Public note */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *publicNote; +/** Test to see if @c publicNote has been set. */ +@property(nonatomic, readwrite) BOOL hasPublicNote; + +@end + +/** + * Clears whatever value was set for the oneof 'price'. + **/ +void GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_ClearPriceOneOfCase(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent *message); + +#pragma mark - GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity + +typedef GPB_ENUM(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity_FieldNumber) { + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity_FieldNumber_Quantity = 1, + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity_FieldNumber_Price = 2, +}; + +GPB_FINAL @interface GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity : GPBMessage + +@property(nonatomic, readwrite) uint64_t quantity; + +@property(nonatomic, readwrite) uint64_t price; + +@end + +#pragma mark - GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule + +typedef GPB_ENUM(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule_FieldNumber) { + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule_FieldNumber_PriceForQuantityArray = 1, +}; + +GPB_FINAL @interface GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *priceForQuantityArray; +/** The number of items in @c priceForQuantityArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger priceForQuantityArray_Count; + +@end + #pragma mark - GetGroupActionsResponse_GetGroupActionsResponseV0_GroupActionEvent typedef GPB_ENUM(GetGroupActionsResponse_GetGroupActionsResponseV0_GroupActionEvent_FieldNumber) { @@ -6935,6 +7197,7 @@ typedef GPB_ENUM(GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_Fi GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_FieldNumber_DestroyFrozenFunds = 5, GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_FieldNumber_EmergencyAction = 6, GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_FieldNumber_TokenConfigUpdate = 7, + GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_FieldNumber_UpdatePrice = 8, }; typedef GPB_ENUM(GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_Type_OneOfCase) { @@ -6946,6 +7209,7 @@ typedef GPB_ENUM(GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_Ty GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_Type_OneOfCase_DestroyFrozenFunds = 5, GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_Type_OneOfCase_EmergencyAction = 6, GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_Type_OneOfCase_TokenConfigUpdate = 7, + GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_Type_OneOfCase_UpdatePrice = 8, }; /** @@ -6976,6 +7240,9 @@ GPB_FINAL @interface GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEven /** Token configuration update details */ @property(nonatomic, readwrite, strong, null_resettable) GetGroupActionsResponse_GetGroupActionsResponseV0_TokenConfigUpdateEvent *tokenConfigUpdate; +/** Updating the token direct selling price */ +@property(nonatomic, readwrite, strong, null_resettable) GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent *updatePrice; + @end /** diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m index bc611b4ac7a..9e41dcea392 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m @@ -131,6 +131,9 @@ GPBObjCClassDeclaration(GetGroupActionsResponse_GetGroupActionsResponseV0_TokenConfigUpdateEvent); GPBObjCClassDeclaration(GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent); GPBObjCClassDeclaration(GetGroupActionsResponse_GetGroupActionsResponseV0_UnfreezeEvent); +GPBObjCClassDeclaration(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent); +GPBObjCClassDeclaration(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity); +GPBObjCClassDeclaration(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule); GPBObjCClassDeclaration(GetGroupInfoRequest); GPBObjCClassDeclaration(GetGroupInfoRequest_GetGroupInfoRequestV0); GPBObjCClassDeclaration(GetGroupInfoResponse); @@ -262,6 +265,15 @@ GPBObjCClassDeclaration(GetStatusResponse_GetStatusResponseV0_Version_Protocol_Drive); GPBObjCClassDeclaration(GetStatusResponse_GetStatusResponseV0_Version_Protocol_Tenderdash); GPBObjCClassDeclaration(GetStatusResponse_GetStatusResponseV0_Version_Software); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesRequest); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry); +GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices); GPBObjCClassDeclaration(GetTokenPreProgrammedDistributionsRequest); GPBObjCClassDeclaration(GetTokenPreProgrammedDistributionsRequest_GetTokenPreProgrammedDistributionsRequestV0); GPBObjCClassDeclaration(GetTokenPreProgrammedDistributionsRequest_GetTokenPreProgrammedDistributionsRequestV0_StartAtInfo); @@ -15006,6 +15018,531 @@ + (GPBDescriptor *)descriptor { @end +#pragma mark - GetTokenDirectPurchasePricesRequest + +@implementation GetTokenDirectPurchasePricesRequest + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct GetTokenDirectPurchasePricesRequest__storage_ { + uint32_t _has_storage_[2]; + GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 *v0; +} GetTokenDirectPurchasePricesRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "v0", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0), + .number = GetTokenDirectPurchasePricesRequest_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesRequest__storage_, v0), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "version", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetTokenDirectPurchasePricesRequest_ClearVersionOneOfCase(GetTokenDirectPurchasePricesRequest *message) { + GPBDescriptor *descriptor = [GetTokenDirectPurchasePricesRequest descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 + +@implementation GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 + +@dynamic tokenIdsArray, tokenIdsArray_Count; +@dynamic prove; + +typedef struct GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *tokenIdsArray; +} GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "tokenIdsArray", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_TokenIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_, tokenIdsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_Prove, + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetTokenDirectPurchasePricesResponse + +@implementation GetTokenDirectPurchasePricesResponse + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct GetTokenDirectPurchasePricesResponse__storage_ { + uint32_t _has_storage_[2]; + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 *v0; +} GetTokenDirectPurchasePricesResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "v0", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0), + .number = GetTokenDirectPurchasePricesResponse_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse__storage_, v0), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "version", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetTokenDirectPurchasePricesResponse_ClearVersionOneOfCase(GetTokenDirectPurchasePricesResponse *message) { + GPBDescriptor *descriptor = [GetTokenDirectPurchasePricesResponse descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 + +@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 + +@dynamic resultOneOfCase; +@dynamic tokenDirectPurchasePrices; +@dynamic proof; +@dynamic hasMetadata, metadata; + +typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0__storage_ { + uint32_t _has_storage_[2]; + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices *tokenDirectPurchasePrices; + Proof *proof; + ResponseMetadata *metadata; +} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "tokenDirectPurchasePrices", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices), + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_FieldNumber_TokenDirectPurchasePrices, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0__storage_, tokenDirectPurchasePrices), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_FieldNumber_Proof, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_FieldNumber_Metadata, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "result", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_ClearResultOneOfCase(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 *message) { + GPBDescriptor *descriptor = [GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0 descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity + +@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity + +@dynamic quantity; +@dynamic price; + +typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity__storage_ { + uint32_t _has_storage_[1]; + uint64_t quantity; + uint64_t price; +} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "quantity", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity_FieldNumber_Quantity, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity__storage_, quantity), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt64, + }, + { + .name = "price", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity_FieldNumber_Price, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity__storage_, price), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt64, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule + +@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule + +@dynamic priceForQuantityArray, priceForQuantityArray_Count; + +typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *priceForQuantityArray; +} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "priceForQuantityArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity), + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule_FieldNumber_PriceForQuantityArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule__storage_, priceForQuantityArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price + +@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price + +@dynamic priceOneOfCase; +@dynamic fixedPrice; +@dynamic variablePrice; + +typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_ { + uint32_t _has_storage_[2]; + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule *variablePrice; + uint64_t fixedPrice; +} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "fixedPrice", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber_FixedPrice, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_, fixedPrice), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeUInt64, + }, + { + .name = "variablePrice", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule), + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber_VariablePrice, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_, variablePrice), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "price", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_ClearPriceOneOfCase(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price *message) { + GPBDescriptor *descriptor = [GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry + +@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry + +@dynamic tokenId; +@dynamic hasPrice, price; + +typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_ { + uint32_t _has_storage_[1]; + NSData *tokenId; + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price *price; +} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "tokenId", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_TokenId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_, tokenId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "price", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price), + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_Price, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_, price), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices + +@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices + +@dynamic tokenDirectPurchasePriceArray, tokenDirectPurchasePriceArray_Count; + +typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *tokenDirectPurchasePriceArray; +} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "tokenDirectPurchasePriceArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry), + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber_TokenDirectPurchasePriceArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_, tokenDirectPurchasePriceArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + #pragma mark - GetTokenPreProgrammedDistributionsRequest @implementation GetTokenPreProgrammedDistributionsRequest @@ -17744,6 +18281,189 @@ + (GPBDescriptor *)descriptor { @end +#pragma mark - GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent + +@implementation GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent + +@dynamic priceOneOfCase; +@dynamic fixedPrice; +@dynamic variablePrice; +@dynamic hasPublicNote, publicNote; + +typedef struct GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent__storage_ { + uint32_t _has_storage_[2]; + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule *variablePrice; + NSString *publicNote; + uint64_t fixedPrice; +} GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "fixedPrice", + .dataTypeSpecific.clazz = Nil, + .number = GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_FieldNumber_FixedPrice, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent__storage_, fixedPrice), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeUInt64, + }, + { + .name = "variablePrice", + .dataTypeSpecific.clazz = GPBObjCClass(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule), + .number = GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_FieldNumber_VariablePrice, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent__storage_, variablePrice), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "publicNote", + .dataTypeSpecific.clazz = Nil, + .number = GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_FieldNumber_PublicNote, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent__storage_, publicNote), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "price", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetGroupActionsResponse_GetGroupActionsResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_ClearPriceOneOfCase(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent *message) { + GPBDescriptor *descriptor = [GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity + +@implementation GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity + +@dynamic quantity; +@dynamic price; + +typedef struct GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity__storage_ { + uint32_t _has_storage_[1]; + uint64_t quantity; + uint64_t price; +} GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "quantity", + .dataTypeSpecific.clazz = Nil, + .number = GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity_FieldNumber_Quantity, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity__storage_, quantity), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt64, + }, + { + .name = "price", + .dataTypeSpecific.clazz = Nil, + .number = GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity_FieldNumber_Price, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity__storage_, price), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt64, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule + +@implementation GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule + +@dynamic priceForQuantityArray, priceForQuantityArray_Count; + +typedef struct GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *priceForQuantityArray; +} GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "priceForQuantityArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PriceForQuantity), + .number = GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule_FieldNumber_PriceForQuantityArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule__storage_, priceForQuantityArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent_PricingSchedule__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + #pragma mark - GetGroupActionsResponse_GetGroupActionsResponseV0_GroupActionEvent @implementation GetGroupActionsResponse_GetGroupActionsResponseV0_GroupActionEvent @@ -18044,6 +18764,7 @@ @implementation GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent @dynamic destroyFrozenFunds; @dynamic emergencyAction; @dynamic tokenConfigUpdate; +@dynamic updatePrice; typedef struct GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent__storage_ { uint32_t _has_storage_[2]; @@ -18054,6 +18775,7 @@ @implementation GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent GetGroupActionsResponse_GetGroupActionsResponseV0_DestroyFrozenFundsEvent *destroyFrozenFunds; GetGroupActionsResponse_GetGroupActionsResponseV0_EmergencyActionEvent *emergencyAction; GetGroupActionsResponse_GetGroupActionsResponseV0_TokenConfigUpdateEvent *tokenConfigUpdate; + GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent *updatePrice; } GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent__storage_; // This method is threadsafe because it is initially called @@ -18125,6 +18847,15 @@ + (GPBDescriptor *)descriptor { .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, + { + .name = "updatePrice", + .dataTypeSpecific.clazz = GPBObjCClass(GetGroupActionsResponse_GetGroupActionsResponseV0_UpdateDirectPurchasePriceEvent), + .number = GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent_FieldNumber_UpdatePrice, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent__storage_, updatePrice), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[GetGroupActionsResponse_GetGroupActionsResponseV0_TokenEvent class] diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h index daff9fedb43..a4aab784717 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h @@ -87,6 +87,8 @@ @class GetProtocolVersionUpgradeVoteStatusResponse; @class GetStatusRequest; @class GetStatusResponse; +@class GetTokenDirectPurchasePricesRequest; +@class GetTokenDirectPurchasePricesResponse; @class GetTokenPreProgrammedDistributionsRequest; @class GetTokenPreProgrammedDistributionsResponse; @class GetTokenStatusesRequest; @@ -292,6 +294,10 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCUnaryProtoCall *)getTokenStatusesWithMessage:(GetTokenStatusesRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; +#pragma mark getTokenDirectPurchasePrices(GetTokenDirectPurchasePricesRequest) returns (GetTokenDirectPurchasePricesResponse) + +- (GRPCUnaryProtoCall *)getTokenDirectPurchasePricesWithMessage:(GetTokenDirectPurchasePricesRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + #pragma mark getTokenPreProgrammedDistributions(GetTokenPreProgrammedDistributionsRequest) returns (GetTokenPreProgrammedDistributionsResponse) - (GRPCUnaryProtoCall *)getTokenPreProgrammedDistributionsWithMessage:(GetTokenPreProgrammedDistributionsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; @@ -633,6 +639,13 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetTokenStatusesWithRequest:(GetTokenStatusesRequest *)request handler:(void(^)(GetTokenStatusesResponse *_Nullable response, NSError *_Nullable error))handler; +#pragma mark getTokenDirectPurchasePrices(GetTokenDirectPurchasePricesRequest) returns (GetTokenDirectPurchasePricesResponse) + +- (void)getTokenDirectPurchasePricesWithRequest:(GetTokenDirectPurchasePricesRequest *)request handler:(void(^)(GetTokenDirectPurchasePricesResponse *_Nullable response, NSError *_Nullable error))handler; + +- (GRPCProtoCall *)RPCTogetTokenDirectPurchasePricesWithRequest:(GetTokenDirectPurchasePricesRequest *)request handler:(void(^)(GetTokenDirectPurchasePricesResponse *_Nullable response, NSError *_Nullable error))handler; + + #pragma mark getTokenPreProgrammedDistributions(GetTokenPreProgrammedDistributionsRequest) returns (GetTokenPreProgrammedDistributionsResponse) - (void)getTokenPreProgrammedDistributionsWithRequest:(GetTokenPreProgrammedDistributionsRequest *)request handler:(void(^)(GetTokenPreProgrammedDistributionsResponse *_Nullable response, NSError *_Nullable error))handler; diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m index 9f91540f655..1722308dd94 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m @@ -875,6 +875,26 @@ - (GRPCUnaryProtoCall *)getTokenStatusesWithMessage:(GetTokenStatusesRequest *)m responseClass:[GetTokenStatusesResponse class]]; } +#pragma mark getTokenDirectPurchasePrices(GetTokenDirectPurchasePricesRequest) returns (GetTokenDirectPurchasePricesResponse) + +- (void)getTokenDirectPurchasePricesWithRequest:(GetTokenDirectPurchasePricesRequest *)request handler:(void(^)(GetTokenDirectPurchasePricesResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetTokenDirectPurchasePricesWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (GRPCProtoCall *)RPCTogetTokenDirectPurchasePricesWithRequest:(GetTokenDirectPurchasePricesRequest *)request handler:(void(^)(GetTokenDirectPurchasePricesResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getTokenDirectPurchasePrices" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetTokenDirectPurchasePricesResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +- (GRPCUnaryProtoCall *)getTokenDirectPurchasePricesWithMessage:(GetTokenDirectPurchasePricesRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"getTokenDirectPurchasePrices" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[GetTokenDirectPurchasePricesResponse class]]; +} + #pragma mark getTokenPreProgrammedDistributions(GetTokenPreProgrammedDistributionsRequest) returns (GetTokenPreProgrammedDistributionsResponse) - (void)getTokenPreProgrammedDistributionsWithRequest:(GetTokenPreProgrammedDistributionsRequest *)request handler:(void(^)(GetTokenPreProgrammedDistributionsResponse *_Nullable response, NSError *_Nullable error))handler{ diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py index 2d51403b537..1e1e5f81541 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py @@ -23,7 +23,7 @@ syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x98\x01\n\x10ResponseMetadata\x12\x12\n\x06height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x13\n\x07time_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbc\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb6\x01\n\x1aGetIdentityNonceResponseV0\x12\x1c\n\x0eidentity_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xe5\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc7\x01\n\"GetIdentityContractNonceResponseV0\x12%\n\x17identity_contract_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbd\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xb1\x01\n\x1cGetIdentityBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb1\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\x84\x03\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x12\x42\x61lanceAndRevision\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x08revision\x18\x02 \x01(\x04\x42\x02\x30\x01\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x92\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xe2\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x8a\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aL\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x18\n\x07\x62\x61lance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xdb\x0f\n\x10GetProofsRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0H\x00\x1a\xed\x0e\n\x12GetProofsRequestV0\x12\x62\n\nidentities\x18\x01 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest\x12\x61\n\tcontracts\x18\x02 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest\x12\x61\n\tdocuments\x18\x03 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest\x12_\n\x05votes\x18\x04 \x03(\x0b\x32P.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest\x12{\n\x17identity_token_balances\x18\x05 \x03(\x0b\x32Z.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest\x12u\n\x14identity_token_infos\x18\x06 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest\x12i\n\x0etoken_statuses\x18\x07 \x03(\x0b\x32Q.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest\x1a\xd5\x02\n\x0f\x44ocumentRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12#\n\x1b\x64ocument_type_keeps_history\x18\x03 \x01(\x08\x12\x13\n\x0b\x64ocument_id\x18\x04 \x01(\x0c\x12\x89\x01\n\x19\x64ocument_contested_status\x18\x05 \x01(\x0e\x32\x66.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus\"P\n\x17\x44ocumentContestedStatus\x12\x11\n\rNOT_CONTESTED\x10\x00\x12\x13\n\x0fMAYBE_CONTESTED\x10\x01\x12\r\n\tCONTESTED\x10\x02\x1a\xd1\x01\n\x0fIdentityRequest\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12i\n\x0crequest_type\x18\x02 \x01(\x0e\x32S.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type\">\n\x04Type\x12\x11\n\rFULL_IDENTITY\x10\x00\x12\x0b\n\x07\x42\x41LANCE\x10\x01\x12\x08\n\x04KEYS\x10\x02\x12\x0c\n\x08REVISION\x10\x03\x1a&\n\x0f\x43ontractRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x1a\xe7\x02\n\x11VoteStatusRequest\x12\xa5\x01\n&contested_resource_vote_status_request\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequestH\x00\x1a\x99\x01\n\"ContestedResourceVoteStatusRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x18\n\x10voter_identifier\x18\x05 \x01(\x0c\x42\x0e\n\x0crequest_type\x1a\x44\n\x1bIdentityTokenBalanceRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x0bidentity_id\x18\x02 \x01(\x0c\x1a\x41\n\x18IdentityTokenInfoRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x0bidentity_id\x18\x02 \x01(\x0c\x1a&\n\x12TokenStatusRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x42\t\n\x07version\"\x82\x02\n\x11GetProofsResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0H\x00\x1a\x91\x01\n\x13GetProofsResponseV0\x12\x31\n\x05proof\x18\x01 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc5\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xb0\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xb2\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x9a\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a;\n\x18\x44\x61taContractHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xed\x01\n!GetIdentityByPublicKeyHashRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0H\x00\x1aM\n#GetIdentityByPublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xda\x02\n\"GetIdentityByPublicKeyHashResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0H\x00\x1a\xb6\x01\n$GetIdentityByPublicKeyHashResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x99\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x9c\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\xa6\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1e\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x16\n\nstart_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xde\x04\n\x1cGetContestedResourcesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0H\x00\x1a\xcc\x03\n\x1eGetContestedResourcesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x1a\n\x12start_index_values\x18\x04 \x03(\x0c\x12\x18\n\x10\x65nd_index_values\x18\x05 \x03(\x0c\x12\x89\x01\n\x13start_at_value_info\x18\x06 \x01(\x0b\x32g.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1a\x45\n\x10StartAtValueInfo\x12\x13\n\x0bstart_value\x18\x01 \x01(\x0c\x12\x1c\n\x14start_value_included\x18\x02 \x01(\x08\x42\x16\n\x14_start_at_value_infoB\x08\n\x06_countB\t\n\x07version\"\x88\x04\n\x1dGetContestedResourcesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0H\x00\x1a\xf3\x02\n\x1fGetContestedResourcesResponseV0\x12\x95\x01\n\x19\x63ontested_resource_values\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValuesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a<\n\x17\x43ontestedResourceValues\x12!\n\x19\x63ontested_resource_values\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x05\n\x1cGetVotePollsByEndDateRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0H\x00\x1a\xc0\x04\n\x1eGetVotePollsByEndDateRequestV0\x12\x84\x01\n\x0fstart_time_info\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfoH\x00\x88\x01\x01\x12\x80\x01\n\rend_time_info\x18\x02 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfoH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x13\n\x06offset\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x11\n\tascending\x18\x05 \x01(\x08\x12\r\n\x05prove\x18\x06 \x01(\x08\x1aI\n\x0fStartAtTimeInfo\x12\x19\n\rstart_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13start_time_included\x18\x02 \x01(\x08\x1a\x43\n\rEndAtTimeInfo\x12\x17\n\x0b\x65nd_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x65nd_time_included\x18\x02 \x01(\x08\x42\x12\n\x10_start_time_infoB\x10\n\x0e_end_time_infoB\x08\n\x06_limitB\t\n\x07_offsetB\t\n\x07version\"\x83\x06\n\x1dGetVotePollsByEndDateResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0H\x00\x1a\xee\x04\n\x1fGetVotePollsByEndDateResponseV0\x12\x9c\x01\n\x18vote_polls_by_timestamps\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestampsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aV\n\x1eSerializedVotePollsByTimestamp\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x15serialized_vote_polls\x18\x02 \x03(\x0c\x1a\xd7\x01\n\x1fSerializedVotePollsByTimestamps\x12\x99\x01\n\x18vote_polls_by_timestamps\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xff\x06\n$GetContestedResourceVoteStateRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0H\x00\x1a\xd5\x05\n&GetContestedResourceVoteStateRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x86\x01\n\x0bresult_type\x18\x05 \x01(\x0e\x32q.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType\x12\x36\n.allow_include_locked_and_abstaining_vote_tally\x18\x06 \x01(\x08\x12\xa3\x01\n\x18start_at_identifier_info\x18\x07 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x08 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\"I\n\nResultType\x12\r\n\tDOCUMENTS\x10\x00\x12\x0e\n\nVOTE_TALLY\x10\x01\x12\x1c\n\x18\x44OCUMENTS_AND_VOTE_TALLY\x10\x02\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\x94\x0c\n%GetContestedResourceVoteStateResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0H\x00\x1a\xe7\n\n\'GetContestedResourceVoteStateResponseV0\x12\xae\x01\n\x1d\x63ontested_resource_contenders\x18\x01 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContendersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xda\x03\n\x10\x46inishedVoteInfo\x12\xad\x01\n\x15\x66inished_vote_outcome\x18\x01 \x01(\x0e\x32\x8d\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome\x12\x1f\n\x12won_by_identity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12$\n\x18\x66inished_at_block_height\x18\x03 \x01(\x04\x42\x02\x30\x01\x12%\n\x1d\x66inished_at_core_block_height\x18\x04 \x01(\r\x12%\n\x19\x66inished_at_block_time_ms\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x66inished_at_epoch\x18\x06 \x01(\r\"O\n\x13\x46inishedVoteOutcome\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x16\n\x12NO_PREVIOUS_WINNER\x10\x02\x42\x15\n\x13_won_by_identity_id\x1a\xc4\x03\n\x1b\x43ontestedResourceContenders\x12\x86\x01\n\ncontenders\x18\x01 \x03(\x0b\x32r.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender\x12\x1f\n\x12\x61\x62stain_vote_tally\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1c\n\x0flock_vote_tally\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x9a\x01\n\x12\x66inished_vote_info\x18\x04 \x01(\x0b\x32y.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfoH\x02\x88\x01\x01\x42\x15\n\x13_abstain_vote_tallyB\x12\n\x10_lock_vote_tallyB\x15\n\x13_finished_vote_info\x1ak\n\tContender\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x17\n\nvote_count\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08\x64ocument\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\r\n\x0b_vote_countB\x0b\n\t_documentB\x08\n\x06resultB\t\n\x07version\"\xd5\x05\n,GetContestedResourceVotersForIdentityRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0H\x00\x1a\x92\x04\n.GetContestedResourceVotersForIdentityRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x15\n\rcontestant_id\x18\x05 \x01(\x0c\x12\xb4\x01\n\x18start_at_identifier_info\x18\x06 \x01(\x0b\x32\x8c\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\xf1\x04\n-GetContestedResourceVotersForIdentityResponse\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0H\x00\x1a\xab\x03\n/GetContestedResourceVotersForIdentityResponseV0\x12\xb6\x01\n\x19\x63ontested_resource_voters\x18\x01 \x01(\x0b\x32\x90\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVotersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x43\n\x17\x43ontestedResourceVoters\x12\x0e\n\x06voters\x18\x01 \x03(\x0c\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xad\x05\n(GetContestedResourceIdentityVotesRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0H\x00\x1a\xf7\x03\n*GetContestedResourceIdentityVotesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0forder_ascending\x18\x04 \x01(\x08\x12\xae\x01\n\x1astart_at_vote_poll_id_info\x18\x05 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfoH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x61\n\x15StartAtVotePollIdInfo\x12 \n\x18start_at_poll_identifier\x18\x01 \x01(\x0c\x12&\n\x1estart_poll_identifier_included\x18\x02 \x01(\x08\x42\x1d\n\x1b_start_at_vote_poll_id_infoB\t\n\x07version\"\xc8\n\n)GetContestedResourceIdentityVotesResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0H\x00\x1a\x8f\t\n+GetContestedResourceIdentityVotesResponseV0\x12\xa1\x01\n\x05votes\x18\x01 \x01(\x0b\x32\x8f\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xf7\x01\n\x1e\x43ontestedResourceIdentityVotes\x12\xba\x01\n!contested_resource_identity_votes\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x1a\xad\x02\n\x12ResourceVoteChoice\x12\xad\x01\n\x10vote_choice_type\x18\x01 \x01(\x0e\x32\x92\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType\x12\x18\n\x0bidentity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\"=\n\x0eVoteChoiceType\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\x0b\n\x07\x41\x42STAIN\x10\x01\x12\x08\n\x04LOCK\x10\x02\x42\x0e\n\x0c_identity_id\x1a\x95\x02\n\x1d\x43ontestedResourceIdentityVote\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\'\n\x1fserialized_index_storage_values\x18\x03 \x03(\x0c\x12\x99\x01\n\x0bvote_choice\x18\x04 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoiceB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n%GetPrefundedSpecializedBalanceRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0H\x00\x1a\x44\n\'GetPrefundedSpecializedBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xed\x02\n&GetPrefundedSpecializedBalanceResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0H\x00\x1a\xbd\x01\n(GetPrefundedSpecializedBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xd0\x01\n GetTotalCreditsInPlatformRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0H\x00\x1a\x33\n\"GetTotalCreditsInPlatformRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xd9\x02\n!GetTotalCreditsInPlatformResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0H\x00\x1a\xb8\x01\n#GetTotalCreditsInPlatformResponseV0\x12\x15\n\x07\x63redits\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x16GetPathElementsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0H\x00\x1a\x45\n\x18GetPathElementsRequestV0\x12\x0c\n\x04path\x18\x01 \x03(\x0c\x12\x0c\n\x04keys\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xa3\x03\n\x17GetPathElementsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0H\x00\x1a\xa0\x02\n\x19GetPathElementsResponseV0\x12i\n\x08\x65lements\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ElementsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1c\n\x08\x45lements\x12\x10\n\x08\x65lements\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\x81\x01\n\x10GetStatusRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0H\x00\x1a\x14\n\x12GetStatusRequestV0B\t\n\x07version\"\xd0\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xdf\x0f\n\x13GetStatusResponseV0\x12Y\n\x07version\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version\x12S\n\x04node\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node\x12U\n\x05\x63hain\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain\x12Y\n\x07network\x18\x04 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network\x12^\n\nstate_sync\x18\x05 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync\x12S\n\x04time\x18\x06 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time\x1a\xee\x04\n\x07Version\x12\x63\n\x08software\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software\x12\x63\n\x08protocol\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol\x1a^\n\x08Software\x12\x0c\n\x04\x64\x61pi\x18\x01 \x01(\t\x12\x12\n\x05\x64rive\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntenderdash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_driveB\r\n\x0b_tenderdash\x1a\xb8\x02\n\x08Protocol\x12p\n\ntenderdash\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash\x12\x66\n\x05\x64rive\x18\x02 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive\x1a(\n\nTenderdash\x12\x0b\n\x03p2p\x18\x01 \x01(\r\x12\r\n\x05\x62lock\x18\x02 \x01(\r\x1a(\n\x05\x44rive\x12\x0e\n\x06latest\x18\x03 \x01(\r\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\r\x1a\x7f\n\x04Time\x12\x11\n\x05local\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x05\x62lock\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x18\n\x07genesis\x18\x03 \x01(\x04\x42\x02\x30\x01H\x01\x88\x01\x01\x12\x12\n\x05\x65poch\x18\x04 \x01(\rH\x02\x88\x01\x01\x42\x08\n\x06_blockB\n\n\x08_genesisB\x08\n\x06_epoch\x1a<\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x0bpro_tx_hash\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_pro_tx_hash\x1a\xb3\x02\n\x05\x43hain\x12\x13\n\x0b\x63\x61tching_up\x18\x01 \x01(\x08\x12\x19\n\x11latest_block_hash\x18\x02 \x01(\x0c\x12\x17\n\x0flatest_app_hash\x18\x03 \x01(\x0c\x12\x1f\n\x13latest_block_height\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13\x65\x61rliest_block_hash\x18\x05 \x01(\x0c\x12\x19\n\x11\x65\x61rliest_app_hash\x18\x06 \x01(\x0c\x12!\n\x15\x65\x61rliest_block_height\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15max_peer_block_height\x18\t \x01(\x04\x42\x02\x30\x01\x12%\n\x18\x63ore_chain_locked_height\x18\n \x01(\rH\x00\x88\x01\x01\x42\x1b\n\x19_core_chain_locked_height\x1a\x43\n\x07Network\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\t\x12\x13\n\x0bpeers_count\x18\x02 \x01(\r\x12\x11\n\tlistening\x18\x03 \x01(\x08\x1a\x85\x02\n\tStateSync\x12\x1d\n\x11total_synced_time\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eremaining_time\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0ftotal_snapshots\x18\x03 \x01(\r\x12\"\n\x16\x63hunk_process_avg_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x0fsnapshot_height\x18\x05 \x01(\x04\x42\x02\x30\x01\x12!\n\x15snapshot_chunks_count\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x11\x62\x61\x63kfilled_blocks\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15\x62\x61\x63kfill_blocks_total\x18\x08 \x01(\x04\x42\x02\x30\x01\x42\t\n\x07version\"\xb1\x01\n\x1cGetCurrentQuorumsInfoRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0H\x00\x1a \n\x1eGetCurrentQuorumsInfoRequestV0B\t\n\x07version\"\xa1\x05\n\x1dGetCurrentQuorumsInfoResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0H\x00\x1a\x46\n\x0bValidatorV0\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07node_ip\x18\x02 \x01(\t\x12\x11\n\tis_banned\x18\x03 \x01(\x08\x1a\xaf\x01\n\x0eValidatorSetV0\x12\x13\n\x0bquorum_hash\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ore_height\x18\x02 \x01(\r\x12U\n\x07members\x18\x03 \x03(\x0b\x32\x44.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0\x12\x1c\n\x14threshold_public_key\x18\x04 \x01(\x0c\x1a\x92\x02\n\x1fGetCurrentQuorumsInfoResponseV0\x12\x15\n\rquorum_hashes\x18\x01 \x03(\x0c\x12\x1b\n\x13\x63urrent_quorum_hash\x18\x02 \x01(\x0c\x12_\n\x0evalidator_sets\x18\x03 \x03(\x0b\x32G.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0\x12\x1b\n\x13last_block_proposer\x18\x04 \x01(\x0c\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version\"\xf4\x01\n\x1fGetIdentityTokenBalancesRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0H\x00\x1aZ\n!GetIdentityTokenBalancesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xad\x05\n GetIdentityTokenBalancesResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0H\x00\x1a\x8f\x04\n\"GetIdentityTokenBalancesResponseV0\x12\x86\x01\n\x0etoken_balances\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aG\n\x11TokenBalanceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x9a\x01\n\rTokenBalances\x12\x88\x01\n\x0etoken_balances\x18\x01 \x03(\x0b\x32p.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xfc\x01\n!GetIdentitiesTokenBalancesRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0H\x00\x1a\\\n#GetIdentitiesTokenBalancesRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xf2\x05\n\"GetIdentitiesTokenBalancesResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0H\x00\x1a\xce\x04\n$GetIdentitiesTokenBalancesResponseV0\x12\x9b\x01\n\x17identity_token_balances\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aR\n\x19IdentityTokenBalanceEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\xb7\x01\n\x15IdentityTokenBalances\x12\x9d\x01\n\x17identity_token_balances\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xe8\x01\n\x1cGetIdentityTokenInfosRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0H\x00\x1aW\n\x1eGetIdentityTokenInfosRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x98\x06\n\x1dGetIdentityTokenInfosResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0H\x00\x1a\x83\x05\n\x1fGetIdentityTokenInfosResponseV0\x12z\n\x0btoken_infos\x18\x01 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb0\x01\n\x0eTokenInfoEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x82\x01\n\x04info\x18\x02 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x8a\x01\n\nTokenInfos\x12|\n\x0btoken_infos\x18\x01 \x03(\x0b\x32g.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n\x1eGetIdentitiesTokenInfosRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0H\x00\x1aY\n GetIdentitiesTokenInfosRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xca\x06\n\x1fGetIdentitiesTokenInfosResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0H\x00\x1a\xaf\x05\n!GetIdentitiesTokenInfosResponseV0\x12\x8f\x01\n\x14identity_token_infos\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb7\x01\n\x0eTokenInfoEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x86\x01\n\x04info\x18\x02 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x97\x01\n\x12IdentityTokenInfos\x12\x80\x01\n\x0btoken_infos\x18\x01 \x03(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbf\x01\n\x17GetTokenStatusesRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0H\x00\x1a=\n\x19GetTokenStatusesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xe7\x04\n\x18GetTokenStatusesResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0H\x00\x1a\xe1\x03\n\x1aGetTokenStatusesResponseV0\x12v\n\x0etoken_statuses\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x44\n\x10TokenStatusEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x06paused\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_paused\x1a\x88\x01\n\rTokenStatuses\x12w\n\x0etoken_statuses\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntryB\x08\n\x06resultB\t\n\x07version\"\xef\x04\n)GetTokenPreProgrammedDistributionsRequest\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0H\x00\x1a\xb6\x03\n+GetTokenPreProgrammedDistributionsRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x98\x01\n\rstart_at_info\x18\x02 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfoH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x1a\x9a\x01\n\x0bStartAtInfo\x12\x15\n\rstart_time_ms\x18\x01 \x01(\x04\x12\x1c\n\x0fstart_recipient\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12%\n\x18start_recipient_included\x18\x03 \x01(\x08H\x01\x88\x01\x01\x42\x12\n\x10_start_recipientB\x1b\n\x19_start_recipient_includedB\x10\n\x0e_start_at_infoB\x08\n\x06_limitB\t\n\x07version\"\xec\x07\n*GetTokenPreProgrammedDistributionsResponse\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0H\x00\x1a\xaf\x06\n,GetTokenPreProgrammedDistributionsResponseV0\x12\xa5\x01\n\x13token_distributions\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a>\n\x16TokenDistributionEntry\x12\x14\n\x0crecipient_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x1a\xd4\x01\n\x1bTokenTimedDistributionEntry\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\xa1\x01\n\rdistributions\x18\x02 \x03(\x0b\x32\x89\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry\x1a\xc3\x01\n\x12TokenDistributions\x12\xac\x01\n\x13token_distributions\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntryB\x08\n\x06resultB\t\n\x07version\"\xca\x01\n\x1aGetTokenTotalSupplyRequest\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0H\x00\x1a?\n\x1cGetTokenTotalSupplyRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xaf\x04\n\x1bGetTokenTotalSupplyResponse\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0H\x00\x1a\xa0\x03\n\x1dGetTokenTotalSupplyResponseV0\x12\x88\x01\n\x12token_total_supply\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1ax\n\x15TokenTotalSupplyEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x30\n(total_aggregated_amount_in_user_accounts\x18\x02 \x01(\x04\x12\x1b\n\x13total_system_amount\x18\x03 \x01(\x04\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x01\n\x13GetGroupInfoRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0H\x00\x1a\\\n\x15GetGroupInfoRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xd4\x05\n\x14GetGroupInfoResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0H\x00\x1a\xda\x04\n\x16GetGroupInfoResponseV0\x12\x66\n\ngroup_info\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x98\x01\n\x0eGroupInfoEntry\x12h\n\x07members\x18\x01 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x02 \x01(\r\x1a\x8a\x01\n\tGroupInfo\x12n\n\ngroup_info\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntryH\x00\x88\x01\x01\x42\r\n\x0b_group_infoB\x08\n\x06resultB\t\n\x07version\"\xed\x03\n\x14GetGroupInfosRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0H\x00\x1au\n\x1cStartAtGroupContractPosition\x12%\n\x1dstart_group_contract_position\x18\x01 \x01(\r\x12.\n&start_group_contract_position_included\x18\x02 \x01(\x08\x1a\xfc\x01\n\x16GetGroupInfosRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12{\n start_at_group_contract_position\x18\x02 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPositionH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x42#\n!_start_at_group_contract_positionB\x08\n\x06_countB\t\n\x07version\"\xff\x05\n\x15GetGroupInfosResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0H\x00\x1a\x82\x05\n\x17GetGroupInfosResponseV0\x12j\n\x0bgroup_infos\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\xc3\x01\n\x16GroupPositionInfoEntry\x12\x1f\n\x17group_contract_position\x18\x01 \x01(\r\x12j\n\x07members\x18\x02 \x03(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x03 \x01(\r\x1a\x82\x01\n\nGroupInfos\x12t\n\x0bgroup_infos\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbe\x04\n\x16GetGroupActionsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0H\x00\x1aL\n\x0fStartAtActionId\x12\x17\n\x0fstart_action_id\x18\x01 \x01(\x0c\x12 \n\x18start_action_id_included\x18\x02 \x01(\x08\x1a\xc8\x02\n\x18GetGroupActionsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12N\n\x06status\x18\x03 \x01(\x0e\x32>.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus\x12\x62\n\x12start_at_action_id\x18\x04 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionIdH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x42\x15\n\x13_start_at_action_idB\x08\n\x06_count\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\xd1\x19\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\xce\x18\n\x19GetGroupActionsResponseV0\x12r\n\rgroup_actions\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a[\n\tMintEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x14\n\x0crecipient_id\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x45\n\tBurnEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aJ\n\x0b\x46reezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aL\n\rUnfreezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x66\n\x17\x44\x65stroyFrozenFundsEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x13SharedEncryptedNote\x12\x18\n\x10sender_key_index\x18\x01 \x01(\r\x12\x1b\n\x13recipient_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a{\n\x15PersonalEncryptedNote\x12!\n\x19root_encryption_key_index\x18\x01 \x01(\r\x12\'\n\x1f\x64\x65rivation_encryption_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a\xe9\x01\n\x14\x45mergencyActionEvent\x12\x81\x01\n\x0b\x61\x63tion_type\x18\x01 \x01(\x0e\x32l.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\"#\n\nActionType\x12\t\n\x05PAUSE\x10\x00\x12\n\n\x06RESUME\x10\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x16TokenConfigUpdateEvent\x12 \n\x18token_config_update_item\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\xfc\x02\n\x10GroupActionEvent\x12n\n\x0btoken_event\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEventH\x00\x12t\n\x0e\x64ocument_event\x18\x02 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEventH\x00\x12t\n\x0e\x63ontract_event\x18\x03 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEventH\x00\x42\x0c\n\nevent_type\x1a\x8b\x01\n\rDocumentEvent\x12r\n\x06\x63reate\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEventH\x00\x42\x06\n\x04type\x1a/\n\x13\x44ocumentCreateEvent\x12\x18\n\x10\x63reated_document\x18\x01 \x01(\x0c\x1a/\n\x13\x43ontractUpdateEvent\x12\x18\n\x10updated_contract\x18\x01 \x01(\x0c\x1a\x8b\x01\n\rContractEvent\x12r\n\x06update\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEventH\x00\x42\x06\n\x04type\x1a\xcb\x06\n\nTokenEvent\x12\x66\n\x04mint\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEventH\x00\x12\x66\n\x04\x62urn\x18\x02 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEventH\x00\x12j\n\x06\x66reeze\x18\x03 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEventH\x00\x12n\n\x08unfreeze\x18\x04 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEventH\x00\x12\x84\x01\n\x14\x64\x65stroy_frozen_funds\x18\x05 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEventH\x00\x12}\n\x10\x65mergency_action\x18\x06 \x01(\x0b\x32\x61.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEventH\x00\x12\x82\x01\n\x13token_config_update\x18\x07 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEventH\x00\x42\x06\n\x04type\x1a\x93\x01\n\x10GroupActionEntry\x12\x11\n\taction_id\x18\x01 \x01(\x0c\x12l\n\x05\x65vent\x18\x02 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent\x1a\x84\x01\n\x0cGroupActions\x12t\n\rgroup_actions\x18\x01 \x03(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntryB\x08\n\x06resultB\t\n\x07version\"\x88\x03\n\x1cGetGroupActionSignersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0H\x00\x1a\xce\x01\n\x1eGetGroupActionSignersRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12T\n\x06status\x18\x03 \x01(\x0e\x32\x44.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus\x12\x11\n\taction_id\x18\x04 \x01(\x0c\x12\r\n\x05prove\x18\x05 \x01(\x08\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\x8b\x05\n\x1dGetGroupActionSignersResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0H\x00\x1a\xf6\x03\n\x1fGetGroupActionSignersResponseV0\x12\x8b\x01\n\x14group_action_signers\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x35\n\x11GroupActionSigner\x12\x11\n\tsigner_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x91\x01\n\x12GroupActionSigners\x12{\n\x07signers\x18\x01 \x03(\x0b\x32j.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignerB\x08\n\x06resultB\t\n\x07version*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\x9a\x30\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\x66\n\tgetProofs\x12+.org.dash.platform.dapi.v0.GetProofsRequest\x1a,.org.dash.platform.dapi.v0.GetProofsResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponse\x12\xa5\x01\n\x1egetProtocolVersionUpgradeState\x12@.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest\x1a\x41.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse\x12\xb4\x01\n#getProtocolVersionUpgradeVoteStatus\x12\x45.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest\x1a\x46.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse\x12r\n\rgetEpochsInfo\x12/.org.dash.platform.dapi.v0.GetEpochsInfoRequest\x1a\x30.org.dash.platform.dapi.v0.GetEpochsInfoResponse\x12\x8a\x01\n\x15getContestedResources\x12\x37.org.dash.platform.dapi.v0.GetContestedResourcesRequest\x1a\x38.org.dash.platform.dapi.v0.GetContestedResourcesResponse\x12\xa2\x01\n\x1dgetContestedResourceVoteState\x12?.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest\x1a@.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse\x12\xba\x01\n%getContestedResourceVotersForIdentity\x12G.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest\x1aH.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse\x12\xae\x01\n!getContestedResourceIdentityVotes\x12\x43.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest\x1a\x44.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse\x12\x8a\x01\n\x15getVotePollsByEndDate\x12\x37.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest\x1a\x38.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse\x12\xa5\x01\n\x1egetPrefundedSpecializedBalance\x12@.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest\x1a\x41.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse\x12\x96\x01\n\x19getTotalCreditsInPlatform\x12;.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest\x1a<.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse\x12x\n\x0fgetPathElements\x12\x31.org.dash.platform.dapi.v0.GetPathElementsRequest\x1a\x32.org.dash.platform.dapi.v0.GetPathElementsResponse\x12\x66\n\tgetStatus\x12+.org.dash.platform.dapi.v0.GetStatusRequest\x1a,.org.dash.platform.dapi.v0.GetStatusResponse\x12\x8a\x01\n\x15getCurrentQuorumsInfo\x12\x37.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest\x1a\x38.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse\x12\x93\x01\n\x18getIdentityTokenBalances\x12:.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse\x12\x99\x01\n\x1agetIdentitiesTokenBalances\x12<.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest\x1a=.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse\x12\x8a\x01\n\x15getIdentityTokenInfos\x12\x37.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse\x12\x90\x01\n\x17getIdentitiesTokenInfos\x12\x39.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest\x1a:.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse\x12{\n\x10getTokenStatuses\x12\x32.org.dash.platform.dapi.v0.GetTokenStatusesRequest\x1a\x33.org.dash.platform.dapi.v0.GetTokenStatusesResponse\x12\xb1\x01\n\"getTokenPreProgrammedDistributions\x12\x44.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest\x1a\x45.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse\x12\x84\x01\n\x13getTokenTotalSupply\x12\x35.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest\x1a\x36.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse\x12o\n\x0cgetGroupInfo\x12..org.dash.platform.dapi.v0.GetGroupInfoRequest\x1a/.org.dash.platform.dapi.v0.GetGroupInfoResponse\x12r\n\rgetGroupInfos\x12/.org.dash.platform.dapi.v0.GetGroupInfosRequest\x1a\x30.org.dash.platform.dapi.v0.GetGroupInfosResponse\x12x\n\x0fgetGroupActions\x12\x31.org.dash.platform.dapi.v0.GetGroupActionsRequest\x1a\x32.org.dash.platform.dapi.v0.GetGroupActionsResponse\x12\x8a\x01\n\x15getGroupActionSigners\x12\x37.org.dash.platform.dapi.v0.GetGroupActionSignersRequest\x1a\x38.org.dash.platform.dapi.v0.GetGroupActionSignersResponseb\x06proto3' + serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x98\x01\n\x10ResponseMetadata\x12\x12\n\x06height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x13\n\x07time_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbc\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb6\x01\n\x1aGetIdentityNonceResponseV0\x12\x1c\n\x0eidentity_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xe5\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc7\x01\n\"GetIdentityContractNonceResponseV0\x12%\n\x17identity_contract_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbd\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xb1\x01\n\x1cGetIdentityBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb1\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\x84\x03\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x12\x42\x61lanceAndRevision\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x08revision\x18\x02 \x01(\x04\x42\x02\x30\x01\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x92\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xe2\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x8a\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aL\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x18\n\x07\x62\x61lance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xdb\x0f\n\x10GetProofsRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0H\x00\x1a\xed\x0e\n\x12GetProofsRequestV0\x12\x62\n\nidentities\x18\x01 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest\x12\x61\n\tcontracts\x18\x02 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.ContractRequest\x12\x61\n\tdocuments\x18\x03 \x03(\x0b\x32N.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest\x12_\n\x05votes\x18\x04 \x03(\x0b\x32P.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest\x12{\n\x17identity_token_balances\x18\x05 \x03(\x0b\x32Z.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenBalanceRequest\x12u\n\x14identity_token_infos\x18\x06 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityTokenInfoRequest\x12i\n\x0etoken_statuses\x18\x07 \x03(\x0b\x32Q.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.TokenStatusRequest\x1a\xd5\x02\n\x0f\x44ocumentRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12#\n\x1b\x64ocument_type_keeps_history\x18\x03 \x01(\x08\x12\x13\n\x0b\x64ocument_id\x18\x04 \x01(\x0c\x12\x89\x01\n\x19\x64ocument_contested_status\x18\x05 \x01(\x0e\x32\x66.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.DocumentRequest.DocumentContestedStatus\"P\n\x17\x44ocumentContestedStatus\x12\x11\n\rNOT_CONTESTED\x10\x00\x12\x13\n\x0fMAYBE_CONTESTED\x10\x01\x12\r\n\tCONTESTED\x10\x02\x1a\xd1\x01\n\x0fIdentityRequest\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12i\n\x0crequest_type\x18\x02 \x01(\x0e\x32S.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.IdentityRequest.Type\">\n\x04Type\x12\x11\n\rFULL_IDENTITY\x10\x00\x12\x0b\n\x07\x42\x41LANCE\x10\x01\x12\x08\n\x04KEYS\x10\x02\x12\x0c\n\x08REVISION\x10\x03\x1a&\n\x0f\x43ontractRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x1a\xe7\x02\n\x11VoteStatusRequest\x12\xa5\x01\n&contested_resource_vote_status_request\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProofsRequest.GetProofsRequestV0.VoteStatusRequest.ContestedResourceVoteStatusRequestH\x00\x1a\x99\x01\n\"ContestedResourceVoteStatusRequest\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x18\n\x10voter_identifier\x18\x05 \x01(\x0c\x42\x0e\n\x0crequest_type\x1a\x44\n\x1bIdentityTokenBalanceRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x0bidentity_id\x18\x02 \x01(\x0c\x1a\x41\n\x18IdentityTokenInfoRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x0bidentity_id\x18\x02 \x01(\x0c\x1a&\n\x12TokenStatusRequest\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x42\t\n\x07version\"\x82\x02\n\x11GetProofsResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetProofsResponse.GetProofsResponseV0H\x00\x1a\x91\x01\n\x13GetProofsResponseV0\x12\x31\n\x05proof\x18\x01 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc5\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xb0\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xb2\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x9a\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a;\n\x18\x44\x61taContractHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xed\x01\n!GetIdentityByPublicKeyHashRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0H\x00\x1aM\n#GetIdentityByPublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xda\x02\n\"GetIdentityByPublicKeyHashResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0H\x00\x1a\xb6\x01\n$GetIdentityByPublicKeyHashResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x99\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x9c\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\xa6\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1e\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x16\n\nstart_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xde\x04\n\x1cGetContestedResourcesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0H\x00\x1a\xcc\x03\n\x1eGetContestedResourcesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x1a\n\x12start_index_values\x18\x04 \x03(\x0c\x12\x18\n\x10\x65nd_index_values\x18\x05 \x03(\x0c\x12\x89\x01\n\x13start_at_value_info\x18\x06 \x01(\x0b\x32g.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1a\x45\n\x10StartAtValueInfo\x12\x13\n\x0bstart_value\x18\x01 \x01(\x0c\x12\x1c\n\x14start_value_included\x18\x02 \x01(\x08\x42\x16\n\x14_start_at_value_infoB\x08\n\x06_countB\t\n\x07version\"\x88\x04\n\x1dGetContestedResourcesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0H\x00\x1a\xf3\x02\n\x1fGetContestedResourcesResponseV0\x12\x95\x01\n\x19\x63ontested_resource_values\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValuesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a<\n\x17\x43ontestedResourceValues\x12!\n\x19\x63ontested_resource_values\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x05\n\x1cGetVotePollsByEndDateRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0H\x00\x1a\xc0\x04\n\x1eGetVotePollsByEndDateRequestV0\x12\x84\x01\n\x0fstart_time_info\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfoH\x00\x88\x01\x01\x12\x80\x01\n\rend_time_info\x18\x02 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfoH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x13\n\x06offset\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x11\n\tascending\x18\x05 \x01(\x08\x12\r\n\x05prove\x18\x06 \x01(\x08\x1aI\n\x0fStartAtTimeInfo\x12\x19\n\rstart_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13start_time_included\x18\x02 \x01(\x08\x1a\x43\n\rEndAtTimeInfo\x12\x17\n\x0b\x65nd_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x65nd_time_included\x18\x02 \x01(\x08\x42\x12\n\x10_start_time_infoB\x10\n\x0e_end_time_infoB\x08\n\x06_limitB\t\n\x07_offsetB\t\n\x07version\"\x83\x06\n\x1dGetVotePollsByEndDateResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0H\x00\x1a\xee\x04\n\x1fGetVotePollsByEndDateResponseV0\x12\x9c\x01\n\x18vote_polls_by_timestamps\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestampsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aV\n\x1eSerializedVotePollsByTimestamp\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x15serialized_vote_polls\x18\x02 \x03(\x0c\x1a\xd7\x01\n\x1fSerializedVotePollsByTimestamps\x12\x99\x01\n\x18vote_polls_by_timestamps\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xff\x06\n$GetContestedResourceVoteStateRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0H\x00\x1a\xd5\x05\n&GetContestedResourceVoteStateRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x86\x01\n\x0bresult_type\x18\x05 \x01(\x0e\x32q.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType\x12\x36\n.allow_include_locked_and_abstaining_vote_tally\x18\x06 \x01(\x08\x12\xa3\x01\n\x18start_at_identifier_info\x18\x07 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x08 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\"I\n\nResultType\x12\r\n\tDOCUMENTS\x10\x00\x12\x0e\n\nVOTE_TALLY\x10\x01\x12\x1c\n\x18\x44OCUMENTS_AND_VOTE_TALLY\x10\x02\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\x94\x0c\n%GetContestedResourceVoteStateResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0H\x00\x1a\xe7\n\n\'GetContestedResourceVoteStateResponseV0\x12\xae\x01\n\x1d\x63ontested_resource_contenders\x18\x01 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContendersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xda\x03\n\x10\x46inishedVoteInfo\x12\xad\x01\n\x15\x66inished_vote_outcome\x18\x01 \x01(\x0e\x32\x8d\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome\x12\x1f\n\x12won_by_identity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12$\n\x18\x66inished_at_block_height\x18\x03 \x01(\x04\x42\x02\x30\x01\x12%\n\x1d\x66inished_at_core_block_height\x18\x04 \x01(\r\x12%\n\x19\x66inished_at_block_time_ms\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x66inished_at_epoch\x18\x06 \x01(\r\"O\n\x13\x46inishedVoteOutcome\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x16\n\x12NO_PREVIOUS_WINNER\x10\x02\x42\x15\n\x13_won_by_identity_id\x1a\xc4\x03\n\x1b\x43ontestedResourceContenders\x12\x86\x01\n\ncontenders\x18\x01 \x03(\x0b\x32r.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender\x12\x1f\n\x12\x61\x62stain_vote_tally\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1c\n\x0flock_vote_tally\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x9a\x01\n\x12\x66inished_vote_info\x18\x04 \x01(\x0b\x32y.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfoH\x02\x88\x01\x01\x42\x15\n\x13_abstain_vote_tallyB\x12\n\x10_lock_vote_tallyB\x15\n\x13_finished_vote_info\x1ak\n\tContender\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x17\n\nvote_count\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08\x64ocument\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\r\n\x0b_vote_countB\x0b\n\t_documentB\x08\n\x06resultB\t\n\x07version\"\xd5\x05\n,GetContestedResourceVotersForIdentityRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0H\x00\x1a\x92\x04\n.GetContestedResourceVotersForIdentityRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x15\n\rcontestant_id\x18\x05 \x01(\x0c\x12\xb4\x01\n\x18start_at_identifier_info\x18\x06 \x01(\x0b\x32\x8c\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\xf1\x04\n-GetContestedResourceVotersForIdentityResponse\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0H\x00\x1a\xab\x03\n/GetContestedResourceVotersForIdentityResponseV0\x12\xb6\x01\n\x19\x63ontested_resource_voters\x18\x01 \x01(\x0b\x32\x90\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVotersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x43\n\x17\x43ontestedResourceVoters\x12\x0e\n\x06voters\x18\x01 \x03(\x0c\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xad\x05\n(GetContestedResourceIdentityVotesRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0H\x00\x1a\xf7\x03\n*GetContestedResourceIdentityVotesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0forder_ascending\x18\x04 \x01(\x08\x12\xae\x01\n\x1astart_at_vote_poll_id_info\x18\x05 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfoH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x61\n\x15StartAtVotePollIdInfo\x12 \n\x18start_at_poll_identifier\x18\x01 \x01(\x0c\x12&\n\x1estart_poll_identifier_included\x18\x02 \x01(\x08\x42\x1d\n\x1b_start_at_vote_poll_id_infoB\t\n\x07version\"\xc8\n\n)GetContestedResourceIdentityVotesResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0H\x00\x1a\x8f\t\n+GetContestedResourceIdentityVotesResponseV0\x12\xa1\x01\n\x05votes\x18\x01 \x01(\x0b\x32\x8f\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xf7\x01\n\x1e\x43ontestedResourceIdentityVotes\x12\xba\x01\n!contested_resource_identity_votes\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x1a\xad\x02\n\x12ResourceVoteChoice\x12\xad\x01\n\x10vote_choice_type\x18\x01 \x01(\x0e\x32\x92\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType\x12\x18\n\x0bidentity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\"=\n\x0eVoteChoiceType\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\x0b\n\x07\x41\x42STAIN\x10\x01\x12\x08\n\x04LOCK\x10\x02\x42\x0e\n\x0c_identity_id\x1a\x95\x02\n\x1d\x43ontestedResourceIdentityVote\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\'\n\x1fserialized_index_storage_values\x18\x03 \x03(\x0c\x12\x99\x01\n\x0bvote_choice\x18\x04 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoiceB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n%GetPrefundedSpecializedBalanceRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0H\x00\x1a\x44\n\'GetPrefundedSpecializedBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xed\x02\n&GetPrefundedSpecializedBalanceResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0H\x00\x1a\xbd\x01\n(GetPrefundedSpecializedBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xd0\x01\n GetTotalCreditsInPlatformRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0H\x00\x1a\x33\n\"GetTotalCreditsInPlatformRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xd9\x02\n!GetTotalCreditsInPlatformResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0H\x00\x1a\xb8\x01\n#GetTotalCreditsInPlatformResponseV0\x12\x15\n\x07\x63redits\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x16GetPathElementsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0H\x00\x1a\x45\n\x18GetPathElementsRequestV0\x12\x0c\n\x04path\x18\x01 \x03(\x0c\x12\x0c\n\x04keys\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xa3\x03\n\x17GetPathElementsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0H\x00\x1a\xa0\x02\n\x19GetPathElementsResponseV0\x12i\n\x08\x65lements\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ElementsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1c\n\x08\x45lements\x12\x10\n\x08\x65lements\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\x81\x01\n\x10GetStatusRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0H\x00\x1a\x14\n\x12GetStatusRequestV0B\t\n\x07version\"\xd0\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xdf\x0f\n\x13GetStatusResponseV0\x12Y\n\x07version\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version\x12S\n\x04node\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node\x12U\n\x05\x63hain\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain\x12Y\n\x07network\x18\x04 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network\x12^\n\nstate_sync\x18\x05 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync\x12S\n\x04time\x18\x06 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time\x1a\xee\x04\n\x07Version\x12\x63\n\x08software\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software\x12\x63\n\x08protocol\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol\x1a^\n\x08Software\x12\x0c\n\x04\x64\x61pi\x18\x01 \x01(\t\x12\x12\n\x05\x64rive\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntenderdash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_driveB\r\n\x0b_tenderdash\x1a\xb8\x02\n\x08Protocol\x12p\n\ntenderdash\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash\x12\x66\n\x05\x64rive\x18\x02 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive\x1a(\n\nTenderdash\x12\x0b\n\x03p2p\x18\x01 \x01(\r\x12\r\n\x05\x62lock\x18\x02 \x01(\r\x1a(\n\x05\x44rive\x12\x0e\n\x06latest\x18\x03 \x01(\r\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\r\x1a\x7f\n\x04Time\x12\x11\n\x05local\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x05\x62lock\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x18\n\x07genesis\x18\x03 \x01(\x04\x42\x02\x30\x01H\x01\x88\x01\x01\x12\x12\n\x05\x65poch\x18\x04 \x01(\rH\x02\x88\x01\x01\x42\x08\n\x06_blockB\n\n\x08_genesisB\x08\n\x06_epoch\x1a<\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x0bpro_tx_hash\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_pro_tx_hash\x1a\xb3\x02\n\x05\x43hain\x12\x13\n\x0b\x63\x61tching_up\x18\x01 \x01(\x08\x12\x19\n\x11latest_block_hash\x18\x02 \x01(\x0c\x12\x17\n\x0flatest_app_hash\x18\x03 \x01(\x0c\x12\x1f\n\x13latest_block_height\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13\x65\x61rliest_block_hash\x18\x05 \x01(\x0c\x12\x19\n\x11\x65\x61rliest_app_hash\x18\x06 \x01(\x0c\x12!\n\x15\x65\x61rliest_block_height\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15max_peer_block_height\x18\t \x01(\x04\x42\x02\x30\x01\x12%\n\x18\x63ore_chain_locked_height\x18\n \x01(\rH\x00\x88\x01\x01\x42\x1b\n\x19_core_chain_locked_height\x1a\x43\n\x07Network\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\t\x12\x13\n\x0bpeers_count\x18\x02 \x01(\r\x12\x11\n\tlistening\x18\x03 \x01(\x08\x1a\x85\x02\n\tStateSync\x12\x1d\n\x11total_synced_time\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eremaining_time\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0ftotal_snapshots\x18\x03 \x01(\r\x12\"\n\x16\x63hunk_process_avg_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x0fsnapshot_height\x18\x05 \x01(\x04\x42\x02\x30\x01\x12!\n\x15snapshot_chunks_count\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x11\x62\x61\x63kfilled_blocks\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15\x62\x61\x63kfill_blocks_total\x18\x08 \x01(\x04\x42\x02\x30\x01\x42\t\n\x07version\"\xb1\x01\n\x1cGetCurrentQuorumsInfoRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0H\x00\x1a \n\x1eGetCurrentQuorumsInfoRequestV0B\t\n\x07version\"\xa1\x05\n\x1dGetCurrentQuorumsInfoResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0H\x00\x1a\x46\n\x0bValidatorV0\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07node_ip\x18\x02 \x01(\t\x12\x11\n\tis_banned\x18\x03 \x01(\x08\x1a\xaf\x01\n\x0eValidatorSetV0\x12\x13\n\x0bquorum_hash\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ore_height\x18\x02 \x01(\r\x12U\n\x07members\x18\x03 \x03(\x0b\x32\x44.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0\x12\x1c\n\x14threshold_public_key\x18\x04 \x01(\x0c\x1a\x92\x02\n\x1fGetCurrentQuorumsInfoResponseV0\x12\x15\n\rquorum_hashes\x18\x01 \x03(\x0c\x12\x1b\n\x13\x63urrent_quorum_hash\x18\x02 \x01(\x0c\x12_\n\x0evalidator_sets\x18\x03 \x03(\x0b\x32G.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0\x12\x1b\n\x13last_block_proposer\x18\x04 \x01(\x0c\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version\"\xf4\x01\n\x1fGetIdentityTokenBalancesRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0H\x00\x1aZ\n!GetIdentityTokenBalancesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xad\x05\n GetIdentityTokenBalancesResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0H\x00\x1a\x8f\x04\n\"GetIdentityTokenBalancesResponseV0\x12\x86\x01\n\x0etoken_balances\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aG\n\x11TokenBalanceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x9a\x01\n\rTokenBalances\x12\x88\x01\n\x0etoken_balances\x18\x01 \x03(\x0b\x32p.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xfc\x01\n!GetIdentitiesTokenBalancesRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0H\x00\x1a\\\n#GetIdentitiesTokenBalancesRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xf2\x05\n\"GetIdentitiesTokenBalancesResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0H\x00\x1a\xce\x04\n$GetIdentitiesTokenBalancesResponseV0\x12\x9b\x01\n\x17identity_token_balances\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aR\n\x19IdentityTokenBalanceEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\xb7\x01\n\x15IdentityTokenBalances\x12\x9d\x01\n\x17identity_token_balances\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xe8\x01\n\x1cGetIdentityTokenInfosRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0H\x00\x1aW\n\x1eGetIdentityTokenInfosRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x98\x06\n\x1dGetIdentityTokenInfosResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0H\x00\x1a\x83\x05\n\x1fGetIdentityTokenInfosResponseV0\x12z\n\x0btoken_infos\x18\x01 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb0\x01\n\x0eTokenInfoEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x82\x01\n\x04info\x18\x02 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x8a\x01\n\nTokenInfos\x12|\n\x0btoken_infos\x18\x01 \x03(\x0b\x32g.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n\x1eGetIdentitiesTokenInfosRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0H\x00\x1aY\n GetIdentitiesTokenInfosRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xca\x06\n\x1fGetIdentitiesTokenInfosResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0H\x00\x1a\xaf\x05\n!GetIdentitiesTokenInfosResponseV0\x12\x8f\x01\n\x14identity_token_infos\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb7\x01\n\x0eTokenInfoEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x86\x01\n\x04info\x18\x02 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x97\x01\n\x12IdentityTokenInfos\x12\x80\x01\n\x0btoken_infos\x18\x01 \x03(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbf\x01\n\x17GetTokenStatusesRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0H\x00\x1a=\n\x19GetTokenStatusesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xe7\x04\n\x18GetTokenStatusesResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0H\x00\x1a\xe1\x03\n\x1aGetTokenStatusesResponseV0\x12v\n\x0etoken_statuses\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x44\n\x10TokenStatusEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x06paused\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_paused\x1a\x88\x01\n\rTokenStatuses\x12w\n\x0etoken_statuses\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntryB\x08\n\x06resultB\t\n\x07version\"\xef\x01\n#GetTokenDirectPurchasePricesRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0H\x00\x1aI\n%GetTokenDirectPurchasePricesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xa2\n\n$GetTokenDirectPurchasePricesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0H\x00\x1a\xf8\x08\n&GetTokenDirectPurchasePricesResponseV0\x12\xa9\x01\n\x1ctoken_direct_purchase_prices\x18\x01 \x01(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePricesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xa7\x01\n\x0fPricingSchedule\x12\x93\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity\x1a\xba\x01\n\x05Price\x12\x15\n\x0b\x66ixed_price\x18\x01 \x01(\x04H\x00\x12\x90\x01\n\x0evariable_price\x18\x02 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingScheduleH\x00\x42\x07\n\x05price\x1a\xbe\x01\n\x1dTokenDirectPurchasePriceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x80\x01\n\x05price\x18\x02 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceH\x00\x88\x01\x01\x42\x08\n\x06_price\x1a\xc8\x01\n\x19TokenDirectPurchasePrices\x12\xaa\x01\n\x1btoken_direct_purchase_price\x18\x01 \x03(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntryB\x08\n\x06resultB\t\n\x07version\"\xef\x04\n)GetTokenPreProgrammedDistributionsRequest\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0H\x00\x1a\xb6\x03\n+GetTokenPreProgrammedDistributionsRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x98\x01\n\rstart_at_info\x18\x02 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfoH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x1a\x9a\x01\n\x0bStartAtInfo\x12\x15\n\rstart_time_ms\x18\x01 \x01(\x04\x12\x1c\n\x0fstart_recipient\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12%\n\x18start_recipient_included\x18\x03 \x01(\x08H\x01\x88\x01\x01\x42\x12\n\x10_start_recipientB\x1b\n\x19_start_recipient_includedB\x10\n\x0e_start_at_infoB\x08\n\x06_limitB\t\n\x07version\"\xec\x07\n*GetTokenPreProgrammedDistributionsResponse\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0H\x00\x1a\xaf\x06\n,GetTokenPreProgrammedDistributionsResponseV0\x12\xa5\x01\n\x13token_distributions\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a>\n\x16TokenDistributionEntry\x12\x14\n\x0crecipient_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x1a\xd4\x01\n\x1bTokenTimedDistributionEntry\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\xa1\x01\n\rdistributions\x18\x02 \x03(\x0b\x32\x89\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry\x1a\xc3\x01\n\x12TokenDistributions\x12\xac\x01\n\x13token_distributions\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntryB\x08\n\x06resultB\t\n\x07version\"\xca\x01\n\x1aGetTokenTotalSupplyRequest\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0H\x00\x1a?\n\x1cGetTokenTotalSupplyRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xaf\x04\n\x1bGetTokenTotalSupplyResponse\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0H\x00\x1a\xa0\x03\n\x1dGetTokenTotalSupplyResponseV0\x12\x88\x01\n\x12token_total_supply\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1ax\n\x15TokenTotalSupplyEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x30\n(total_aggregated_amount_in_user_accounts\x18\x02 \x01(\x04\x12\x1b\n\x13total_system_amount\x18\x03 \x01(\x04\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x01\n\x13GetGroupInfoRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0H\x00\x1a\\\n\x15GetGroupInfoRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xd4\x05\n\x14GetGroupInfoResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0H\x00\x1a\xda\x04\n\x16GetGroupInfoResponseV0\x12\x66\n\ngroup_info\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x98\x01\n\x0eGroupInfoEntry\x12h\n\x07members\x18\x01 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x02 \x01(\r\x1a\x8a\x01\n\tGroupInfo\x12n\n\ngroup_info\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntryH\x00\x88\x01\x01\x42\r\n\x0b_group_infoB\x08\n\x06resultB\t\n\x07version\"\xed\x03\n\x14GetGroupInfosRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0H\x00\x1au\n\x1cStartAtGroupContractPosition\x12%\n\x1dstart_group_contract_position\x18\x01 \x01(\r\x12.\n&start_group_contract_position_included\x18\x02 \x01(\x08\x1a\xfc\x01\n\x16GetGroupInfosRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12{\n start_at_group_contract_position\x18\x02 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPositionH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x42#\n!_start_at_group_contract_positionB\x08\n\x06_countB\t\n\x07version\"\xff\x05\n\x15GetGroupInfosResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0H\x00\x1a\x82\x05\n\x17GetGroupInfosResponseV0\x12j\n\x0bgroup_infos\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\xc3\x01\n\x16GroupPositionInfoEntry\x12\x1f\n\x17group_contract_position\x18\x01 \x01(\r\x12j\n\x07members\x18\x02 \x03(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x03 \x01(\r\x1a\x82\x01\n\nGroupInfos\x12t\n\x0bgroup_infos\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbe\x04\n\x16GetGroupActionsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0H\x00\x1aL\n\x0fStartAtActionId\x12\x17\n\x0fstart_action_id\x18\x01 \x01(\x0c\x12 \n\x18start_action_id_included\x18\x02 \x01(\x08\x1a\xc8\x02\n\x18GetGroupActionsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12N\n\x06status\x18\x03 \x01(\x0e\x32>.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus\x12\x62\n\x12start_at_action_id\x18\x04 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionIdH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x42\x15\n\x13_start_at_action_idB\x08\n\x06_count\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\xc0\x1e\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\xbd\x1d\n\x19GetGroupActionsResponseV0\x12r\n\rgroup_actions\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a[\n\tMintEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x14\n\x0crecipient_id\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x45\n\tBurnEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aJ\n\x0b\x46reezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aL\n\rUnfreezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x66\n\x17\x44\x65stroyFrozenFundsEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x13SharedEncryptedNote\x12\x18\n\x10sender_key_index\x18\x01 \x01(\r\x12\x1b\n\x13recipient_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a{\n\x15PersonalEncryptedNote\x12!\n\x19root_encryption_key_index\x18\x01 \x01(\r\x12\'\n\x1f\x64\x65rivation_encryption_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a\xe9\x01\n\x14\x45mergencyActionEvent\x12\x81\x01\n\x0b\x61\x63tion_type\x18\x01 \x01(\x0e\x32l.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\"#\n\nActionType\x12\t\n\x05PAUSE\x10\x00\x12\n\n\x06RESUME\x10\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x16TokenConfigUpdateEvent\x12 \n\x18token_config_update_item\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\xe6\x03\n\x1eUpdateDirectPurchasePriceEvent\x12\x15\n\x0b\x66ixed_price\x18\x01 \x01(\x04H\x00\x12\x95\x01\n\x0evariable_price\x18\x02 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingScheduleH\x00\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x01\x88\x01\x01\x1a\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xac\x01\n\x0fPricingSchedule\x12\x98\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantityB\x07\n\x05priceB\x0e\n\x0c_public_note\x1a\xfc\x02\n\x10GroupActionEvent\x12n\n\x0btoken_event\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEventH\x00\x12t\n\x0e\x64ocument_event\x18\x02 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEventH\x00\x12t\n\x0e\x63ontract_event\x18\x03 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEventH\x00\x42\x0c\n\nevent_type\x1a\x8b\x01\n\rDocumentEvent\x12r\n\x06\x63reate\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEventH\x00\x42\x06\n\x04type\x1a/\n\x13\x44ocumentCreateEvent\x12\x18\n\x10\x63reated_document\x18\x01 \x01(\x0c\x1a/\n\x13\x43ontractUpdateEvent\x12\x18\n\x10updated_contract\x18\x01 \x01(\x0c\x1a\x8b\x01\n\rContractEvent\x12r\n\x06update\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEventH\x00\x42\x06\n\x04type\x1a\xd1\x07\n\nTokenEvent\x12\x66\n\x04mint\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEventH\x00\x12\x66\n\x04\x62urn\x18\x02 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEventH\x00\x12j\n\x06\x66reeze\x18\x03 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEventH\x00\x12n\n\x08unfreeze\x18\x04 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEventH\x00\x12\x84\x01\n\x14\x64\x65stroy_frozen_funds\x18\x05 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEventH\x00\x12}\n\x10\x65mergency_action\x18\x06 \x01(\x0b\x32\x61.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEventH\x00\x12\x82\x01\n\x13token_config_update\x18\x07 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEventH\x00\x12\x83\x01\n\x0cupdate_price\x18\x08 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEventH\x00\x42\x06\n\x04type\x1a\x93\x01\n\x10GroupActionEntry\x12\x11\n\taction_id\x18\x01 \x01(\x0c\x12l\n\x05\x65vent\x18\x02 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent\x1a\x84\x01\n\x0cGroupActions\x12t\n\rgroup_actions\x18\x01 \x03(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntryB\x08\n\x06resultB\t\n\x07version\"\x88\x03\n\x1cGetGroupActionSignersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0H\x00\x1a\xce\x01\n\x1eGetGroupActionSignersRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12T\n\x06status\x18\x03 \x01(\x0e\x32\x44.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus\x12\x11\n\taction_id\x18\x04 \x01(\x0c\x12\r\n\x05prove\x18\x05 \x01(\x08\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\x8b\x05\n\x1dGetGroupActionSignersResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0H\x00\x1a\xf6\x03\n\x1fGetGroupActionSignersResponseV0\x12\x8b\x01\n\x14group_action_signers\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x35\n\x11GroupActionSigner\x12\x11\n\tsigner_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x91\x01\n\x12GroupActionSigners\x12{\n\x07signers\x18\x01 \x03(\x0b\x32j.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignerB\x08\n\x06resultB\t\n\x07version*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\xbc\x31\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\x66\n\tgetProofs\x12+.org.dash.platform.dapi.v0.GetProofsRequest\x1a,.org.dash.platform.dapi.v0.GetProofsResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponse\x12\xa5\x01\n\x1egetProtocolVersionUpgradeState\x12@.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest\x1a\x41.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse\x12\xb4\x01\n#getProtocolVersionUpgradeVoteStatus\x12\x45.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest\x1a\x46.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse\x12r\n\rgetEpochsInfo\x12/.org.dash.platform.dapi.v0.GetEpochsInfoRequest\x1a\x30.org.dash.platform.dapi.v0.GetEpochsInfoResponse\x12\x8a\x01\n\x15getContestedResources\x12\x37.org.dash.platform.dapi.v0.GetContestedResourcesRequest\x1a\x38.org.dash.platform.dapi.v0.GetContestedResourcesResponse\x12\xa2\x01\n\x1dgetContestedResourceVoteState\x12?.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest\x1a@.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse\x12\xba\x01\n%getContestedResourceVotersForIdentity\x12G.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest\x1aH.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse\x12\xae\x01\n!getContestedResourceIdentityVotes\x12\x43.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest\x1a\x44.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse\x12\x8a\x01\n\x15getVotePollsByEndDate\x12\x37.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest\x1a\x38.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse\x12\xa5\x01\n\x1egetPrefundedSpecializedBalance\x12@.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest\x1a\x41.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse\x12\x96\x01\n\x19getTotalCreditsInPlatform\x12;.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest\x1a<.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse\x12x\n\x0fgetPathElements\x12\x31.org.dash.platform.dapi.v0.GetPathElementsRequest\x1a\x32.org.dash.platform.dapi.v0.GetPathElementsResponse\x12\x66\n\tgetStatus\x12+.org.dash.platform.dapi.v0.GetStatusRequest\x1a,.org.dash.platform.dapi.v0.GetStatusResponse\x12\x8a\x01\n\x15getCurrentQuorumsInfo\x12\x37.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest\x1a\x38.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse\x12\x93\x01\n\x18getIdentityTokenBalances\x12:.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse\x12\x99\x01\n\x1agetIdentitiesTokenBalances\x12<.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest\x1a=.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse\x12\x8a\x01\n\x15getIdentityTokenInfos\x12\x37.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse\x12\x90\x01\n\x17getIdentitiesTokenInfos\x12\x39.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest\x1a:.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse\x12{\n\x10getTokenStatuses\x12\x32.org.dash.platform.dapi.v0.GetTokenStatusesRequest\x1a\x33.org.dash.platform.dapi.v0.GetTokenStatusesResponse\x12\x9f\x01\n\x1cgetTokenDirectPurchasePrices\x12>.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest\x1a?.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse\x12\xb1\x01\n\"getTokenPreProgrammedDistributions\x12\x44.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest\x1a\x45.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse\x12\x84\x01\n\x13getTokenTotalSupply\x12\x35.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest\x1a\x36.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse\x12o\n\x0cgetGroupInfo\x12..org.dash.platform.dapi.v0.GetGroupInfoRequest\x1a/.org.dash.platform.dapi.v0.GetGroupInfoResponse\x12r\n\rgetGroupInfos\x12/.org.dash.platform.dapi.v0.GetGroupInfosRequest\x1a\x30.org.dash.platform.dapi.v0.GetGroupInfosResponse\x12x\n\x0fgetGroupActions\x12\x31.org.dash.platform.dapi.v0.GetGroupActionsRequest\x1a\x32.org.dash.platform.dapi.v0.GetGroupActionsResponse\x12\x8a\x01\n\x15getGroupActionSigners\x12\x37.org.dash.platform.dapi.v0.GetGroupActionSignersRequest\x1a\x38.org.dash.platform.dapi.v0.GetGroupActionSignersResponseb\x06proto3' , dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) @@ -62,8 +62,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=46565, - serialized_end=46655, + serialized_start=48747, + serialized_end=48837, ) _sym_db.RegisterEnumDescriptor(_KEYPURPOSE) @@ -275,8 +275,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=42181, - serialized_end=42219, + serialized_start=43740, + serialized_end=43778, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSREQUEST_ACTIONSTATUS) @@ -300,8 +300,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=43444, - serialized_end=43479, + serialized_start=45003, + serialized_end=45038, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT_ACTIONTYPE) @@ -325,8 +325,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=42181, - serialized_end=42219, + serialized_start=43740, + serialized_end=43778, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSIGNERSREQUEST_ACTIONSTATUS) @@ -9986,6 +9986,354 @@ ) +_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0 = _descriptor.Descriptor( + name='GetTokenDirectPurchasePricesRequestV0', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='token_ids', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.token_ids', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prove', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=37205, + serialized_end=37278, +) + +_GETTOKENDIRECTPURCHASEPRICESREQUEST = _descriptor.Descriptor( + name='GetTokenDirectPurchasePricesRequest', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='v0', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.v0', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=37050, + serialized_end=37289, +) + + +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY = _descriptor.Descriptor( + name='PriceForQuantity', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='quantity', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.quantity', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.price', index=1, + number=2, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=37779, + serialized_end=37830, +) + +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE = _descriptor.Descriptor( + name='PricingSchedule', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='price_for_quantity', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.price_for_quantity', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=37833, + serialized_end=38000, +) + +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE = _descriptor.Descriptor( + name='Price', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='fixed_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.fixed_price', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='variable_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.variable_price', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.price', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=38003, + serialized_end=38189, +) + +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY = _descriptor.Descriptor( + name='TokenDirectPurchasePriceEntry', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='token_id', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.token_id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.price', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry._price', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=38192, + serialized_end=38382, +) + +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES = _descriptor.Descriptor( + name='TokenDirectPurchasePrices', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='token_direct_purchase_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.token_direct_purchase_price', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=38385, + serialized_end=38585, +) + +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 = _descriptor.Descriptor( + name='GetTokenDirectPurchasePricesResponseV0', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='token_direct_purchase_prices', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.token_direct_purchase_prices', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.proof', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='result', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.result', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=37451, + serialized_end=38595, +) + +_GETTOKENDIRECTPURCHASEPRICESRESPONSE = _descriptor.Descriptor( + name='GetTokenDirectPurchasePricesResponse', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='v0', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.v0', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='version', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.version', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=37292, + serialized_end=38606, +) + + _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0_STARTATINFO = _descriptor.Descriptor( name='StartAtInfo', full_name='org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo', @@ -10037,8 +10385,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37480, - serialized_end=37634, + serialized_start=39039, + serialized_end=39193, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0 = _descriptor.Descriptor( @@ -10099,8 +10447,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37224, - serialized_end=37662, + serialized_start=38783, + serialized_end=39221, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST = _descriptor.Descriptor( @@ -10135,8 +10483,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37050, - serialized_end=37673, + serialized_start=38609, + serialized_end=39232, ) @@ -10174,8 +10522,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38184, - serialized_end=38246, + serialized_start=39743, + serialized_end=39805, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENTIMEDDISTRIBUTIONENTRY = _descriptor.Descriptor( @@ -10212,8 +10560,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38249, - serialized_end=38461, + serialized_start=39808, + serialized_end=40020, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENDISTRIBUTIONS = _descriptor.Descriptor( @@ -10243,8 +10591,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38464, - serialized_end=38659, + serialized_start=40023, + serialized_end=40218, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -10293,8 +10641,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37854, - serialized_end=38669, + serialized_start=39413, + serialized_end=40228, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE = _descriptor.Descriptor( @@ -10329,8 +10677,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37676, - serialized_end=38680, + serialized_start=39235, + serialized_end=40239, ) @@ -10368,8 +10716,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38811, - serialized_end=38874, + serialized_start=40370, + serialized_end=40433, ) _GETTOKENTOTALSUPPLYREQUEST = _descriptor.Descriptor( @@ -10404,8 +10752,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38683, - serialized_end=38885, + serialized_start=40242, + serialized_end=40444, ) @@ -10450,8 +10798,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39306, - serialized_end=39426, + serialized_start=40865, + serialized_end=40985, ) _GETTOKENTOTALSUPPLYRESPONSE_GETTOKENTOTALSUPPLYRESPONSEV0 = _descriptor.Descriptor( @@ -10500,8 +10848,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39020, - serialized_end=39436, + serialized_start=40579, + serialized_end=40995, ) _GETTOKENTOTALSUPPLYRESPONSE = _descriptor.Descriptor( @@ -10536,8 +10884,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38888, - serialized_end=39447, + serialized_start=40447, + serialized_end=41006, ) @@ -10582,8 +10930,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39557, - serialized_end=39649, + serialized_start=41116, + serialized_end=41208, ) _GETGROUPINFOREQUEST = _descriptor.Descriptor( @@ -10618,8 +10966,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39450, - serialized_end=39660, + serialized_start=41009, + serialized_end=41219, ) @@ -10657,8 +11005,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40018, - serialized_end=40070, + serialized_start=41577, + serialized_end=41629, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFOENTRY = _descriptor.Descriptor( @@ -10695,8 +11043,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40073, - serialized_end=40225, + serialized_start=41632, + serialized_end=41784, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFO = _descriptor.Descriptor( @@ -10731,8 +11079,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40228, - serialized_end=40366, + serialized_start=41787, + serialized_end=41925, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0 = _descriptor.Descriptor( @@ -10781,8 +11129,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39774, - serialized_end=40376, + serialized_start=41333, + serialized_end=41935, ) _GETGROUPINFORESPONSE = _descriptor.Descriptor( @@ -10817,8 +11165,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39663, - serialized_end=40387, + serialized_start=41222, + serialized_end=41946, ) @@ -10856,8 +11204,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40500, - serialized_end=40617, + serialized_start=42059, + serialized_end=42176, ) _GETGROUPINFOSREQUEST_GETGROUPINFOSREQUESTV0 = _descriptor.Descriptor( @@ -10918,8 +11266,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40620, - serialized_end=40872, + serialized_start=42179, + serialized_end=42431, ) _GETGROUPINFOSREQUEST = _descriptor.Descriptor( @@ -10954,8 +11302,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40390, - serialized_end=40883, + serialized_start=41949, + serialized_end=42442, ) @@ -10993,8 +11341,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40018, - serialized_end=40070, + serialized_start=41577, + serialized_end=41629, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPPOSITIONINFOENTRY = _descriptor.Descriptor( @@ -11038,8 +11386,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41304, - serialized_end=41499, + serialized_start=42863, + serialized_end=43058, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPINFOS = _descriptor.Descriptor( @@ -11069,8 +11417,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41502, - serialized_end=41632, + serialized_start=43061, + serialized_end=43191, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -11119,8 +11467,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41000, - serialized_end=41642, + serialized_start=42559, + serialized_end=43201, ) _GETGROUPINFOSRESPONSE = _descriptor.Descriptor( @@ -11155,8 +11503,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40886, - serialized_end=41653, + serialized_start=42445, + serialized_end=43212, ) @@ -11194,8 +11542,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41772, - serialized_end=41848, + serialized_start=43331, + serialized_end=43407, ) _GETGROUPACTIONSREQUEST_GETGROUPACTIONSREQUESTV0 = _descriptor.Descriptor( @@ -11270,8 +11618,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41851, - serialized_end=42179, + serialized_start=43410, + serialized_end=43738, ) _GETGROUPACTIONSREQUEST = _descriptor.Descriptor( @@ -11307,8 +11655,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41656, - serialized_end=42230, + serialized_start=43215, + serialized_end=43789, ) @@ -11358,8 +11706,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42612, - serialized_end=42703, + serialized_start=44171, + serialized_end=44262, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_BURNEVENT = _descriptor.Descriptor( @@ -11401,8 +11749,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42705, - serialized_end=42774, + serialized_start=44264, + serialized_end=44333, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_FREEZEEVENT = _descriptor.Descriptor( @@ -11444,8 +11792,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42776, - serialized_end=42850, + serialized_start=44335, + serialized_end=44409, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UNFREEZEEVENT = _descriptor.Descriptor( @@ -11487,8 +11835,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42852, - serialized_end=42928, + serialized_start=44411, + serialized_end=44487, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DESTROYFROZENFUNDSEVENT = _descriptor.Descriptor( @@ -11537,8 +11885,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42930, - serialized_end=43032, + serialized_start=44489, + serialized_end=44591, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_SHAREDENCRYPTEDNOTE = _descriptor.Descriptor( @@ -11582,8 +11930,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43034, - serialized_end=43134, + serialized_start=44593, + serialized_end=44693, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_PERSONALENCRYPTEDNOTE = _descriptor.Descriptor( @@ -11627,8 +11975,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43136, - serialized_end=43259, + serialized_start=44695, + serialized_end=44818, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT = _descriptor.Descriptor( @@ -11671,8 +12019,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43262, - serialized_end=43495, + serialized_start=44821, + serialized_end=45054, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT = _descriptor.Descriptor( @@ -11714,8 +12062,132 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43497, - serialized_end=43597, + serialized_start=45056, + serialized_end=45156, +) + +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICEFORQUANTITY = _descriptor.Descriptor( + name='PriceForQuantity', + full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='quantity', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.quantity', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='price', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.price', index=1, + number=2, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=37779, + serialized_end=37830, +) + +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE = _descriptor.Descriptor( + name='PricingSchedule', + full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='price_for_quantity', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.price_for_quantity', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=45448, + serialized_end=45620, +) + +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT = _descriptor.Descriptor( + name='UpdateDirectPurchasePriceEvent', + full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='fixed_price', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.fixed_price', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='variable_price', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.variable_price', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='public_note', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.public_note', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICEFORQUANTITY, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='price', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.price', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + _descriptor.OneofDescriptor( + name='_public_note', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent._public_note', + index=1, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=45159, + serialized_end=45645, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT = _descriptor.Descriptor( @@ -11764,8 +12236,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43600, - serialized_end=43980, + serialized_start=45648, + serialized_end=46028, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTEVENT = _descriptor.Descriptor( @@ -11800,8 +12272,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43983, - serialized_end=44122, + serialized_start=46031, + serialized_end=46170, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTCREATEEVENT = _descriptor.Descriptor( @@ -11831,8 +12303,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44124, - serialized_end=44171, + serialized_start=46172, + serialized_end=46219, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTUPDATEEVENT = _descriptor.Descriptor( @@ -11862,8 +12334,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=44173, - serialized_end=44220, + serialized_start=46221, + serialized_end=46268, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTEVENT = _descriptor.Descriptor( @@ -11898,8 +12370,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44223, - serialized_end=44362, + serialized_start=46271, + serialized_end=46410, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT = _descriptor.Descriptor( @@ -11959,6 +12431,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='update_price', full_name='org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.update_price', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -11976,8 +12455,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44365, - serialized_end=45208, + serialized_start=46413, + serialized_end=47390, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY = _descriptor.Descriptor( @@ -12014,8 +12493,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45211, - serialized_end=45358, + serialized_start=47393, + serialized_end=47540, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONS = _descriptor.Descriptor( @@ -12045,8 +12524,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45361, - serialized_end=45493, + serialized_start=47543, + serialized_end=47675, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -12081,7 +12560,7 @@ ], extensions=[ ], - nested_types=[_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_MINTEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_BURNEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_FREEZEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UNFREEZEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DESTROYFROZENFUNDSEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_SHAREDENCRYPTEDNOTE, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_PERSONALENCRYPTEDNOTE, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTCREATEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTUPDATEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONS, ], + nested_types=[_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_MINTEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_BURNEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_FREEZEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UNFREEZEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DESTROYFROZENFUNDSEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_SHAREDENCRYPTEDNOTE, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_PERSONALENCRYPTEDNOTE, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTCREATEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTUPDATEEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY, _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONS, ], enum_types=[ ], serialized_options=None, @@ -12095,8 +12574,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42353, - serialized_end=45503, + serialized_start=43912, + serialized_end=47685, ) _GETGROUPACTIONSRESPONSE = _descriptor.Descriptor( @@ -12131,8 +12610,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42233, - serialized_end=45514, + serialized_start=43792, + serialized_end=47696, ) @@ -12191,8 +12670,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45652, - serialized_end=45858, + serialized_start=47834, + serialized_end=48040, ) _GETGROUPACTIONSIGNERSREQUEST = _descriptor.Descriptor( @@ -12228,8 +12707,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45517, - serialized_end=45909, + serialized_start=47699, + serialized_end=48091, ) @@ -12267,8 +12746,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46341, - serialized_end=46394, + serialized_start=48523, + serialized_end=48576, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0_GROUPACTIONSIGNERS = _descriptor.Descriptor( @@ -12298,8 +12777,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46397, - serialized_end=46542, + serialized_start=48579, + serialized_end=48724, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0 = _descriptor.Descriptor( @@ -12348,8 +12827,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=46050, - serialized_end=46552, + serialized_start=48232, + serialized_end=48734, ) _GETGROUPACTIONSIGNERSRESPONSE = _descriptor.Descriptor( @@ -12384,8 +12863,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45912, - serialized_end=46563, + serialized_start=48094, + serialized_end=48745, ) _GETIDENTITYREQUEST_GETIDENTITYREQUESTV0.containing_type = _GETIDENTITYREQUEST @@ -13300,6 +13779,43 @@ _GETTOKENSTATUSESRESPONSE.oneofs_by_name['version'].fields.append( _GETTOKENSTATUSESRESPONSE.fields_by_name['v0']) _GETTOKENSTATUSESRESPONSE.fields_by_name['v0'].containing_oneof = _GETTOKENSTATUSESRESPONSE.oneofs_by_name['version'] +_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0.containing_type = _GETTOKENDIRECTPURCHASEPRICESREQUEST +_GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0'].message_type = _GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0 +_GETTOKENDIRECTPURCHASEPRICESREQUEST.oneofs_by_name['version'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0']) +_GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESREQUEST.oneofs_by_name['version'] +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE.fields_by_name['price_for_quantity'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['variable_price'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.oneofs_by_name['price'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['fixed_price']) +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['fixed_price'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.oneofs_by_name['price'] +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.oneofs_by_name['price'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['variable_price']) +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['variable_price'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.oneofs_by_name['price'] +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['price'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.oneofs_by_name['_price'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['price']) +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['price'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.oneofs_by_name['_price'] +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES.fields_by_name['token_direct_purchase_price'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.fields_by_name['token_direct_purchase_prices'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.fields_by_name['proof'].message_type = _PROOF +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.fields_by_name['token_direct_purchase_prices']) +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.fields_by_name['token_direct_purchase_prices'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.oneofs_by_name['result'] +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.oneofs_by_name['result'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.fields_by_name['proof']) +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.fields_by_name['proof'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.oneofs_by_name['result'] +_GETTOKENDIRECTPURCHASEPRICESRESPONSE.fields_by_name['v0'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 +_GETTOKENDIRECTPURCHASEPRICESRESPONSE.oneofs_by_name['version'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESRESPONSE.fields_by_name['v0']) +_GETTOKENDIRECTPURCHASEPRICESRESPONSE.fields_by_name['v0'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE.oneofs_by_name['version'] _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0_STARTATINFO.containing_type = _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0 _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0_STARTATINFO.oneofs_by_name['_start_recipient'].fields.append( _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0_STARTATINFO.fields_by_name['start_recipient']) @@ -13464,6 +13980,20 @@ _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT.oneofs_by_name['_public_note'].fields.append( _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT.fields_by_name['public_note']) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT.fields_by_name['public_note'].containing_oneof = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT.oneofs_by_name['_public_note'] +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICEFORQUANTITY.containing_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE.fields_by_name['price_for_quantity'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICEFORQUANTITY +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE.containing_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.fields_by_name['variable_price'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.containing_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0 +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.oneofs_by_name['price'].fields.append( + _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.fields_by_name['fixed_price']) +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.fields_by_name['fixed_price'].containing_oneof = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.oneofs_by_name['price'] +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.oneofs_by_name['price'].fields.append( + _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.fields_by_name['variable_price']) +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.fields_by_name['variable_price'].containing_oneof = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.oneofs_by_name['price'] +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.oneofs_by_name['_public_note'].fields.append( + _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.fields_by_name['public_note']) +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.fields_by_name['public_note'].containing_oneof = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT.oneofs_by_name['_public_note'] _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT.fields_by_name['token_event'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT.fields_by_name['document_event'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTEVENT _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT.fields_by_name['contract_event'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTEVENT @@ -13496,6 +14026,7 @@ _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['destroy_frozen_funds'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DESTROYFROZENFUNDSEVENT _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['emergency_action'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['token_config_update'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['update_price'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.containing_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0 _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.oneofs_by_name['type'].fields.append( _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['mint']) @@ -13518,6 +14049,9 @@ _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.oneofs_by_name['type'].fields.append( _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['token_config_update']) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['token_config_update'].containing_oneof = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.oneofs_by_name['type'] +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.oneofs_by_name['type'].fields.append( + _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['update_price']) +_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.fields_by_name['update_price'].containing_oneof = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT.oneofs_by_name['type'] _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY.fields_by_name['event'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY.containing_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0 _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONS.fields_by_name['group_actions'].message_type = _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY @@ -13641,6 +14175,8 @@ DESCRIPTOR.message_types_by_name['GetIdentitiesTokenInfosResponse'] = _GETIDENTITIESTOKENINFOSRESPONSE DESCRIPTOR.message_types_by_name['GetTokenStatusesRequest'] = _GETTOKENSTATUSESREQUEST DESCRIPTOR.message_types_by_name['GetTokenStatusesResponse'] = _GETTOKENSTATUSESRESPONSE +DESCRIPTOR.message_types_by_name['GetTokenDirectPurchasePricesRequest'] = _GETTOKENDIRECTPURCHASEPRICESREQUEST +DESCRIPTOR.message_types_by_name['GetTokenDirectPurchasePricesResponse'] = _GETTOKENDIRECTPURCHASEPRICESRESPONSE DESCRIPTOR.message_types_by_name['GetTokenPreProgrammedDistributionsRequest'] = _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST DESCRIPTOR.message_types_by_name['GetTokenPreProgrammedDistributionsResponse'] = _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE DESCRIPTOR.message_types_by_name['GetTokenTotalSupplyRequest'] = _GETTOKENTOTALSUPPLYREQUEST @@ -15375,6 +15911,76 @@ _sym_db.RegisterMessage(GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry) _sym_db.RegisterMessage(GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses) +GetTokenDirectPurchasePricesRequest = _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesRequest', (_message.Message,), { + + 'GetTokenDirectPurchasePricesRequestV0' : _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesRequestV0', (_message.Message,), { + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) + }) + , + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest) + }) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesRequest) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) + +GetTokenDirectPurchasePricesResponse = _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesResponse', (_message.Message,), { + + 'GetTokenDirectPurchasePricesResponseV0' : _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesResponseV0', (_message.Message,), { + + 'PriceForQuantity' : _reflection.GeneratedProtocolMessageType('PriceForQuantity', (_message.Message,), { + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity) + }) + , + + 'PricingSchedule' : _reflection.GeneratedProtocolMessageType('PricingSchedule', (_message.Message,), { + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule) + }) + , + + 'Price' : _reflection.GeneratedProtocolMessageType('Price', (_message.Message,), { + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price) + }) + , + + 'TokenDirectPurchasePriceEntry' : _reflection.GeneratedProtocolMessageType('TokenDirectPurchasePriceEntry', (_message.Message,), { + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry) + }) + , + + 'TokenDirectPurchasePrices' : _reflection.GeneratedProtocolMessageType('TokenDirectPurchasePrices', (_message.Message,), { + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices) + }) + , + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0) + }) + , + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse) + }) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices) + GetTokenPreProgrammedDistributionsRequest = _reflection.GeneratedProtocolMessageType('GetTokenPreProgrammedDistributionsRequest', (_message.Message,), { 'GetTokenPreProgrammedDistributionsRequestV0' : _reflection.GeneratedProtocolMessageType('GetTokenPreProgrammedDistributionsRequestV0', (_message.Message,), { @@ -15681,6 +16287,27 @@ }) , + 'UpdateDirectPurchasePriceEvent' : _reflection.GeneratedProtocolMessageType('UpdateDirectPurchasePriceEvent', (_message.Message,), { + + 'PriceForQuantity' : _reflection.GeneratedProtocolMessageType('PriceForQuantity', (_message.Message,), { + 'DESCRIPTOR' : _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICEFORQUANTITY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity) + }) + , + + 'PricingSchedule' : _reflection.GeneratedProtocolMessageType('PricingSchedule', (_message.Message,), { + 'DESCRIPTOR' : _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule) + }) + , + 'DESCRIPTOR' : _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent) + }) + , + 'GroupActionEvent' : _reflection.GeneratedProtocolMessageType('GroupActionEvent', (_message.Message,), { 'DESCRIPTOR' : _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT, '__module__' : 'platform_pb2' @@ -15756,6 +16383,9 @@ _sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote) _sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent) _sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent) +_sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent) +_sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity) +_sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule) _sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent) _sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent) _sym_db.RegisterMessage(GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent) @@ -15855,8 +16485,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=46658, - serialized_end=52828, + serialized_start=48840, + serialized_end=55172, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -16228,10 +16858,20 @@ serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='getTokenDirectPurchasePrices', + full_name='org.dash.platform.dapi.v0.Platform.getTokenDirectPurchasePrices', + index=37, + containing_service=None, + input_type=_GETTOKENDIRECTPURCHASEPRICESREQUEST, + output_type=_GETTOKENDIRECTPURCHASEPRICESRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='getTokenPreProgrammedDistributions', full_name='org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributions', - index=37, + index=38, containing_service=None, input_type=_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST, output_type=_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE, @@ -16241,7 +16881,7 @@ _descriptor.MethodDescriptor( name='getTokenTotalSupply', full_name='org.dash.platform.dapi.v0.Platform.getTokenTotalSupply', - index=38, + index=39, containing_service=None, input_type=_GETTOKENTOTALSUPPLYREQUEST, output_type=_GETTOKENTOTALSUPPLYRESPONSE, @@ -16251,7 +16891,7 @@ _descriptor.MethodDescriptor( name='getGroupInfo', full_name='org.dash.platform.dapi.v0.Platform.getGroupInfo', - index=39, + index=40, containing_service=None, input_type=_GETGROUPINFOREQUEST, output_type=_GETGROUPINFORESPONSE, @@ -16261,7 +16901,7 @@ _descriptor.MethodDescriptor( name='getGroupInfos', full_name='org.dash.platform.dapi.v0.Platform.getGroupInfos', - index=40, + index=41, containing_service=None, input_type=_GETGROUPINFOSREQUEST, output_type=_GETGROUPINFOSRESPONSE, @@ -16271,7 +16911,7 @@ _descriptor.MethodDescriptor( name='getGroupActions', full_name='org.dash.platform.dapi.v0.Platform.getGroupActions', - index=41, + index=42, containing_service=None, input_type=_GETGROUPACTIONSREQUEST, output_type=_GETGROUPACTIONSRESPONSE, @@ -16281,7 +16921,7 @@ _descriptor.MethodDescriptor( name='getGroupActionSigners', full_name='org.dash.platform.dapi.v0.Platform.getGroupActionSigners', - index=42, + index=43, containing_service=None, input_type=_GETGROUPACTIONSIGNERSREQUEST, output_type=_GETGROUPACTIONSIGNERSRESPONSE, diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py index 7b730ee7d22..a9dfb9e0108 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py @@ -199,6 +199,11 @@ def __init__(self, channel): request_serializer=platform__pb2.GetTokenStatusesRequest.SerializeToString, response_deserializer=platform__pb2.GetTokenStatusesResponse.FromString, ) + self.getTokenDirectPurchasePrices = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getTokenDirectPurchasePrices', + request_serializer=platform__pb2.GetTokenDirectPurchasePricesRequest.SerializeToString, + response_deserializer=platform__pb2.GetTokenDirectPurchasePricesResponse.FromString, + ) self.getTokenPreProgrammedDistributions = channel.unary_unary( '/org.dash.platform.dapi.v0.Platform/getTokenPreProgrammedDistributions', request_serializer=platform__pb2.GetTokenPreProgrammedDistributionsRequest.SerializeToString, @@ -461,6 +466,12 @@ def getTokenStatuses(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getTokenDirectPurchasePrices(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def getTokenPreProgrammedDistributions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -685,6 +696,11 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.GetTokenStatusesRequest.FromString, response_serializer=platform__pb2.GetTokenStatusesResponse.SerializeToString, ), + 'getTokenDirectPurchasePrices': grpc.unary_unary_rpc_method_handler( + servicer.getTokenDirectPurchasePrices, + request_deserializer=platform__pb2.GetTokenDirectPurchasePricesRequest.FromString, + response_serializer=platform__pb2.GetTokenDirectPurchasePricesResponse.SerializeToString, + ), 'getTokenPreProgrammedDistributions': grpc.unary_unary_rpc_method_handler( servicer.getTokenPreProgrammedDistributions, request_deserializer=platform__pb2.GetTokenPreProgrammedDistributionsRequest.FromString, @@ -1354,6 +1370,23 @@ def getTokenStatuses(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def getTokenDirectPurchasePrices(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getTokenDirectPurchasePrices', + platform__pb2.GetTokenDirectPurchasePricesRequest.SerializeToString, + platform__pb2.GetTokenDirectPurchasePricesResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def getTokenPreProgrammedDistributions(request, target, diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts index cccf8127174..fa88e4f0f2d 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts @@ -7039,6 +7039,262 @@ export namespace GetTokenStatusesResponse { } } +export class GetTokenDirectPurchasePricesRequest extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 | undefined; + setV0(value?: GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0): void; + + getVersionCase(): GetTokenDirectPurchasePricesRequest.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetTokenDirectPurchasePricesRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetTokenDirectPurchasePricesRequest): GetTokenDirectPurchasePricesRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetTokenDirectPurchasePricesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetTokenDirectPurchasePricesRequest; + static deserializeBinaryFromReader(message: GetTokenDirectPurchasePricesRequest, reader: jspb.BinaryReader): GetTokenDirectPurchasePricesRequest; +} + +export namespace GetTokenDirectPurchasePricesRequest { + export type AsObject = { + v0?: GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.AsObject, + } + + export class GetTokenDirectPurchasePricesRequestV0 extends jspb.Message { + clearTokenIdsList(): void; + getTokenIdsList(): Array; + getTokenIdsList_asU8(): Array; + getTokenIdsList_asB64(): Array; + setTokenIdsList(value: Array): void; + addTokenIds(value: Uint8Array | string, index?: number): Uint8Array | string; + + getProve(): boolean; + setProve(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetTokenDirectPurchasePricesRequestV0.AsObject; + static toObject(includeInstance: boolean, msg: GetTokenDirectPurchasePricesRequestV0): GetTokenDirectPurchasePricesRequestV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetTokenDirectPurchasePricesRequestV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetTokenDirectPurchasePricesRequestV0; + static deserializeBinaryFromReader(message: GetTokenDirectPurchasePricesRequestV0, reader: jspb.BinaryReader): GetTokenDirectPurchasePricesRequestV0; + } + + export namespace GetTokenDirectPurchasePricesRequestV0 { + export type AsObject = { + tokenIdsList: Array, + prove: boolean, + } + } + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + +export class GetTokenDirectPurchasePricesResponse extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 | undefined; + setV0(value?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0): void; + + getVersionCase(): GetTokenDirectPurchasePricesResponse.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetTokenDirectPurchasePricesResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetTokenDirectPurchasePricesResponse): GetTokenDirectPurchasePricesResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetTokenDirectPurchasePricesResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetTokenDirectPurchasePricesResponse; + static deserializeBinaryFromReader(message: GetTokenDirectPurchasePricesResponse, reader: jspb.BinaryReader): GetTokenDirectPurchasePricesResponse; +} + +export namespace GetTokenDirectPurchasePricesResponse { + export type AsObject = { + v0?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.AsObject, + } + + export class GetTokenDirectPurchasePricesResponseV0 extends jspb.Message { + hasTokenDirectPurchasePrices(): boolean; + clearTokenDirectPurchasePrices(): void; + getTokenDirectPurchasePrices(): GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices | undefined; + setTokenDirectPurchasePrices(value?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices): void; + + hasProof(): boolean; + clearProof(): void; + getProof(): Proof | undefined; + setProof(value?: Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + getResultCase(): GetTokenDirectPurchasePricesResponseV0.ResultCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetTokenDirectPurchasePricesResponseV0.AsObject; + static toObject(includeInstance: boolean, msg: GetTokenDirectPurchasePricesResponseV0): GetTokenDirectPurchasePricesResponseV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetTokenDirectPurchasePricesResponseV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetTokenDirectPurchasePricesResponseV0; + static deserializeBinaryFromReader(message: GetTokenDirectPurchasePricesResponseV0, reader: jspb.BinaryReader): GetTokenDirectPurchasePricesResponseV0; + } + + export namespace GetTokenDirectPurchasePricesResponseV0 { + export type AsObject = { + tokenDirectPurchasePrices?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.AsObject, + proof?: Proof.AsObject, + metadata?: ResponseMetadata.AsObject, + } + + export class PriceForQuantity extends jspb.Message { + getQuantity(): number; + setQuantity(value: number): void; + + getPrice(): number; + setPrice(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PriceForQuantity.AsObject; + static toObject(includeInstance: boolean, msg: PriceForQuantity): PriceForQuantity.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PriceForQuantity, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PriceForQuantity; + static deserializeBinaryFromReader(message: PriceForQuantity, reader: jspb.BinaryReader): PriceForQuantity; + } + + export namespace PriceForQuantity { + export type AsObject = { + quantity: number, + price: number, + } + } + + export class PricingSchedule extends jspb.Message { + clearPriceForQuantityList(): void; + getPriceForQuantityList(): Array; + setPriceForQuantityList(value: Array): void; + addPriceForQuantity(value?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, index?: number): GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PricingSchedule.AsObject; + static toObject(includeInstance: boolean, msg: PricingSchedule): PricingSchedule.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PricingSchedule, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PricingSchedule; + static deserializeBinaryFromReader(message: PricingSchedule, reader: jspb.BinaryReader): PricingSchedule; + } + + export namespace PricingSchedule { + export type AsObject = { + priceForQuantityList: Array, + } + } + + export class Price extends jspb.Message { + hasFixedPrice(): boolean; + clearFixedPrice(): void; + getFixedPrice(): number; + setFixedPrice(value: number): void; + + hasVariablePrice(): boolean; + clearVariablePrice(): void; + getVariablePrice(): GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule | undefined; + setVariablePrice(value?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule): void; + + getPriceCase(): Price.PriceCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Price.AsObject; + static toObject(includeInstance: boolean, msg: Price): Price.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Price, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Price; + static deserializeBinaryFromReader(message: Price, reader: jspb.BinaryReader): Price; + } + + export namespace Price { + export type AsObject = { + fixedPrice: number, + variablePrice?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.AsObject, + } + + export enum PriceCase { + PRICE_NOT_SET = 0, + FIXED_PRICE = 1, + VARIABLE_PRICE = 2, + } + } + + export class TokenDirectPurchasePriceEntry extends jspb.Message { + getTokenId(): Uint8Array | string; + getTokenId_asU8(): Uint8Array; + getTokenId_asB64(): string; + setTokenId(value: Uint8Array | string): void; + + hasPrice(): boolean; + clearPrice(): void; + getPrice(): GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price | undefined; + setPrice(value?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TokenDirectPurchasePriceEntry.AsObject; + static toObject(includeInstance: boolean, msg: TokenDirectPurchasePriceEntry): TokenDirectPurchasePriceEntry.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TokenDirectPurchasePriceEntry, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TokenDirectPurchasePriceEntry; + static deserializeBinaryFromReader(message: TokenDirectPurchasePriceEntry, reader: jspb.BinaryReader): TokenDirectPurchasePriceEntry; + } + + export namespace TokenDirectPurchasePriceEntry { + export type AsObject = { + tokenId: Uint8Array | string, + price?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.AsObject, + } + } + + export class TokenDirectPurchasePrices extends jspb.Message { + clearTokenDirectPurchasePriceList(): void; + getTokenDirectPurchasePriceList(): Array; + setTokenDirectPurchasePriceList(value: Array): void; + addTokenDirectPurchasePrice(value?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, index?: number): GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TokenDirectPurchasePrices.AsObject; + static toObject(includeInstance: boolean, msg: TokenDirectPurchasePrices): TokenDirectPurchasePrices.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TokenDirectPurchasePrices, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TokenDirectPurchasePrices; + static deserializeBinaryFromReader(message: TokenDirectPurchasePrices, reader: jspb.BinaryReader): TokenDirectPurchasePrices; + } + + export namespace TokenDirectPurchasePrices { + export type AsObject = { + tokenDirectPurchasePriceList: Array, + } + } + + export enum ResultCase { + RESULT_NOT_SET = 0, + TOKEN_DIRECT_PURCHASE_PRICES = 1, + PROOF = 2, + } + } + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + export class GetTokenPreProgrammedDistributionsRequest extends jspb.Message { hasV0(): boolean; clearV0(): void; @@ -8303,6 +8559,93 @@ export namespace GetGroupActionsResponse { } } + export class UpdateDirectPurchasePriceEvent extends jspb.Message { + hasFixedPrice(): boolean; + clearFixedPrice(): void; + getFixedPrice(): number; + setFixedPrice(value: number): void; + + hasVariablePrice(): boolean; + clearVariablePrice(): void; + getVariablePrice(): GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule | undefined; + setVariablePrice(value?: GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule): void; + + hasPublicNote(): boolean; + clearPublicNote(): void; + getPublicNote(): string; + setPublicNote(value: string): void; + + getPriceCase(): UpdateDirectPurchasePriceEvent.PriceCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UpdateDirectPurchasePriceEvent.AsObject; + static toObject(includeInstance: boolean, msg: UpdateDirectPurchasePriceEvent): UpdateDirectPurchasePriceEvent.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UpdateDirectPurchasePriceEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UpdateDirectPurchasePriceEvent; + static deserializeBinaryFromReader(message: UpdateDirectPurchasePriceEvent, reader: jspb.BinaryReader): UpdateDirectPurchasePriceEvent; + } + + export namespace UpdateDirectPurchasePriceEvent { + export type AsObject = { + fixedPrice: number, + variablePrice?: GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.AsObject, + publicNote: string, + } + + export class PriceForQuantity extends jspb.Message { + getQuantity(): number; + setQuantity(value: number): void; + + getPrice(): number; + setPrice(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PriceForQuantity.AsObject; + static toObject(includeInstance: boolean, msg: PriceForQuantity): PriceForQuantity.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PriceForQuantity, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PriceForQuantity; + static deserializeBinaryFromReader(message: PriceForQuantity, reader: jspb.BinaryReader): PriceForQuantity; + } + + export namespace PriceForQuantity { + export type AsObject = { + quantity: number, + price: number, + } + } + + export class PricingSchedule extends jspb.Message { + clearPriceForQuantityList(): void; + getPriceForQuantityList(): Array; + setPriceForQuantityList(value: Array): void; + addPriceForQuantity(value?: GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity, index?: number): GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PricingSchedule.AsObject; + static toObject(includeInstance: boolean, msg: PricingSchedule): PricingSchedule.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PricingSchedule, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PricingSchedule; + static deserializeBinaryFromReader(message: PricingSchedule, reader: jspb.BinaryReader): PricingSchedule; + } + + export namespace PricingSchedule { + export type AsObject = { + priceForQuantityList: Array, + } + } + + export enum PriceCase { + PRICE_NOT_SET = 0, + FIXED_PRICE = 1, + VARIABLE_PRICE = 2, + } + } + export class GroupActionEvent extends jspb.Message { hasTokenEvent(): boolean; clearTokenEvent(): void; @@ -8481,6 +8824,11 @@ export namespace GetGroupActionsResponse { getTokenConfigUpdate(): GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent | undefined; setTokenConfigUpdate(value?: GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent): void; + hasUpdatePrice(): boolean; + clearUpdatePrice(): void; + getUpdatePrice(): GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent | undefined; + setUpdatePrice(value?: GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent): void; + getTypeCase(): TokenEvent.TypeCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TokenEvent.AsObject; @@ -8501,6 +8849,7 @@ export namespace GetGroupActionsResponse { destroyFrozenFunds?: GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.AsObject, emergencyAction?: GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.AsObject, tokenConfigUpdate?: GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.AsObject, + updatePrice?: GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.AsObject, } export enum TypeCase { @@ -8512,6 +8861,7 @@ export namespace GetGroupActionsResponse { DESTROY_FROZEN_FUNDS = 5, EMERGENCY_ACTION = 6, TOKEN_CONFIG_UPDATE = 7, + UPDATE_PRICE = 8, } } diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js index db423372350..061bc3a456e 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js @@ -179,6 +179,10 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGr goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.TypeCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0', null, { proto }); @@ -376,6 +380,19 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusRe goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetStatusResponse.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo', null, { proto }); @@ -5122,6 +5139,195 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -6004,6 +6210,69 @@ if (goog.DEBUG && !COMPILED) { */ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.displayName = 'proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.displayName = 'proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.displayName = 'proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.displayName = 'proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -54791,6 +55060,1757 @@ proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.prototype.hasV0 = funct +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + tokenIdsList: msg.getTokenIdsList_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addTokenIds(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * repeated bytes token_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes token_ids = 1; + * This is a type-conversion wrapper around `getTokenIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getTokenIdsList())); +}; + + +/** + * repeated bytes token_ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getTokenIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setTokenIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.addTokenIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.clearTokenIdsList = function() { + return this.setTokenIdsList([]); +}; + + +/** + * optional bool prove = 2; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional GetTokenDirectPurchasePricesRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.serializeBinaryToWriter + ); + } +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase = { + RESULT_NOT_SET: 0, + TOKEN_DIRECT_PURCHASE_PRICES: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject = function(includeInstance, msg) { + var f, obj = { + tokenDirectPurchasePrices: (f = msg.getTokenDirectPurchasePrices()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.deserializeBinaryFromReader); + msg.setTokenDirectPurchasePrices(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenDirectPurchasePrices(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject = function(includeInstance, msg) { + var f, obj = { + quantity: jspb.Message.getFieldWithDefault(msg, 1, 0), + price: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setQuantity(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setPrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQuantity(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getPrice(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional uint64 quantity = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.getQuantity = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.setQuantity = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 price = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.getPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.prototype.setPrice = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject = function(includeInstance, msg) { + var f, obj = { + priceForQuantityList: jspb.Message.toObjectList(msg.getPriceForQuantityList(), + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.deserializeBinaryFromReader); + msg.addPriceForQuantity(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPriceForQuantityList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated PriceForQuantity price_for_quantity = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.getPriceForQuantityList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.setPriceForQuantityList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.addPriceForQuantity = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.prototype.clearPriceForQuantityList = function() { + return this.setPriceForQuantityList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase = { + PRICE_NOT_SET: 0, + FIXED_PRICE: 1, + VARIABLE_PRICE: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getPriceCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject = function(includeInstance, msg) { + var f, obj = { + fixedPrice: jspb.Message.getFieldWithDefault(msg, 1, 0), + variablePrice: (f = msg.getVariablePrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setFixedPrice(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader); + msg.setVariablePrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeUint64( + 1, + f + ); + } + f = message.getVariablePrice(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter + ); + } +}; + + +/** + * optional uint64 fixed_price = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getFixedPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.setFixedPrice = function(value) { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.clearFixedPrice = function() { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.hasFixedPrice = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PricingSchedule variable_price = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getVariablePrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.setVariablePrice = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.clearVariablePrice = function() { + return this.setVariablePrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.hasVariablePrice = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject = function(includeInstance, msg) { + var f, obj = { + tokenId: msg.getTokenId_asB64(), + price: (f = msg.getPrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTokenId(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader); + msg.setPrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getPrice(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes token_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getTokenId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes token_id = 1; + * This is a type-conversion wrapper around `getTokenId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getTokenId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTokenId())); +}; + + +/** + * optional bytes token_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getTokenId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTokenId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setTokenId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional Price price = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getPrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setPrice = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.clearPrice = function() { + return this.setPrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.hasPrice = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject = function(includeInstance, msg) { + var f, obj = { + tokenDirectPurchasePriceList: jspb.Message.toObjectList(msg.getTokenDirectPurchasePriceList(), + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.deserializeBinaryFromReader); + msg.addTokenDirectPurchasePrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenDirectPurchasePriceList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated TokenDirectPurchasePriceEntry token_direct_purchase_price = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.getTokenDirectPurchasePriceList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.setTokenDirectPurchasePriceList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.addTokenDirectPurchasePrice = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.prototype.clearTokenDirectPurchasePriceList = function() { + return this.setTokenDirectPurchasePriceList([]); +}; + + +/** + * optional TokenDirectPurchasePrices token_direct_purchase_prices = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.getTokenDirectPurchasePrices = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.setTokenDirectPurchasePrices = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.clearTokenDirectPurchasePrices = function() { + return this.setTokenDirectPurchasePrices(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.hasTokenDirectPurchasePrices = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional GetTokenDirectPurchasePricesResponseV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -63406,6 +65426,599 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceCase = { + PRICE_NOT_SET: 0, + FIXED_PRICE: 1, + VARIABLE_PRICE: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceCase} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.getPriceCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject = function(includeInstance, msg) { + var f, obj = { + fixedPrice: jspb.Message.getFieldWithDefault(msg, 1, 0), + variablePrice: (f = msg.getVariablePrice()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(includeInstance, f), + publicNote: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent; + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setFixedPrice(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.deserializeBinaryFromReader); + msg.setVariablePrice(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPublicNote(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {number} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeUint64( + 1, + f + ); + } + f = message.getVariablePrice(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( + 3, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject = function(includeInstance, msg) { + var f, obj = { + quantity: jspb.Message.getFieldWithDefault(msg, 1, 0), + price: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity; + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setQuantity(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setPrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQuantity(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getPrice(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional uint64 quantity = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.getQuantity = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.setQuantity = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 price = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.getPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.prototype.setPrice = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject = function(includeInstance, msg) { + var f, obj = { + priceForQuantityList: jspb.Message.toObjectList(msg.getPriceForQuantityList(), + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule; + return proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.deserializeBinaryFromReader); + msg.addPriceForQuantity(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPriceForQuantityList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated PriceForQuantity price_for_quantity = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.getPriceForQuantityList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} returns this +*/ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.setPriceForQuantityList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.addPriceForQuantity = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.prototype.clearPriceForQuantityList = function() { + return this.setPriceForQuantityList([]); +}; + + +/** + * optional uint64 fixed_price = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.getFixedPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.setFixedPrice = function(value) { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.clearFixedPrice = function() { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.hasFixedPrice = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PricingSchedule variable_price = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.getVariablePrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this +*/ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.setVariablePrice = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.clearVariablePrice = function() { + return this.setVariablePrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.hasVariablePrice = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string public_note = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.getPublicNote = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.setPublicNote = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.clearPublicNote = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.prototype.hasPublicNote = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -64354,7 +66967,7 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.oneofGroups_ = [[1,2,3,4,5,6,7]]; +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.oneofGroups_ = [[1,2,3,4,5,6,7,8]]; /** * @enum {number} @@ -64367,7 +66980,8 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV UNFREEZE: 4, DESTROY_FROZEN_FUNDS: 5, EMERGENCY_ACTION: 6, - TOKEN_CONFIG_UPDATE: 7 + TOKEN_CONFIG_UPDATE: 7, + UPDATE_PRICE: 8 }; /** @@ -64414,7 +67028,8 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV unfreeze: (f = msg.getUnfreeze()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.toObject(includeInstance, f), destroyFrozenFunds: (f = msg.getDestroyFrozenFunds()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.toObject(includeInstance, f), emergencyAction: (f = msg.getEmergencyAction()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.toObject(includeInstance, f), - tokenConfigUpdate: (f = msg.getTokenConfigUpdate()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(includeInstance, f) + tokenConfigUpdate: (f = msg.getTokenConfigUpdate()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(includeInstance, f), + updatePrice: (f = msg.getUpdatePrice()) && proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(includeInstance, f) }; if (includeInstance) { @@ -64486,6 +67101,11 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.deserializeBinaryFromReader); msg.setTokenConfigUpdate(value); break; + case 8: + var value = new proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.deserializeBinaryFromReader); + msg.setUpdatePrice(value); + break; default: reader.skipField(); break; @@ -64571,6 +67191,14 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.serializeBinaryToWriter ); } + f = message.getUpdatePrice(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.serializeBinaryToWriter + ); + } }; @@ -64833,6 +67461,43 @@ proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV }; +/** + * optional UpdateDirectPurchasePriceEvent update_price = 8; + * @return {?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.prototype.getUpdatePrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent, 8)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} returns this +*/ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.prototype.setUpdatePrice = function(value) { + return jspb.Message.setOneofWrapperField(this, 8, proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} returns this + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.prototype.clearUpdatePrice = function() { + return this.setUpdatePrice(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.prototype.hasUpdatePrice = function() { + return jspb.Message.getField(this, 8) != null; +}; + + diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts index 78116e10177..6f632697052 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts @@ -337,6 +337,15 @@ type PlatformgetTokenStatuses = { readonly responseType: typeof platform_pb.GetTokenStatusesResponse; }; +type PlatformgetTokenDirectPurchasePrices = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof platform_pb.GetTokenDirectPurchasePricesRequest; + readonly responseType: typeof platform_pb.GetTokenDirectPurchasePricesResponse; +}; + type PlatformgetTokenPreProgrammedDistributions = { readonly methodName: string; readonly service: typeof Platform; @@ -430,6 +439,7 @@ export class Platform { static readonly getIdentityTokenInfos: PlatformgetIdentityTokenInfos; static readonly getIdentitiesTokenInfos: PlatformgetIdentitiesTokenInfos; static readonly getTokenStatuses: PlatformgetTokenStatuses; + static readonly getTokenDirectPurchasePrices: PlatformgetTokenDirectPurchasePrices; static readonly getTokenPreProgrammedDistributions: PlatformgetTokenPreProgrammedDistributions; static readonly getTokenTotalSupply: PlatformgetTokenTotalSupply; static readonly getGroupInfo: PlatformgetGroupInfo; @@ -803,6 +813,15 @@ export class PlatformClient { requestMessage: platform_pb.GetTokenStatusesRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetTokenStatusesResponse|null) => void ): UnaryResponse; + getTokenDirectPurchasePrices( + requestMessage: platform_pb.GetTokenDirectPurchasePricesRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetTokenDirectPurchasePricesResponse|null) => void + ): UnaryResponse; + getTokenDirectPurchasePrices( + requestMessage: platform_pb.GetTokenDirectPurchasePricesRequest, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetTokenDirectPurchasePricesResponse|null) => void + ): UnaryResponse; getTokenPreProgrammedDistributions( requestMessage: platform_pb.GetTokenPreProgrammedDistributionsRequest, metadata: grpc.Metadata, diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js index 3a5bab94009..e74d0dd15be 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js @@ -343,6 +343,15 @@ Platform.getTokenStatuses = { responseType: platform_pb.GetTokenStatusesResponse }; +Platform.getTokenDirectPurchasePrices = { + methodName: "getTokenDirectPurchasePrices", + service: Platform, + requestStream: false, + responseStream: false, + requestType: platform_pb.GetTokenDirectPurchasePricesRequest, + responseType: platform_pb.GetTokenDirectPurchasePricesResponse +}; + Platform.getTokenPreProgrammedDistributions = { methodName: "getTokenPreProgrammedDistributions", service: Platform, @@ -1551,6 +1560,37 @@ PlatformClient.prototype.getTokenStatuses = function getTokenStatuses(requestMes }; }; +PlatformClient.prototype.getTokenDirectPurchasePrices = function getTokenDirectPurchasePrices(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Platform.getTokenDirectPurchasePrices, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + PlatformClient.prototype.getTokenPreProgrammedDistributions = function getTokenPreProgrammedDistributions(requestMessage, metadata, callback) { if (arguments.length === 2) { callback = arguments[1]; From a2d29181db91991d59acf20fd93ccf0f849bf9e1 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Thu, 10 Apr 2025 13:46:02 +0700 Subject: [PATCH 13/32] small fix --- packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs index 762d05d2879..7eb3030d87d 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "server")] mod fetch_token_direct_purchase_price; mod queries; +#[cfg(feature = "server")] mod set_direct_purchase_price; From 599a57930d403993c00acdc41da67dd9d0ebe746 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Apr 2025 02:47:48 +0700 Subject: [PATCH 14/32] comments and refactor --- .../token_direct_purchase_transition/mod.rs | 14 + .../v0/mod.rs | 6 +- .../mod.rs | 23 + .../token_transition_action_type.rs | 29 + .../document/batch_transition/methods/mod.rs | 4 +- .../batch_transition/methods/v1/mod.rs | 186 +++- .../document/batch_transition/v1/mod.rs | 1 + .../batch_transition/v1/v0_methods.rs | 823 +----------------- .../batch_transition/v1/v1_methods.rs | 783 +++++++++++++++++ packages/rs-dpp/src/tokens/token_event.rs | 77 +- .../src/tokens/token_pricing_schedule.rs | 18 + .../for_token_direct_selling_prices/v0/mod.rs | 2 +- .../v0/mod.rs | 2 +- 13 files changed, 1168 insertions(+), 800 deletions(-) create mode 100644 packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v1_methods.rs diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs index e44da77d552..e36573d8a79 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/mod.rs @@ -8,12 +8,26 @@ use derive_more::{Display, From}; use serde::{Deserialize, Serialize}; pub use v0::TokenDirectPurchaseTransitionV0; +/// Represents a versioned transition for direct token purchases. +/// +/// This enum allows for forward-compatible support of different versions +/// of the `TokenDirectPurchaseTransition` structure. Each variant corresponds +/// to a specific version of the transition logic and structure. +/// +/// This transition type is used when a user intends to directly purchase tokens +/// by specifying the desired amount and the maximum total price they are willing to pay. #[derive(Debug, Clone, Encode, Decode, PartialEq, Display, From)] #[cfg_attr( feature = "state-transition-serde-conversion", derive(Serialize, Deserialize) )] pub enum TokenDirectPurchaseTransition { + /// Version 0 of the token direct purchase transition. + /// + /// This version includes the base document transition, the number of tokens + /// to purchase, and the maximum total price the user agrees to pay. + /// If the price in the contract is lower than the agreed price, the lower + /// price is used. #[display("V0({})", "_0")] V0(TokenDirectPurchaseTransitionV0), } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs index 1c70bba6908..94d950cdbf3 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_direct_purchase_transition/v0/mod.rs @@ -23,8 +23,10 @@ pub struct TokenDirectPurchaseTransitionV0 { pub base: TokenBaseTransition, /// How many tokens should we buy. pub token_count: TokenAmount, - /// Agreed price - /// The user will pay this amount + /// Price that the user is willing to pay for all the tokens. + /// The user will pay up to this amount. + /// If the actual cost of the token per the contract is less than the agreed price that the user is willing to pay + /// Then we take the actual cost per the contract. pub total_agreed_price: Credits, } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs index 537febbc887..8bb643a7da0 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_set_price_for_direct_purchase_transition/mod.rs @@ -8,15 +8,38 @@ use derive_more::{Display, From}; use serde::{Deserialize, Serialize}; pub use v0::TokenSetPriceForDirectPurchaseTransitionV0; +/// Represents a versioned transition for setting or updating the price of a token +/// available for direct purchase. +/// +/// This transition allows a token owner or controlling group to define or remove a pricing +/// schedule for direct purchases. Setting the price to `None` disables further purchases +/// of the token. +/// +/// This transition type supports **group actions**, meaning it can require **multi-signature +/// (multisig) authorization**. In such cases, multiple identities must agree and sign +/// the transition for it to be considered valid and executable. +/// +/// Versioning enables forward compatibility by allowing future enhancements or changes +/// without breaking existing clients. #[derive(Debug, Clone, Encode, Decode, PartialEq, Display, From)] #[cfg_attr( feature = "state-transition-serde-conversion", derive(Serialize, Deserialize) )] pub enum TokenSetPriceForDirectPurchaseTransition { + /// Version 0 of the token set price for direct purchase transition. + /// + /// This version includes: + /// - A base document transition. + /// - An optional pricing schedule: `Some(...)` to set the token's price, or `None` to make it non-purchasable. + /// - An optional public note. + /// + /// Group actions with multisig are supported in this version, + /// enabling shared control over token pricing among multiple authorized identities. #[display("V0({})", "_0")] V0(TokenSetPriceForDirectPurchaseTransitionV0), } + impl Default for TokenSetPriceForDirectPurchaseTransition { fn default() -> Self { TokenSetPriceForDirectPurchaseTransition::V0( diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs index 2f625cf3c15..6215c74acd7 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/batched_transition/token_transition_action_type.rs @@ -3,18 +3,47 @@ use crate::state_transition::state_transitions::document::batch_transition::batc use crate::ProtocolError; // @append-only +/// Represents the type of action described by a token-related state transition. +/// +/// `TokenTransitionActionType` is **not used by the backend system directly**, +/// but is intended to assist **client-side applications** in identifying and +/// classifying the purpose of a token state transition. +/// +/// This enum enables clients to more easily display, filter, or handle different +/// token operations, such as minting, transferring, or burning tokens. #[derive(Eq, PartialEq, Debug, Copy, Clone, Hash)] pub enum TokenTransitionActionType { + /// Indicates a burn action, where tokens are permanently removed from circulation. Burn, + + /// Indicates a mint action, where new tokens are created and added to supply. Mint, + + /// Indicates a transfer of tokens between identities. Transfer, + + /// Indicates that tokens are being frozen, preventing their use or transfer. Freeze, + + /// Indicates that previously frozen tokens are being unfrozen and made usable again. Unfreeze, + + /// Indicates the destruction of tokens that were in a frozen state. DestroyFrozenFunds, + + /// Indicates a claim action, typically used to redeem or withdraw tokens (e.g., from rewards). Claim, + + /// Indicates an emergency action, usually reserved for critical recovery or administrative intervention. EmergencyAction, + + /// Indicates a configuration update affecting token properties or behavior. ConfigUpdate, + + /// Indicates that the transition involves a direct purchase of tokens. DirectPurchase, + + /// Indicates that the transition sets or updates the price for direct token purchases. SetPriceForDirectPurchase, } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/mod.rs index a10b14274d5..d9eff435c46 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/mod.rs @@ -1068,7 +1068,7 @@ impl DocumentsBatchTransitionMethodsV1 for BatchTransition { data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, - agreed_total_cost: Credits, + total_agreed_price: Credits, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, @@ -1100,7 +1100,7 @@ impl DocumentsBatchTransitionMethodsV1 for BatchTransition { data_contract_id, token_contract_position, amount, - agreed_total_cost, + total_agreed_price, identity_public_key, identity_contract_nonce, user_fee_increase, diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs index 5ed96fb8214..edcc22d24df 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs @@ -30,7 +30,33 @@ use platform_value::Identifier; #[cfg(feature = "state-transition-signing")] use platform_version::version::PlatformVersion; +/// A trait defining methods to create various token-related state transitions as part of a document batch. +/// +/// This trait builds on `DocumentsBatchTransitionAccessorsV0` and provides a unified interface +/// for constructing signed `StateTransition`s for token operations such as minting, burning, +/// transferring, freezing, claiming, and direct purchases. +/// +/// These methods are primarily used by clients or services that need to programmatically +/// generate transitions while applying protocol-specific rules like nonce tracking, +/// version selection, group action metadata, and fee calculations. +/// +/// All methods in this trait require the `state-transition-signing` feature to be enabled. pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 { + /// Creates a `StateTransition` to mint new tokens. + /// + /// # Parameters + /// - `token_id`: ID of the token being minted. + /// - `owner_id`: ID of the token's owner. + /// - `issued_to_identity_id`: Optionally specifies the identity receiving the minted tokens. If this is not set the tokens will go to the identity set in the data contract. If neither is set we will get an error. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `amount`: Number of tokens to mint. + /// - `public_note`: Optional plaintext note. + /// - `using_group_info`: Optional group/multisig info if performing this task within a group. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that much contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_mint_transition( @@ -52,6 +78,20 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to burn tokens, permanently removing them from circulation. + /// + /// # Parameters + /// - `token_id`: ID of the token being burned. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `amount`: Number of tokens to burn. + /// - `public_note`: Optional plaintext note. + /// - `using_group_info`: Optional group/multisig info if performing this task within a group. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_burn_transition( @@ -72,6 +112,22 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to transfer tokens from one identity to another. + /// + /// # Parameters + /// - `token_id`: ID of the token being transferred. + /// - `owner_id`: ID of the token's current owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `amount`: Number of tokens to transfer. + /// - `recipient_id`: Identity ID of the recipient. + /// - `public_note`: Optional plaintext note. + /// - `shared_encrypted_note`: Optional encrypted note viewable by multiple parties. + /// - `private_encrypted_note`: Optional encrypted note viewable only by the recipient. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_transfer_transition( @@ -94,6 +150,22 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to freeze tokens belonging to a specific identity. + /// + /// Frozen tokens cannot be transferred or used until explicitly unfrozen or destroyed. + /// + /// # Parameters + /// - `token_id`: ID of the token being frozen. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `frozen_identity_id`: ID of the identity whose tokens are being frozen. + /// - `public_note`: Optional plaintext note. + /// - `using_group_info`: Optional group/multisig info if performing this task within a group. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_freeze_transition( @@ -114,6 +186,20 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to unfreeze tokens previously frozen for a specific identity. + /// + /// # Parameters + /// - `token_id`: ID of the token being unfrozen. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `frozen_identity_id`: ID of the identity whose tokens are being unfrozen. + /// - `public_note`: Optional plaintext note. + /// - `using_group_info`: Optional group/multisig info if performing this task within a group. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_unfreeze_transition( @@ -134,6 +220,20 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to destroy previously frozen tokens, removing them permanently from supply. + /// + /// # Parameters + /// - `token_id`: ID of the token being destroyed. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `frozen_identity_id`: ID of the identity whose frozen tokens are being destroyed. + /// - `public_note`: Optional plaintext note. + /// - `using_group_info`: Optional group/multisig info if performing this task within a group. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_destroy_frozen_funds_transition( @@ -154,6 +254,23 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to execute an emergency action for a token. + /// + /// Emergency actions may include critical interventions such as pausing operations, + /// revoking permissions, or executing recovery operations. + /// + /// # Parameters + /// - `token_id`: ID of the token involved. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `emergency_action`: The action to be executed. + /// - `public_note`: Optional plaintext note. + /// - `using_group_info`: Optional group/multisig info if performing this task within a group. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_emergency_action_transition( @@ -174,6 +291,23 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to update the configuration of a token. + /// + /// This includes changing properties such as max supply, permissions, or other + /// configurable behavior defined in the token contract. + /// + /// # Parameters + /// - `token_id`: ID of the token being updated. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `update_token_configuration_item`: The configuration change to be applied. + /// - `public_note`: Optional plaintext note. + /// - `using_group_info`: Optional group/multisig info if performing this task within a group. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_config_update_transition( @@ -194,6 +328,22 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to claim tokens from a distribution source. + /// + /// Used when tokens are distributed through rewards, airdrops, or other allocation + /// mechanisms that require explicit claiming by the identity. + /// + /// # Parameters + /// - `token_id`: ID of the token being claimed. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `distribution_type`: Type of token distribution (e.g., reward pool, airdrop). + /// - `public_note`: Optional plaintext note. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_claim_transition( @@ -213,6 +363,23 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to set or update the price of a token for direct purchase. + /// + /// This defines a `TokenPricingSchedule` that determines how credits are exchanged + /// for tokens. Setting the price to `None` disables the ability to purchase the token. + /// + /// # Parameters + /// - `token_id`: ID of the token whose price is being updated. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `token_pricing_schedule`: The new pricing schedule. `None` disables purchases. + /// - `public_note`: Optional plaintext note. + /// - `using_group_info`: Optional group/multisig info if performing this task within a group. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_change_direct_purchase_price_transition( @@ -233,6 +400,23 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 base_feature_version: Option, ) -> Result; + /// Creates a `StateTransition` to perform a direct purchase of tokens by a user. + /// + /// The user agrees to purchase a given amount of tokens and provides a maximum + /// total credit value they're willing to pay. If the configured price is lower than + /// this amount, the user will be charged less. + /// + /// # Parameters + /// - `token_id`: ID of the token being purchased. + /// - `owner_id`: ID of the token's owner. + /// - `data_contract_id`: The contract ID associated with the token. + /// - `token_contract_position`: The token's index within the contract. + /// - `amount`: Number of tokens to purchase. + /// - `agreed_total_cost`: Maximum credits the user agrees to pay. + /// - `identity_public_key`: Public key used for signing. + /// - `identity_contract_nonce`: Nonce to prevent replay. + /// - `user_fee_increase`: Fee adjustment parameter. + /// - `signer`: Object implementing the signer trait that must contain the private key for the identity public key. #[cfg(feature = "state-transition-signing")] #[allow(clippy::too_many_arguments)] fn new_token_direct_purchase_transition( @@ -241,7 +425,7 @@ pub trait DocumentsBatchTransitionMethodsV1: DocumentsBatchTransitionAccessorsV0 data_contract_id: Identifier, token_contract_position: u16, amount: TokenAmount, - agreed_total_cost: Credits, + total_agreed_price: Credits, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/mod.rs index 763f93b49a0..6ae54da69ee 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/mod.rs @@ -4,6 +4,7 @@ mod json_conversion; mod state_transition_like; mod types; mod v0_methods; +mod v1_methods; #[cfg(feature = "state-transition-value-conversion")] mod value_conversion; mod version; diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs index 54316f7412d..a81910c3fe4 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v0_methods.rs @@ -27,9 +27,7 @@ use crate::state_transition::batch_transition::methods::v0::DocumentsBatchTransi use std::iter::Map; use std::slice::Iter; -use crate::state_transition::batch_transition::{BatchTransitionV1, TokenDirectPurchaseTransition, TokenSetPriceForDirectPurchaseTransition}; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::{TokenClaimTransition, TokenBurnTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenTransferTransition, TokenUnfreezeTransition}; +use crate::state_transition::batch_transition::BatchTransitionV1; #[cfg(feature = "state-transition-signing")] use crate::state_transition::batch_transition::{ BatchTransition, DocumentDeleteTransition, @@ -41,55 +39,11 @@ use crate::ProtocolError; use platform_value::Identifier; #[cfg(feature = "state-transition-signing")] use platform_version::version::{FeatureVersion, PlatformVersion}; -#[cfg(feature = "state-transition-signing")] -use crate::balances::credits::TokenAmount; -#[cfg(feature = "state-transition-signing")] -use crate::data_contract::associated_token::token_configuration_item::TokenConfigurationChangeItem; -#[cfg(feature = "state-transition-signing")] -use crate::data_contract::associated_token::token_distribution_key::TokenDistributionType; -#[cfg(feature = "state-transition-signing")] -use crate::group::{GroupStateTransitionInfo, GroupStateTransitionInfoStatus}; use crate::state_transition::batch_transition::document_create_transition::v0::v0_methods::DocumentCreateTransitionV0Methods; use crate::state_transition::batch_transition::batched_transition::document_purchase_transition::v0::v0_methods::DocumentPurchaseTransitionV0Methods; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::batched_transition::multi_party_action::AllowedAsMultiPartyAction; -use crate::state_transition::batch_transition::methods::v1::DocumentsBatchTransitionMethodsV1; use crate::state_transition::batch_transition::resolvers::v0::BatchTransitionResolversV0; #[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_base_transition::token_base_transition_accessors::TokenBaseTransitionAccessors; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_base_transition::v0::TokenBaseTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_base_transition::v0::v0_methods::TokenBaseTransitionV0Methods; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_burn_transition::TokenBurnTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_claim_transition::TokenClaimTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_config_update_transition::TokenConfigUpdateTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_destroy_frozen_funds_transition::TokenDestroyFrozenFundsTransitionV0; -use crate::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_emergency_action_transition::TokenEmergencyActionTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_freeze_transition::TokenFreezeTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_mint_transition::TokenMintTransitionV0; -use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_transfer_transition::TokenTransferTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::state_transition::batch_transition::token_unfreeze_transition::TokenUnfreezeTransitionV0; -#[cfg(feature = "state-transition-signing")] -use crate::tokens::emergency_action::TokenEmergencyAction; -#[cfg(feature = "state-transition-signing")] -use crate::tokens::{PrivateEncryptedNote, SharedEncryptedNote}; -#[cfg(feature = "state-transition-signing")] use crate::tokens::token_payment_info::TokenPaymentInfo; -use crate::tokens::token_pricing_schedule::TokenPricingSchedule; impl DocumentsBatchTransitionAccessorsV0 for BatchTransitionV1 { type IterType<'a> @@ -215,10 +169,9 @@ impl DocumentsBatchTransitionMethodsV0 for BatchTransitionV1 { } #[cfg(feature = "state-transition-signing")] - fn new_document_transfer_transition_from_document( + fn new_document_deletion_transition_from_document( document: Document, document_type: DocumentTypeRef, - recipient_owner_id: Identifier, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, @@ -226,23 +179,22 @@ impl DocumentsBatchTransitionMethodsV0 for BatchTransitionV1 { signer: &S, platform_version: &PlatformVersion, _batch_feature_version: Option, - transfer_feature_version: Option, + delete_feature_version: Option, base_feature_version: Option, ) -> Result { let owner_id = document.owner_id(); - let transfer_transition = DocumentTransferTransition::from_document( + let delete_transition = DocumentDeleteTransition::from_document( document, document_type, token_payment_info, identity_contract_nonce, - recipient_owner_id, platform_version, - transfer_feature_version, + delete_feature_version, base_feature_version, )?; let documents_batch_transition: BatchTransition = BatchTransitionV1 { owner_id, - transitions: vec![BatchedTransition::Document(transfer_transition.into())], + transitions: vec![BatchedTransition::Document(delete_transition.into())], user_fee_increase, signature_public_key_id: 0, signature: Default::default(), @@ -258,9 +210,10 @@ impl DocumentsBatchTransitionMethodsV0 for BatchTransitionV1 { } #[cfg(feature = "state-transition-signing")] - fn new_document_deletion_transition_from_document( + fn new_document_transfer_transition_from_document( document: Document, document_type: DocumentTypeRef, + recipient_owner_id: Identifier, identity_public_key: &IdentityPublicKey, identity_contract_nonce: IdentityNonce, user_fee_increase: UserFeeIncrease, @@ -268,22 +221,23 @@ impl DocumentsBatchTransitionMethodsV0 for BatchTransitionV1 { signer: &S, platform_version: &PlatformVersion, _batch_feature_version: Option, - delete_feature_version: Option, + transfer_feature_version: Option, base_feature_version: Option, ) -> Result { let owner_id = document.owner_id(); - let delete_transition = DocumentDeleteTransition::from_document( + let transfer_transition = DocumentTransferTransition::from_document( document, document_type, token_payment_info, identity_contract_nonce, + recipient_owner_id, platform_version, - delete_feature_version, + transfer_feature_version, base_feature_version, )?; let documents_batch_transition: BatchTransition = BatchTransitionV1 { owner_id, - transitions: vec![BatchedTransition::Document(delete_transition.into())], + transitions: vec![BatchedTransition::Document(transfer_transition.into())], user_fee_increase, signature_public_key_id: 0, signature: Default::default(), @@ -394,29 +348,6 @@ impl DocumentsBatchTransitionMethodsV0 for BatchTransitionV1 { .for_each(|transition| transition.set_identity_contract_nonce(identity_contract_nonce)); } - fn all_document_purchases_amount(&self) -> Result, ProtocolError> { - let (total, any_purchases): (Option, bool) = self - .transitions - .iter() - .filter_map(|transition| { - transition - .as_transition_purchase() - .map(|purchase| purchase.price()) - }) - .fold((None, false), |(acc, _), price| match acc { - Some(acc_val) => acc_val - .checked_add(price) - .map_or((None, true), |sum| (Some(sum), true)), - None => (Some(price), true), - }); - - match (total, any_purchases) { - (Some(total), _) => Ok(Some(total)), - (None, true) => Err(ProtocolError::Overflow("overflow in all purchases amount")), // Overflow occurred - _ => Ok(None), // No purchases were found - } - } - fn all_conflicting_index_collateral_voting_funds( &self, ) -> Result, ProtocolError> { @@ -449,719 +380,27 @@ impl DocumentsBatchTransitionMethodsV0 for BatchTransitionV1 { _ => Ok(None), } } -} - -impl DocumentsBatchTransitionMethodsV1 for BatchTransitionV1 { - #[cfg(feature = "state-transition-signing")] - fn new_token_mint_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - amount: TokenAmount, - issued_to_identity_id: Option, - public_note: Option, - using_group_info: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _delete_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let mut mint_transition = TokenMintTransition::V0(TokenMintTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - issued_to_identity_id, - amount, - public_note, - }); - - if let Some(using_group_info_status) = using_group_info { - match using_group_info_status { - GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( - group_contract_position, - ) => { - let action_id = mint_transition.calculate_action_id(owner_id); - mint_transition.base_mut().set_using_group_info(Some( - GroupStateTransitionInfo { - group_contract_position, - action_id, - action_is_proposer: true, - }, - )) - } - GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { - mint_transition.base_mut().set_using_group_info(Some(info)) - } - } - } - - let documents_batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(mint_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - let mut state_transition: StateTransition = documents_batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - Ok(state_transition) - } - - #[cfg(feature = "state-transition-signing")] - fn new_token_burn_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - amount: TokenAmount, - public_note: Option, - using_group_info: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _delete_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let mut burn_transition = TokenBurnTransition::V0(TokenBurnTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - burn_amount: amount, - public_note, - }); - - if let Some(using_group_info_status) = using_group_info { - match using_group_info_status { - GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( - group_contract_position, - ) => { - let action_id = burn_transition.calculate_action_id(owner_id); - burn_transition.base_mut().set_using_group_info(Some( - GroupStateTransitionInfo { - group_contract_position, - action_id, - action_is_proposer: true, - }, - )) - } - GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { - burn_transition.base_mut().set_using_group_info(Some(info)) - } - } - } - - // Wrap in a batch transition - let documents_batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(burn_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - - // Create the state transition - let mut state_transition: StateTransition = documents_batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - - Ok(state_transition) - } - #[cfg(feature = "state-transition-signing")] - fn new_token_transfer_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - amount: TokenAmount, - recipient_id: Identifier, - public_note: Option, - shared_encrypted_note: Option, - private_encrypted_note: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _delete_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - // Create the transfer transition for batch version 1 - let transfer_transition = TokenTransferTransition::V0(TokenTransferTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - recipient_id, - amount, - public_note, - shared_encrypted_note, - private_encrypted_note, - }); - - // Wrap in a batch transition - let documents_batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(transfer_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - - // Create the state transition - let mut state_transition: StateTransition = documents_batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - - Ok(state_transition) - } - - #[cfg(feature = "state-transition-signing")] - fn new_token_freeze_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - frozen_identity_id: Identifier, - public_note: Option, - using_group_info: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _delete_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let mut freeze_transition = TokenFreezeTransition::V0(TokenFreezeTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - identity_to_freeze_id: frozen_identity_id, - public_note, - }); - - if let Some(using_group_info_status) = using_group_info { - match using_group_info_status { - GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( - group_contract_position, - ) => { - let action_id = freeze_transition.calculate_action_id(owner_id); - freeze_transition.base_mut().set_using_group_info(Some( - GroupStateTransitionInfo { - group_contract_position, - action_id, - action_is_proposer: true, - }, - )) - } - GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { - freeze_transition - .base_mut() - .set_using_group_info(Some(info)) - } - } - } - - let documents_batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(freeze_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - let mut state_transition: StateTransition = documents_batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - Ok(state_transition) - } - - #[cfg(feature = "state-transition-signing")] - fn new_token_unfreeze_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - frozen_identity_id: Identifier, - public_note: Option, - using_group_info: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _delete_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let mut unfreeze_transition = TokenUnfreezeTransition::V0(TokenUnfreezeTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - frozen_identity_id, - public_note, - }); - - if let Some(using_group_info_status) = using_group_info { - match using_group_info_status { - GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( - group_contract_position, - ) => { - let action_id = unfreeze_transition.calculate_action_id(owner_id); - unfreeze_transition.base_mut().set_using_group_info(Some( - GroupStateTransitionInfo { - group_contract_position, - action_id, - action_is_proposer: true, - }, - )) - } - GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { - unfreeze_transition - .base_mut() - .set_using_group_info(Some(info)) - } - } - } - - let documents_batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(unfreeze_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - let mut state_transition: StateTransition = documents_batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - Ok(state_transition) - } - #[cfg(feature = "state-transition-signing")] - fn new_token_destroy_frozen_funds_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - frozen_identity_id: Identifier, - public_note: Option, - using_group_info: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _delete_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let mut destroy_frozen_funds_transition = - TokenDestroyFrozenFundsTransition::V0(TokenDestroyFrozenFundsTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - frozen_identity_id, - public_note, - }); - - if let Some(using_group_info_status) = using_group_info { - match using_group_info_status { - GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( - group_contract_position, - ) => { - let action_id = destroy_frozen_funds_transition.calculate_action_id(owner_id); - destroy_frozen_funds_transition - .base_mut() - .set_using_group_info(Some(GroupStateTransitionInfo { - group_contract_position, - action_id, - action_is_proposer: true, - })) - } - GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { - destroy_frozen_funds_transition - .base_mut() - .set_using_group_info(Some(info)) - } - } - } - - let batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token( - destroy_frozen_funds_transition.into(), - )], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - let mut state_transition: StateTransition = batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - Ok(state_transition) - } - - #[cfg(feature = "state-transition-signing")] - fn new_token_emergency_action_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - emergency_action: TokenEmergencyAction, - public_note: Option, - using_group_info: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _delete_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let mut emergency_action_transition = - TokenEmergencyActionTransition::V0(TokenEmergencyActionTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - emergency_action, - public_note, - }); - - if let Some(using_group_info_status) = using_group_info { - match using_group_info_status { - GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( - group_contract_position, - ) => { - let action_id = emergency_action_transition.calculate_action_id(owner_id); - emergency_action_transition - .base_mut() - .set_using_group_info(Some(GroupStateTransitionInfo { - group_contract_position, - action_id, - action_is_proposer: true, - })) - } - GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { - emergency_action_transition - .base_mut() - .set_using_group_info(Some(info)) - } - } - } - - let batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(emergency_action_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - let mut state_transition: StateTransition = batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - Ok(state_transition) - } - - #[cfg(feature = "state-transition-signing")] - fn new_token_config_update_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - update_token_configuration_item: TokenConfigurationChangeItem, - public_note: Option, - using_group_info: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _config_update_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let mut config_update_transition = - TokenConfigUpdateTransition::V0(TokenConfigUpdateTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - update_token_configuration_item, - public_note, + fn all_document_purchases_amount(&self) -> Result, ProtocolError> { + let (total, any_purchases): (Option, bool) = self + .transitions + .iter() + .filter_map(|transition| { + transition + .as_transition_purchase() + .map(|purchase| purchase.price()) + }) + .fold((None, false), |(acc, _), price| match acc { + Some(acc_val) => acc_val + .checked_add(price) + .map_or((None, true), |sum| (Some(sum), true)), + None => (Some(price), true), }); - if let Some(using_group_info_status) = using_group_info { - match using_group_info_status { - GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( - group_contract_position, - ) => { - let action_id = config_update_transition.calculate_action_id(owner_id); - config_update_transition - .base_mut() - .set_using_group_info(Some(GroupStateTransitionInfo { - group_contract_position, - action_id, - action_is_proposer: true, - })) - } - GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { - config_update_transition - .base_mut() - .set_using_group_info(Some(info)) - } - } - } - - let batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(config_update_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - let mut state_transition: StateTransition = batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::CRITICAL)), - )?; - Ok(state_transition) - } - - #[cfg(feature = "state-transition-signing")] - fn new_token_claim_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - distribution_type: TokenDistributionType, - public_note: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _config_update_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let claim_transition = TokenClaimTransition::V0(TokenClaimTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - distribution_type, - public_note, - }); - - let batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(claim_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - let mut state_transition: StateTransition = batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::CRITICAL)), - )?; - Ok(state_transition) - } - - #[cfg(feature = "state-transition-signing")] - fn new_token_direct_purchase_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - amount: TokenAmount, - agreed_total_cost: Credits, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _config_update_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let claim_transition = TokenDirectPurchaseTransition::V0(TokenDirectPurchaseTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - token_count: amount, - total_agreed_price: agreed_total_cost, - }); - - let batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token(claim_transition.into())], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), - } - .into(); - let mut state_transition: StateTransition = batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - Ok(state_transition) - } - - #[cfg(feature = "state-transition-signing")] - fn new_token_change_direct_purchase_price_transition( - token_id: Identifier, - owner_id: Identifier, - data_contract_id: Identifier, - token_contract_position: u16, - token_pricing_schedule: Option, - public_note: Option, - using_group_info: Option, - identity_public_key: &IdentityPublicKey, - identity_contract_nonce: IdentityNonce, - user_fee_increase: UserFeeIncrease, - signer: &S, - _platform_version: &PlatformVersion, - _batch_feature_version: Option, - _config_update_feature_version: Option, - _base_feature_version: Option, - ) -> Result { - let mut change_direct_purchase_price_transition = - TokenSetPriceForDirectPurchaseTransition::V0( - TokenSetPriceForDirectPurchaseTransitionV0 { - base: TokenBaseTransition::V0(TokenBaseTransitionV0 { - identity_contract_nonce, - token_contract_position, - data_contract_id, - token_id, - using_group_info: None, - }), - price: token_pricing_schedule, - public_note, - }, - ); - - if let Some(using_group_info_status) = using_group_info { - match using_group_info_status { - GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( - group_contract_position, - ) => { - let action_id = - change_direct_purchase_price_transition.calculate_action_id(owner_id); - change_direct_purchase_price_transition - .base_mut() - .set_using_group_info(Some(GroupStateTransitionInfo { - group_contract_position, - action_id, - action_is_proposer: true, - })) - } - GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { - change_direct_purchase_price_transition - .base_mut() - .set_using_group_info(Some(info)) - } - } - } - - let batch_transition: BatchTransition = BatchTransitionV1 { - owner_id, - transitions: vec![BatchedTransition::Token( - change_direct_purchase_price_transition.into(), - )], - user_fee_increase, - signature_public_key_id: 0, - signature: Default::default(), + match (total, any_purchases) { + (Some(total), _) => Ok(Some(total)), + (None, true) => Err(ProtocolError::Overflow("overflow in all purchases amount")), // Overflow occurred + _ => Ok(None), // No purchases were found } - .into(); - let mut state_transition: StateTransition = batch_transition.into(); - state_transition.sign_external( - identity_public_key, - signer, - Some(|_, _| Ok(SecurityLevel::HIGH)), - )?; - Ok(state_transition) } } diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v1_methods.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v1_methods.rs new file mode 100644 index 00000000000..501eeb1efea --- /dev/null +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/v1/v1_methods.rs @@ -0,0 +1,783 @@ +use crate::fee::Credits; +#[cfg(feature = "state-transition-signing")] +use crate::identity::signer::Signer; +#[cfg(feature = "state-transition-signing")] +use crate::identity::SecurityLevel; +use crate::prelude::IdentityNonce; +#[cfg(feature = "state-transition-signing")] +use crate::prelude::IdentityPublicKey; +#[cfg(feature = "state-transition-signing")] +use crate::prelude::UserFeeIncrease; +use crate::state_transition::batch_transition::batched_transition::BatchedTransition; +use crate::state_transition::batch_transition::{BatchTransitionV1, TokenDirectPurchaseTransition, TokenSetPriceForDirectPurchaseTransition}; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::{TokenClaimTransition, TokenBurnTransition, TokenConfigUpdateTransition, TokenDestroyFrozenFundsTransition, TokenEmergencyActionTransition, TokenFreezeTransition, TokenMintTransition, TokenTransferTransition, TokenUnfreezeTransition}; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::BatchTransition; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::StateTransition; +use crate::ProtocolError; +#[cfg(feature = "state-transition-signing")] +use platform_value::Identifier; +#[cfg(feature = "state-transition-signing")] +use platform_version::version::{FeatureVersion, PlatformVersion}; +#[cfg(feature = "state-transition-signing")] +use crate::balances::credits::TokenAmount; +#[cfg(feature = "state-transition-signing")] +use crate::data_contract::associated_token::token_configuration_item::TokenConfigurationChangeItem; +#[cfg(feature = "state-transition-signing")] +use crate::data_contract::associated_token::token_distribution_key::TokenDistributionType; +#[cfg(feature = "state-transition-signing")] +use crate::group::{GroupStateTransitionInfo, GroupStateTransitionInfoStatus}; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::batched_transition::multi_party_action::AllowedAsMultiPartyAction; +use crate::state_transition::batch_transition::methods::v1::DocumentsBatchTransitionMethodsV1; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_base_transition::token_base_transition_accessors::TokenBaseTransitionAccessors; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_base_transition::TokenBaseTransition; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_base_transition::v0::TokenBaseTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_base_transition::v0::v0_methods::TokenBaseTransitionV0Methods; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_burn_transition::TokenBurnTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_claim_transition::TokenClaimTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_config_update_transition::TokenConfigUpdateTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_destroy_frozen_funds_transition::TokenDestroyFrozenFundsTransitionV0; +use crate::state_transition::batch_transition::token_direct_purchase_transition::TokenDirectPurchaseTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_emergency_action_transition::TokenEmergencyActionTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_freeze_transition::TokenFreezeTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_mint_transition::TokenMintTransitionV0; +use crate::state_transition::batch_transition::token_set_price_for_direct_purchase_transition::TokenSetPriceForDirectPurchaseTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_transfer_transition::TokenTransferTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::state_transition::batch_transition::token_unfreeze_transition::TokenUnfreezeTransitionV0; +#[cfg(feature = "state-transition-signing")] +use crate::tokens::emergency_action::TokenEmergencyAction; +#[cfg(feature = "state-transition-signing")] +use crate::tokens::{PrivateEncryptedNote, SharedEncryptedNote}; +use crate::tokens::token_pricing_schedule::TokenPricingSchedule; + +impl DocumentsBatchTransitionMethodsV1 for BatchTransitionV1 { + #[cfg(feature = "state-transition-signing")] + fn new_token_mint_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + amount: TokenAmount, + issued_to_identity_id: Option, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _delete_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut mint_transition = TokenMintTransition::V0(TokenMintTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + issued_to_identity_id, + amount, + public_note, + }); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = mint_transition.calculate_action_id(owner_id); + mint_transition.base_mut().set_using_group_info(Some( + GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + }, + )) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + mint_transition.base_mut().set_using_group_info(Some(info)) + } + } + } + + let documents_batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(mint_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = documents_batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_burn_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + amount: TokenAmount, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _delete_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut burn_transition = TokenBurnTransition::V0(TokenBurnTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + burn_amount: amount, + public_note, + }); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = burn_transition.calculate_action_id(owner_id); + burn_transition.base_mut().set_using_group_info(Some( + GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + }, + )) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + burn_transition.base_mut().set_using_group_info(Some(info)) + } + } + } + + // Wrap in a batch transition + let documents_batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(burn_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + + // Create the state transition + let mut state_transition: StateTransition = documents_batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + + Ok(state_transition) + } + #[cfg(feature = "state-transition-signing")] + fn new_token_transfer_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + amount: TokenAmount, + recipient_id: Identifier, + public_note: Option, + shared_encrypted_note: Option, + private_encrypted_note: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _delete_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + // Create the transfer transition for batch version 1 + let transfer_transition = TokenTransferTransition::V0(TokenTransferTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + recipient_id, + amount, + public_note, + shared_encrypted_note, + private_encrypted_note, + }); + + // Wrap in a batch transition + let documents_batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(transfer_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + + // Create the state transition + let mut state_transition: StateTransition = documents_batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_freeze_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + frozen_identity_id: Identifier, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _delete_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut freeze_transition = TokenFreezeTransition::V0(TokenFreezeTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + identity_to_freeze_id: frozen_identity_id, + public_note, + }); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = freeze_transition.calculate_action_id(owner_id); + freeze_transition.base_mut().set_using_group_info(Some( + GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + }, + )) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + freeze_transition + .base_mut() + .set_using_group_info(Some(info)) + } + } + } + + let documents_batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(freeze_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = documents_batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_unfreeze_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + frozen_identity_id: Identifier, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _delete_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut unfreeze_transition = TokenUnfreezeTransition::V0(TokenUnfreezeTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + frozen_identity_id, + public_note, + }); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = unfreeze_transition.calculate_action_id(owner_id); + unfreeze_transition.base_mut().set_using_group_info(Some( + GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + }, + )) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + unfreeze_transition + .base_mut() + .set_using_group_info(Some(info)) + } + } + } + + let documents_batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(unfreeze_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = documents_batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_destroy_frozen_funds_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + frozen_identity_id: Identifier, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _delete_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut destroy_frozen_funds_transition = + TokenDestroyFrozenFundsTransition::V0(TokenDestroyFrozenFundsTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + frozen_identity_id, + public_note, + }); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = destroy_frozen_funds_transition.calculate_action_id(owner_id); + destroy_frozen_funds_transition + .base_mut() + .set_using_group_info(Some(GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + })) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + destroy_frozen_funds_transition + .base_mut() + .set_using_group_info(Some(info)) + } + } + } + + let batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token( + destroy_frozen_funds_transition.into(), + )], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_emergency_action_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + emergency_action: TokenEmergencyAction, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _delete_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut emergency_action_transition = + TokenEmergencyActionTransition::V0(TokenEmergencyActionTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + emergency_action, + public_note, + }); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = emergency_action_transition.calculate_action_id(owner_id); + emergency_action_transition + .base_mut() + .set_using_group_info(Some(GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + })) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + emergency_action_transition + .base_mut() + .set_using_group_info(Some(info)) + } + } + } + + let batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(emergency_action_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_config_update_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + update_token_configuration_item: TokenConfigurationChangeItem, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _config_update_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut config_update_transition = + TokenConfigUpdateTransition::V0(TokenConfigUpdateTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + update_token_configuration_item, + public_note, + }); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = config_update_transition.calculate_action_id(owner_id); + config_update_transition + .base_mut() + .set_using_group_info(Some(GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + })) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + config_update_transition + .base_mut() + .set_using_group_info(Some(info)) + } + } + } + + let batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(config_update_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::CRITICAL)), + )?; + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_claim_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + distribution_type: TokenDistributionType, + public_note: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _config_update_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let claim_transition = TokenClaimTransition::V0(TokenClaimTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + distribution_type, + public_note, + }); + + let batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(claim_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::CRITICAL)), + )?; + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_change_direct_purchase_price_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + token_pricing_schedule: Option, + public_note: Option, + using_group_info: Option, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _config_update_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let mut change_direct_purchase_price_transition = + TokenSetPriceForDirectPurchaseTransition::V0( + TokenSetPriceForDirectPurchaseTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + price: token_pricing_schedule, + public_note, + }, + ); + + if let Some(using_group_info_status) = using_group_info { + match using_group_info_status { + GroupStateTransitionInfoStatus::GroupStateTransitionInfoProposer( + group_contract_position, + ) => { + let action_id = + change_direct_purchase_price_transition.calculate_action_id(owner_id); + change_direct_purchase_price_transition + .base_mut() + .set_using_group_info(Some(GroupStateTransitionInfo { + group_contract_position, + action_id, + action_is_proposer: true, + })) + } + GroupStateTransitionInfoStatus::GroupStateTransitionInfoOtherSigner(info) => { + change_direct_purchase_price_transition + .base_mut() + .set_using_group_info(Some(info)) + } + } + } + + let batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token( + change_direct_purchase_price_transition.into(), + )], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } + + #[cfg(feature = "state-transition-signing")] + fn new_token_direct_purchase_transition( + token_id: Identifier, + owner_id: Identifier, + data_contract_id: Identifier, + token_contract_position: u16, + amount: TokenAmount, + total_agreed_price: Credits, + identity_public_key: &IdentityPublicKey, + identity_contract_nonce: IdentityNonce, + user_fee_increase: UserFeeIncrease, + signer: &S, + _platform_version: &PlatformVersion, + _batch_feature_version: Option, + _config_update_feature_version: Option, + _base_feature_version: Option, + ) -> Result { + let direct_purchase_transition = + TokenDirectPurchaseTransition::V0(TokenDirectPurchaseTransitionV0 { + base: TokenBaseTransition::V0(TokenBaseTransitionV0 { + identity_contract_nonce, + token_contract_position, + data_contract_id, + token_id, + using_group_info: None, + }), + token_count: amount, + total_agreed_price, + }); + + let batch_transition: BatchTransition = BatchTransitionV1 { + owner_id, + transitions: vec![BatchedTransition::Token(direct_purchase_transition.into())], + user_fee_increase, + signature_public_key_id: 0, + signature: Default::default(), + } + .into(); + let mut state_transition: StateTransition = batch_transition.into(); + state_transition.sign_external( + identity_public_key, + signer, + Some(|_, _| Ok(SecurityLevel::HIGH)), + )?; + Ok(state_transition) + } +} diff --git a/packages/rs-dpp/src/tokens/token_event.rs b/packages/rs-dpp/src/tokens/token_event.rs index 3ca925cf231..6181ab881ff 100644 --- a/packages/rs-dpp/src/tokens/token_event.rs +++ b/packages/rs-dpp/src/tokens/token_event.rs @@ -29,21 +29,70 @@ use crate::tokens::token_pricing_schedule::TokenPricingSchedule; use crate::tokens::SharedEncryptedNote; use crate::ProtocolError; +/// Alias representing the identity that will receive tokens or other effects from a token operation. pub type RecipientIdentifier = Identifier; +/// Alias representing the identity performing a token purchase. pub type PurchaserIdentifier = Identifier; + +/// Alias representing the identity whose tokens are subject to freezing or unfreezing. pub type FrozenIdentifier = Identifier; +/// Represents a recorded token-related operation for use in historical documents and group actions. +/// +/// `TokenEvent` is designed to encapsulate a single logical token operation, +/// such as minting, burning, transferring, or freezing tokens. These events are typically: +/// +/// - **Persisted as historical records** of state transitions, enabling auditability and tracking. +/// - **Used in group (multisig) actions**, where multiple identities collaborate to authorize complex transitions. +/// +/// This enum includes rich metadata for each type of operation, such as optional notes (plaintext or encrypted), +/// involved identities, and amounts. It is **externally versioned** and marked as `unversioned` in platform serialization, +/// meaning each variant is self-contained without requiring version dispatching logic. #[derive( Debug, PartialEq, PartialOrd, Clone, Eq, Encode, Decode, PlatformDeserialize, PlatformSerialize, )] -#[platform_serialize(unversioned)] //versioned directly, no need to use platform_version +#[platform_serialize(unversioned)] pub enum TokenEvent { + /// Event representing the minting of tokens to a recipient. + /// + /// - `TokenAmount`: The amount of tokens minted. + /// - `RecipientIdentifier`: The identity receiving the minted tokens. + /// - `TokenEventPublicNote`: Optional note associated with the event. Mint(TokenAmount, RecipientIdentifier, TokenEventPublicNote), + + /// Event representing the burning of tokens, removing them from circulation. + /// + /// - `TokenAmount`: The amount of tokens burned. + /// - `TokenEventPublicNote`: Optional note associated with the event. Burn(TokenAmount, TokenEventPublicNote), + + /// Event representing freezing of tokens for a specific identity. + /// + /// - `FrozenIdentifier`: The identity whose tokens are frozen. + /// - `TokenEventPublicNote`: Optional note associated with the event. Freeze(FrozenIdentifier, TokenEventPublicNote), + + /// Event representing unfreezing of tokens for a specific identity. + /// + /// - `FrozenIdentifier`: The identity whose tokens are unfrozen. + /// - `TokenEventPublicNote`: Optional note associated with the event. Unfreeze(FrozenIdentifier, TokenEventPublicNote), + + /// Event representing destruction of tokens that were previously frozen. + /// + /// - `FrozenIdentifier`: The identity whose frozen tokens are destroyed. + /// - `TokenAmount`: The amount of frozen tokens destroyed. + /// - `TokenEventPublicNote`: Optional note associated with the event. DestroyFrozenFunds(FrozenIdentifier, TokenAmount, TokenEventPublicNote), + + /// Event representing a transfer of tokens from one identity to another. + /// + /// - `RecipientIdentifier`: The recipient of the tokens. + /// - `TokenEventPublicNote`: Optional plaintext note. + /// - `TokenEventSharedEncryptedNote`: Optional shared encrypted metadata (multi-party). + /// - `TokenEventPersonalEncryptedNote`: Optional private encrypted metadata (recipient-only). + /// - `TokenAmount`: The amount of tokens transferred. Transfer( RecipientIdentifier, TokenEventPublicNote, @@ -51,14 +100,40 @@ pub enum TokenEvent { TokenEventPersonalEncryptedNote, TokenAmount, ), + + /// Event representing a claim of tokens from a distribution pool or source. + /// + /// - `TokenDistributionTypeWithResolvedRecipient`: Type and resolved recipient of the claim. + /// - `TokenAmount`: The amount of tokens claimed. + /// - `TokenEventPublicNote`: Optional note associated with the event. Claim( TokenDistributionTypeWithResolvedRecipient, TokenAmount, TokenEventPublicNote, ), + + /// Event representing an emergency action taken on a token or identity. + /// + /// - `TokenEmergencyAction`: The type of emergency action performed. + /// - `TokenEventPublicNote`: Optional note associated with the event. EmergencyAction(TokenEmergencyAction, TokenEventPublicNote), + + /// Event representing an update to the configuration of a token. + /// + /// - `TokenConfigurationChangeItem`: The configuration change that was applied. + /// - `TokenEventPublicNote`: Optional note associated with the event. ConfigUpdate(TokenConfigurationChangeItem, TokenEventPublicNote), + + /// Event representing a change in the direct purchase price of a token. + /// + /// - `Option`: The new pricing schedule. `None` disables direct purchase. + /// - `TokenEventPublicNote`: Optional note associated with the event. ChangePriceForDirectPurchase(Option, TokenEventPublicNote), + + /// Event representing the direct purchase of tokens by a user. + /// + /// - `TokenAmount`: The amount of tokens purchased. + /// - `Credits`: The number of credits paid. DirectPurchase(TokenAmount, Credits), } diff --git a/packages/rs-dpp/src/tokens/token_pricing_schedule.rs b/packages/rs-dpp/src/tokens/token_pricing_schedule.rs index eed804950c5..ea77b9d7e83 100644 --- a/packages/rs-dpp/src/tokens/token_pricing_schedule.rs +++ b/packages/rs-dpp/src/tokens/token_pricing_schedule.rs @@ -7,6 +7,11 @@ use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use std::fmt::{self, Display, Formatter}; +/// Defines the pricing schedule for tokens in terms of credits. +/// +/// A pricing schedule can either be a single, flat price applied to all +/// token amounts, or a tiered pricing model where specific amounts +/// correspond to specific credit values. #[derive( Debug, Clone, @@ -24,7 +29,20 @@ use std::fmt::{self, Display, Formatter}; derive(Serialize, Deserialize) )] pub enum TokenPricingSchedule { + /// A single flat price in credits for all token amounts. + /// + /// This variant is used when the pricing does not depend on + /// the number of tokens being purchased or processed. SinglePrice(Credits), + + /// A tiered pricing model where specific token amounts map to credit prices. + /// + /// This allows for more complex pricing structures, such as + /// volume discounts or progressive pricing. The map keys + /// represent token amount thresholds, and the values are the + /// corresponding credit prices. + /// If the first token amount is greater than 1 this means that the user can only + /// purchase that amount as a minimum at a time. SetPrices(BTreeMap), } diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs index 00a2ab0979c..7fde6c45cf5 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs @@ -44,7 +44,7 @@ impl Drive { /// - Contains direct purchase price entries for tokens. /// - Expected to hold a relatively flat key-value structure with binary-encoded price schedules. /// - Tree type: Normal. - /// - Estimated to contain 8 items, each with hash-sized keys and no child trees. + /// - Estimated to contain values of 8 bytes (u64), each with hash-sized keys and no flags. /// - Estimated depth: 10 levels. /// /// This setup provides a balanced estimation model for token price operations, diff --git a/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs b/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs index 355b54e6e29..27264b370da 100644 --- a/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs +++ b/packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs @@ -513,7 +513,7 @@ impl Drive { )? else { return Err(Error::Proof(ProofError::IncorrectProof( - format!("proof did not contain token balance for identity {} expected to exist because of state transition (token burn)", owner_id)))); + format!("proof did not contain token balance for identity {} expected to exist because of state transition (token direct purchase)", owner_id)))); }; Ok((root_hash, VerifiedTokenBalance(owner_id, balance))) } From b922251e4daaf6f7232a21623b3a413f76d31419 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Apr 2025 09:32:35 +0700 Subject: [PATCH 15/32] fix --- .../rs-drive-abci/src/query/proofs/v0/mod.rs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs index 742ff45c6ad..f52dc73e998 100644 --- a/packages/rs-drive-abci/src/query/proofs/v0/mod.rs +++ b/packages/rs-drive-abci/src/query/proofs/v0/mod.rs @@ -258,6 +258,31 @@ impl Platform { ) } } + TokenTransition::DirectPurchase(_) => { + if keeps_historical_document.keeps_direct_purchase_history() { + create_token_historical_document_query( + token_transition, + owner_id, + platform_version, + )? + } else { + Drive::token_balance_for_identity_id_query( + token_id.to_buffer(), + owner_id.to_buffer(), + ) + } + } + TokenTransition::SetPriceForDirectPurchase(_) => { + if keeps_historical_document.keeps_direct_pricing_history() { + create_token_historical_document_query( + token_transition, + owner_id, + platform_version, + )? + } else { + Drive::token_direct_purchase_price_query(token_id.to_buffer()) + } + } TokenTransition::DestroyFrozenFunds(_) | TokenTransition::EmergencyAction(_) | TokenTransition::ConfigUpdate(_) From e97875d2a497f6b09aed536f5a7ed0cefe4963fb Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Apr 2025 09:46:31 +0700 Subject: [PATCH 16/32] fix --- .../document/batch_transition/methods/v1/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs index edcc22d24df..79646f75e62 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/batch_transition/methods/v1/mod.rs @@ -4,6 +4,7 @@ use crate::balances::credits::TokenAmount; use crate::data_contract::associated_token::token_configuration_item::TokenConfigurationChangeItem; #[cfg(feature = "state-transition-signing")] use crate::data_contract::associated_token::token_distribution_key::TokenDistributionType; +#[cfg(feature = "state-transition-signing")] use crate::fee::Credits; #[cfg(feature = "state-transition-signing")] use crate::group::GroupStateTransitionInfoStatus; From 1d059594e41119af06ed3d2f624e6137facacb82 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Thu, 10 Apr 2025 08:53:08 +0200 Subject: [PATCH 17/32] feat(drive-abci): grpc to fetch tokens direct purchase price, not tested --- .../clients/core/v0/nodejs/core_pbjs.js | 7111 -- .../clients/drive/v0/nodejs/drive_pbjs.js | 71306 ---------------- .../platform/v0/nodejs/platform_pbjs.js | 70798 --------------- .../platform/v0/nodejs/platform_protoc.js | 1159 +- .../platform/v0/objective-c/Platform.pbobjc.h | 145 +- .../platform/v0/objective-c/Platform.pbobjc.m | 279 +- .../platform/v0/python/platform_pb2.py | 551 +- .../clients/platform/v0/web/platform_pb.d.ts | 164 +- .../clients/platform/v0/web/platform_pb.js | 1159 +- .../protos/platform/v0/platform.proto | 844 +- packages/rs-drive-abci/src/query/service.rs | 9 +- .../src/query/token_queries/mod.rs | 1 + .../token_direct_purchase_prices/mod.rs | 66 + .../token_direct_purchase_prices/v0/mod.rs | 102 + .../fetch_tokens_direct_purchase_price/mod.rs | 44 + .../v0/mod.rs | 64 + .../src/drive/tokens/direct_purchase/mod.rs | 2 + .../prove_tokens_direct_purchase_price/mod.rs | 42 + .../v0/mod.rs | 23 + .../drive_abci_query_versions/mod.rs | 1 + .../drive_abci_query_versions/v1.rs | 5 + .../src/version/mocks/v2_test.rs | 5 + 22 files changed, 2253 insertions(+), 151627 deletions(-) create mode 100644 packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/mod.rs create mode 100644 packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/v0/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/v0/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/mod.rs create mode 100644 packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/v0/mod.rs diff --git a/packages/dapi-grpc/clients/core/v0/nodejs/core_pbjs.js b/packages/dapi-grpc/clients/core/v0/nodejs/core_pbjs.js index 20266d4be7c..9e69e8f9579 100644 --- a/packages/dapi-grpc/clients/core/v0/nodejs/core_pbjs.js +++ b/packages/dapi-grpc/clients/core/v0/nodejs/core_pbjs.js @@ -9,7115 +9,4 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut // Exported root namespace var $root = $protobuf.roots.core_root || ($protobuf.roots.core_root = {}); -$root.org = (function() { - - /** - * Namespace org. - * @exports org - * @namespace - */ - var org = {}; - - org.dash = (function() { - - /** - * Namespace dash. - * @memberof org - * @namespace - */ - var dash = {}; - - dash.platform = (function() { - - /** - * Namespace platform. - * @memberof org.dash - * @namespace - */ - var platform = {}; - - platform.dapi = (function() { - - /** - * Namespace dapi. - * @memberof org.dash.platform - * @namespace - */ - var dapi = {}; - - dapi.v0 = (function() { - - /** - * Namespace v0. - * @memberof org.dash.platform.dapi - * @namespace - */ - var v0 = {}; - - v0.Core = (function() { - - /** - * Constructs a new Core service. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a Core - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Core(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Core.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Core; - - /** - * Creates new Core service using the specified rpc implementation. - * @function create - * @memberof org.dash.platform.dapi.v0.Core - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Core} RPC service. Useful where requests and/or responses are streamed. - */ - Core.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#getBlockchainStatus}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef getBlockchainStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} [response] GetBlockchainStatusResponse - */ - - /** - * Calls getBlockchainStatus. - * @function getBlockchainStatus - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest} request GetBlockchainStatusRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.getBlockchainStatusCallback} callback Node-style callback called with the error, if any, and GetBlockchainStatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.getBlockchainStatus = function getBlockchainStatus(request, callback) { - return this.rpcCall(getBlockchainStatus, $root.org.dash.platform.dapi.v0.GetBlockchainStatusRequest, $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse, request, callback); - }, "name", { value: "getBlockchainStatus" }); - - /** - * Calls getBlockchainStatus. - * @function getBlockchainStatus - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest} request GetBlockchainStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#getMasternodeStatus}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef getMasternodeStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} [response] GetMasternodeStatusResponse - */ - - /** - * Calls getMasternodeStatus. - * @function getMasternodeStatus - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest} request GetMasternodeStatusRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.getMasternodeStatusCallback} callback Node-style callback called with the error, if any, and GetMasternodeStatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.getMasternodeStatus = function getMasternodeStatus(request, callback) { - return this.rpcCall(getMasternodeStatus, $root.org.dash.platform.dapi.v0.GetMasternodeStatusRequest, $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse, request, callback); - }, "name", { value: "getMasternodeStatus" }); - - /** - * Calls getMasternodeStatus. - * @function getMasternodeStatus - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest} request GetMasternodeStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#getBlock}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef getBlockCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetBlockResponse} [response] GetBlockResponse - */ - - /** - * Calls getBlock. - * @function getBlock - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetBlockRequest} request GetBlockRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.getBlockCallback} callback Node-style callback called with the error, if any, and GetBlockResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.getBlock = function getBlock(request, callback) { - return this.rpcCall(getBlock, $root.org.dash.platform.dapi.v0.GetBlockRequest, $root.org.dash.platform.dapi.v0.GetBlockResponse, request, callback); - }, "name", { value: "getBlock" }); - - /** - * Calls getBlock. - * @function getBlock - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetBlockRequest} request GetBlockRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#getBestBlockHeight}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef getBestBlockHeightCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} [response] GetBestBlockHeightResponse - */ - - /** - * Calls getBestBlockHeight. - * @function getBestBlockHeight - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest} request GetBestBlockHeightRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.getBestBlockHeightCallback} callback Node-style callback called with the error, if any, and GetBestBlockHeightResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.getBestBlockHeight = function getBestBlockHeight(request, callback) { - return this.rpcCall(getBestBlockHeight, $root.org.dash.platform.dapi.v0.GetBestBlockHeightRequest, $root.org.dash.platform.dapi.v0.GetBestBlockHeightResponse, request, callback); - }, "name", { value: "getBestBlockHeight" }); - - /** - * Calls getBestBlockHeight. - * @function getBestBlockHeight - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest} request GetBestBlockHeightRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#broadcastTransaction}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef broadcastTransactionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.BroadcastTransactionResponse} [response] BroadcastTransactionResponse - */ - - /** - * Calls broadcastTransaction. - * @function broadcastTransaction - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest} request BroadcastTransactionRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.broadcastTransactionCallback} callback Node-style callback called with the error, if any, and BroadcastTransactionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.broadcastTransaction = function broadcastTransaction(request, callback) { - return this.rpcCall(broadcastTransaction, $root.org.dash.platform.dapi.v0.BroadcastTransactionRequest, $root.org.dash.platform.dapi.v0.BroadcastTransactionResponse, request, callback); - }, "name", { value: "broadcastTransaction" }); - - /** - * Calls broadcastTransaction. - * @function broadcastTransaction - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest} request BroadcastTransactionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#getTransaction}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef getTransactionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTransactionResponse} [response] GetTransactionResponse - */ - - /** - * Calls getTransaction. - * @function getTransaction - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetTransactionRequest} request GetTransactionRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.getTransactionCallback} callback Node-style callback called with the error, if any, and GetTransactionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.getTransaction = function getTransaction(request, callback) { - return this.rpcCall(getTransaction, $root.org.dash.platform.dapi.v0.GetTransactionRequest, $root.org.dash.platform.dapi.v0.GetTransactionResponse, request, callback); - }, "name", { value: "getTransaction" }); - - /** - * Calls getTransaction. - * @function getTransaction - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetTransactionRequest} request GetTransactionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#getEstimatedTransactionFee}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef getEstimatedTransactionFeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} [response] GetEstimatedTransactionFeeResponse - */ - - /** - * Calls getEstimatedTransactionFee. - * @function getEstimatedTransactionFee - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest} request GetEstimatedTransactionFeeRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.getEstimatedTransactionFeeCallback} callback Node-style callback called with the error, if any, and GetEstimatedTransactionFeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.getEstimatedTransactionFee = function getEstimatedTransactionFee(request, callback) { - return this.rpcCall(getEstimatedTransactionFee, $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest, $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse, request, callback); - }, "name", { value: "getEstimatedTransactionFee" }); - - /** - * Calls getEstimatedTransactionFee. - * @function getEstimatedTransactionFee - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest} request GetEstimatedTransactionFeeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#subscribeToBlockHeadersWithChainLocks}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef subscribeToBlockHeadersWithChainLocksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} [response] BlockHeadersWithChainLocksResponse - */ - - /** - * Calls subscribeToBlockHeadersWithChainLocks. - * @function subscribeToBlockHeadersWithChainLocks - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest} request BlockHeadersWithChainLocksRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.subscribeToBlockHeadersWithChainLocksCallback} callback Node-style callback called with the error, if any, and BlockHeadersWithChainLocksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.subscribeToBlockHeadersWithChainLocks = function subscribeToBlockHeadersWithChainLocks(request, callback) { - return this.rpcCall(subscribeToBlockHeadersWithChainLocks, $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest, $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse, request, callback); - }, "name", { value: "subscribeToBlockHeadersWithChainLocks" }); - - /** - * Calls subscribeToBlockHeadersWithChainLocks. - * @function subscribeToBlockHeadersWithChainLocks - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest} request BlockHeadersWithChainLocksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#subscribeToTransactionsWithProofs}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef subscribeToTransactionsWithProofsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} [response] TransactionsWithProofsResponse - */ - - /** - * Calls subscribeToTransactionsWithProofs. - * @function subscribeToTransactionsWithProofs - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest} request TransactionsWithProofsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.subscribeToTransactionsWithProofsCallback} callback Node-style callback called with the error, if any, and TransactionsWithProofsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.subscribeToTransactionsWithProofs = function subscribeToTransactionsWithProofs(request, callback) { - return this.rpcCall(subscribeToTransactionsWithProofs, $root.org.dash.platform.dapi.v0.TransactionsWithProofsRequest, $root.org.dash.platform.dapi.v0.TransactionsWithProofsResponse, request, callback); - }, "name", { value: "subscribeToTransactionsWithProofs" }); - - /** - * Calls subscribeToTransactionsWithProofs. - * @function subscribeToTransactionsWithProofs - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest} request TransactionsWithProofsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Core#subscribeToMasternodeList}. - * @memberof org.dash.platform.dapi.v0.Core - * @typedef subscribeToMasternodeListCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.MasternodeListResponse} [response] MasternodeListResponse - */ - - /** - * Calls subscribeToMasternodeList. - * @function subscribeToMasternodeList - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IMasternodeListRequest} request MasternodeListRequest message or plain object - * @param {org.dash.platform.dapi.v0.Core.subscribeToMasternodeListCallback} callback Node-style callback called with the error, if any, and MasternodeListResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Core.prototype.subscribeToMasternodeList = function subscribeToMasternodeList(request, callback) { - return this.rpcCall(subscribeToMasternodeList, $root.org.dash.platform.dapi.v0.MasternodeListRequest, $root.org.dash.platform.dapi.v0.MasternodeListResponse, request, callback); - }, "name", { value: "subscribeToMasternodeList" }); - - /** - * Calls subscribeToMasternodeList. - * @function subscribeToMasternodeList - * @memberof org.dash.platform.dapi.v0.Core - * @instance - * @param {org.dash.platform.dapi.v0.IMasternodeListRequest} request MasternodeListRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Core; - })(); - - v0.GetBlockchainStatusRequest = (function() { - - /** - * Properties of a GetBlockchainStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetBlockchainStatusRequest - */ - - /** - * Constructs a new GetBlockchainStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetBlockchainStatusRequest. - * @implements IGetBlockchainStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest=} [properties] Properties to set - */ - function GetBlockchainStatusRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new GetBlockchainStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} GetBlockchainStatusRequest instance - */ - GetBlockchainStatusRequest.create = function create(properties) { - return new GetBlockchainStatusRequest(properties); - }; - - /** - * Encodes the specified GetBlockchainStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest} message GetBlockchainStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBlockchainStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GetBlockchainStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest} message GetBlockchainStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBlockchainStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBlockchainStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} GetBlockchainStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBlockchainStatusRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBlockchainStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} GetBlockchainStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBlockchainStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBlockchainStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBlockchainStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GetBlockchainStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} GetBlockchainStatusRequest - */ - GetBlockchainStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusRequest) - return object; - return new $root.org.dash.platform.dapi.v0.GetBlockchainStatusRequest(); - }; - - /** - * Creates a plain object from a GetBlockchainStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} message GetBlockchainStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBlockchainStatusRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GetBlockchainStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest - * @instance - * @returns {Object.} JSON object - */ - GetBlockchainStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetBlockchainStatusRequest; - })(); - - v0.GetBlockchainStatusResponse = (function() { - - /** - * Properties of a GetBlockchainStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetBlockchainStatusResponse - * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion|null} [version] GetBlockchainStatusResponse version - * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime|null} [time] GetBlockchainStatusResponse time - * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Status|null} [status] GetBlockchainStatusResponse status - * @property {number|null} [syncProgress] GetBlockchainStatusResponse syncProgress - * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain|null} [chain] GetBlockchainStatusResponse chain - * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork|null} [network] GetBlockchainStatusResponse network - */ - - /** - * Constructs a new GetBlockchainStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetBlockchainStatusResponse. - * @implements IGetBlockchainStatusResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusResponse=} [properties] Properties to set - */ - function GetBlockchainStatusResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBlockchainStatusResponse version. - * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion|null|undefined} version - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @instance - */ - GetBlockchainStatusResponse.prototype.version = null; - - /** - * GetBlockchainStatusResponse time. - * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime|null|undefined} time - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @instance - */ - GetBlockchainStatusResponse.prototype.time = null; - - /** - * GetBlockchainStatusResponse status. - * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Status} status - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @instance - */ - GetBlockchainStatusResponse.prototype.status = 0; - - /** - * GetBlockchainStatusResponse syncProgress. - * @member {number} syncProgress - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @instance - */ - GetBlockchainStatusResponse.prototype.syncProgress = 0; - - /** - * GetBlockchainStatusResponse chain. - * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain|null|undefined} chain - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @instance - */ - GetBlockchainStatusResponse.prototype.chain = null; - - /** - * GetBlockchainStatusResponse network. - * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork|null|undefined} network - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @instance - */ - GetBlockchainStatusResponse.prototype.network = null; - - /** - * Creates a new GetBlockchainStatusResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} GetBlockchainStatusResponse instance - */ - GetBlockchainStatusResponse.create = function create(properties) { - return new GetBlockchainStatusResponse(properties); - }; - - /** - * Encodes the specified GetBlockchainStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusResponse} message GetBlockchainStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBlockchainStatusResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.syncProgress != null && Object.hasOwnProperty.call(message, "syncProgress")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.syncProgress); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.encode(message.chain, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetBlockchainStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusResponse} message GetBlockchainStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBlockchainStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBlockchainStatusResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} GetBlockchainStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBlockchainStatusResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.decode(reader, reader.uint32()); - break; - case 2: - message.time = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.decode(reader, reader.uint32()); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.syncProgress = reader.double(); - break; - case 5: - message.chain = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.decode(reader, reader.uint32()); - break; - case 7: - message.network = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBlockchainStatusResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} GetBlockchainStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBlockchainStatusResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBlockchainStatusResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBlockchainStatusResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.verify(message.version); - if (error) - return "version." + error; - } - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.verify(message.time); - if (error) - return "time." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) - if (typeof message.syncProgress !== "number") - return "syncProgress: number expected"; - if (message.chain != null && message.hasOwnProperty("chain")) { - var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.verify(message.chain); - if (error) - return "chain." + error; - } - if (message.network != null && message.hasOwnProperty("network")) { - var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.verify(message.network); - if (error) - return "network." + error; - } - return null; - }; - - /** - * Creates a GetBlockchainStatusResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} GetBlockchainStatusResponse - */ - GetBlockchainStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.version: object expected"); - message.version = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.fromObject(object.version); - } - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.time: object expected"); - message.time = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.fromObject(object.time); - } - switch (object.status) { - case "NOT_STARTED": - case 0: - message.status = 0; - break; - case "SYNCING": - case 1: - message.status = 1; - break; - case "READY": - case 2: - message.status = 2; - break; - case "ERROR": - case 3: - message.status = 3; - break; - } - if (object.syncProgress != null) - message.syncProgress = Number(object.syncProgress); - if (object.chain != null) { - if (typeof object.chain !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.chain: object expected"); - message.chain = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.fromObject(object.chain); - } - if (object.network != null) { - if (typeof object.network !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.network: object expected"); - message.network = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.fromObject(object.network); - } - return message; - }; - - /** - * Creates a plain object from a GetBlockchainStatusResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} message GetBlockchainStatusResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBlockchainStatusResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = null; - object.time = null; - object.status = options.enums === String ? "NOT_STARTED" : 0; - object.syncProgress = 0; - object.chain = null; - object.network = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.toObject(message.version, options); - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.toObject(message.time, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Status[message.status] : message.status; - if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) - object.syncProgress = options.json && !isFinite(message.syncProgress) ? String(message.syncProgress) : message.syncProgress; - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.toObject(message.chain, options); - if (message.network != null && message.hasOwnProperty("network")) - object.network = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.toObject(message.network, options); - return object; - }; - - /** - * Converts this GetBlockchainStatusResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @instance - * @returns {Object.} JSON object - */ - GetBlockchainStatusResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetBlockchainStatusResponse.Version = (function() { - - /** - * Properties of a Version. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @interface IVersion - * @property {number|null} [protocol] Version protocol - * @property {number|null} [software] Version software - * @property {string|null} [agent] Version agent - */ - - /** - * Constructs a new Version. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @classdesc Represents a Version. - * @implements IVersion - * @constructor - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion=} [properties] Properties to set - */ - function Version(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Version protocol. - * @member {number} protocol - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @instance - */ - Version.prototype.protocol = 0; - - /** - * Version software. - * @member {number} software - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @instance - */ - Version.prototype.software = 0; - - /** - * Version agent. - * @member {string} agent - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @instance - */ - Version.prototype.agent = ""; - - /** - * Creates a new Version instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} Version instance - */ - Version.create = function create(properties) { - return new Version(properties); - }; - - /** - * Encodes the specified Version message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.protocol); - if (message.software != null && Object.hasOwnProperty.call(message, "software")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.software); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.agent); - return writer; - }; - - /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Version message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protocol = reader.uint32(); - break; - case 2: - message.software = reader.uint32(); - break; - case 3: - message.agent = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Version message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Version message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Version.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.protocol != null && message.hasOwnProperty("protocol")) - if (!$util.isInteger(message.protocol)) - return "protocol: integer expected"; - if (message.software != null && message.hasOwnProperty("software")) - if (!$util.isInteger(message.software)) - return "software: integer expected"; - if (message.agent != null && message.hasOwnProperty("agent")) - if (!$util.isString(message.agent)) - return "agent: string expected"; - return null; - }; - - /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} Version - */ - Version.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version(); - if (object.protocol != null) - message.protocol = object.protocol >>> 0; - if (object.software != null) - message.software = object.software >>> 0; - if (object.agent != null) - message.agent = String(object.agent); - return message; - }; - - /** - * Creates a plain object from a Version message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} message Version - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Version.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.protocol = 0; - object.software = 0; - object.agent = ""; - } - if (message.protocol != null && message.hasOwnProperty("protocol")) - object.protocol = message.protocol; - if (message.software != null && message.hasOwnProperty("software")) - object.software = message.software; - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = message.agent; - return object; - }; - - /** - * Converts this Version to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version - * @instance - * @returns {Object.} JSON object - */ - Version.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Version; - })(); - - GetBlockchainStatusResponse.Time = (function() { - - /** - * Properties of a Time. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @interface ITime - * @property {number|null} [now] Time now - * @property {number|null} [offset] Time offset - * @property {number|null} [median] Time median - */ - - /** - * Constructs a new Time. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @classdesc Represents a Time. - * @implements ITime - * @constructor - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime=} [properties] Properties to set - */ - function Time(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Time now. - * @member {number} now - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @instance - */ - Time.prototype.now = 0; - - /** - * Time offset. - * @member {number} offset - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @instance - */ - Time.prototype.offset = 0; - - /** - * Time median. - * @member {number} median - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @instance - */ - Time.prototype.median = 0; - - /** - * Creates a new Time instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} Time instance - */ - Time.create = function create(properties) { - return new Time(properties); - }; - - /** - * Encodes the specified Time message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime} message Time message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Time.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.now != null && Object.hasOwnProperty.call(message, "now")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.now); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.offset); - if (message.median != null && Object.hasOwnProperty.call(message, "median")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.median); - return writer; - }; - - /** - * Encodes the specified Time message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime} message Time message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Time.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Time message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} Time - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Time.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.now = reader.uint32(); - break; - case 2: - message.offset = reader.int32(); - break; - case 3: - message.median = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Time message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} Time - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Time.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Time message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Time.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.now != null && message.hasOwnProperty("now")) - if (!$util.isInteger(message.now)) - return "now: integer expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.median != null && message.hasOwnProperty("median")) - if (!$util.isInteger(message.median)) - return "median: integer expected"; - return null; - }; - - /** - * Creates a Time message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} Time - */ - Time.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time(); - if (object.now != null) - message.now = object.now >>> 0; - if (object.offset != null) - message.offset = object.offset | 0; - if (object.median != null) - message.median = object.median >>> 0; - return message; - }; - - /** - * Creates a plain object from a Time message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} message Time - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Time.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.now = 0; - object.offset = 0; - object.median = 0; - } - if (message.now != null && message.hasOwnProperty("now")) - object.now = message.now; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.median != null && message.hasOwnProperty("median")) - object.median = message.median; - return object; - }; - - /** - * Converts this Time to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time - * @instance - * @returns {Object.} JSON object - */ - Time.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Time; - })(); - - /** - * Status enum. - * @name org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Status - * @enum {number} - * @property {number} NOT_STARTED=0 NOT_STARTED value - * @property {number} SYNCING=1 SYNCING value - * @property {number} READY=2 READY value - * @property {number} ERROR=3 ERROR value - */ - GetBlockchainStatusResponse.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NOT_STARTED"] = 0; - values[valuesById[1] = "SYNCING"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "ERROR"] = 3; - return values; - })(); - - GetBlockchainStatusResponse.Chain = (function() { - - /** - * Properties of a Chain. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @interface IChain - * @property {string|null} [name] Chain name - * @property {number|null} [headersCount] Chain headersCount - * @property {number|null} [blocksCount] Chain blocksCount - * @property {Uint8Array|null} [bestBlockHash] Chain bestBlockHash - * @property {number|null} [difficulty] Chain difficulty - * @property {Uint8Array|null} [chainWork] Chain chainWork - * @property {boolean|null} [isSynced] Chain isSynced - * @property {number|null} [syncProgress] Chain syncProgress - */ - - /** - * Constructs a new Chain. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @classdesc Represents a Chain. - * @implements IChain - * @constructor - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain=} [properties] Properties to set - */ - function Chain(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Chain name. - * @member {string} name - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - */ - Chain.prototype.name = ""; - - /** - * Chain headersCount. - * @member {number} headersCount - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - */ - Chain.prototype.headersCount = 0; - - /** - * Chain blocksCount. - * @member {number} blocksCount - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - */ - Chain.prototype.blocksCount = 0; - - /** - * Chain bestBlockHash. - * @member {Uint8Array} bestBlockHash - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - */ - Chain.prototype.bestBlockHash = $util.newBuffer([]); - - /** - * Chain difficulty. - * @member {number} difficulty - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - */ - Chain.prototype.difficulty = 0; - - /** - * Chain chainWork. - * @member {Uint8Array} chainWork - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - */ - Chain.prototype.chainWork = $util.newBuffer([]); - - /** - * Chain isSynced. - * @member {boolean} isSynced - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - */ - Chain.prototype.isSynced = false; - - /** - * Chain syncProgress. - * @member {number} syncProgress - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - */ - Chain.prototype.syncProgress = 0; - - /** - * Creates a new Chain instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} Chain instance - */ - Chain.create = function create(properties) { - return new Chain(properties); - }; - - /** - * Encodes the specified Chain message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain} message Chain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.headersCount != null && Object.hasOwnProperty.call(message, "headersCount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.headersCount); - if (message.blocksCount != null && Object.hasOwnProperty.call(message, "blocksCount")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.blocksCount); - if (message.bestBlockHash != null && Object.hasOwnProperty.call(message, "bestBlockHash")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.bestBlockHash); - if (message.difficulty != null && Object.hasOwnProperty.call(message, "difficulty")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.difficulty); - if (message.chainWork != null && Object.hasOwnProperty.call(message, "chainWork")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.chainWork); - if (message.isSynced != null && Object.hasOwnProperty.call(message, "isSynced")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isSynced); - if (message.syncProgress != null && Object.hasOwnProperty.call(message, "syncProgress")) - writer.uint32(/* id 8, wireType 1 =*/65).double(message.syncProgress); - return writer; - }; - - /** - * Encodes the specified Chain message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain} message Chain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chain message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chain.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.headersCount = reader.uint32(); - break; - case 3: - message.blocksCount = reader.uint32(); - break; - case 4: - message.bestBlockHash = reader.bytes(); - break; - case 5: - message.difficulty = reader.double(); - break; - case 6: - message.chainWork = reader.bytes(); - break; - case 7: - message.isSynced = reader.bool(); - break; - case 8: - message.syncProgress = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chain message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.headersCount != null && message.hasOwnProperty("headersCount")) - if (!$util.isInteger(message.headersCount)) - return "headersCount: integer expected"; - if (message.blocksCount != null && message.hasOwnProperty("blocksCount")) - if (!$util.isInteger(message.blocksCount)) - return "blocksCount: integer expected"; - if (message.bestBlockHash != null && message.hasOwnProperty("bestBlockHash")) - if (!(message.bestBlockHash && typeof message.bestBlockHash.length === "number" || $util.isString(message.bestBlockHash))) - return "bestBlockHash: buffer expected"; - if (message.difficulty != null && message.hasOwnProperty("difficulty")) - if (typeof message.difficulty !== "number") - return "difficulty: number expected"; - if (message.chainWork != null && message.hasOwnProperty("chainWork")) - if (!(message.chainWork && typeof message.chainWork.length === "number" || $util.isString(message.chainWork))) - return "chainWork: buffer expected"; - if (message.isSynced != null && message.hasOwnProperty("isSynced")) - if (typeof message.isSynced !== "boolean") - return "isSynced: boolean expected"; - if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) - if (typeof message.syncProgress !== "number") - return "syncProgress: number expected"; - return null; - }; - - /** - * Creates a Chain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} Chain - */ - Chain.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain(); - if (object.name != null) - message.name = String(object.name); - if (object.headersCount != null) - message.headersCount = object.headersCount >>> 0; - if (object.blocksCount != null) - message.blocksCount = object.blocksCount >>> 0; - if (object.bestBlockHash != null) - if (typeof object.bestBlockHash === "string") - $util.base64.decode(object.bestBlockHash, message.bestBlockHash = $util.newBuffer($util.base64.length(object.bestBlockHash)), 0); - else if (object.bestBlockHash.length >= 0) - message.bestBlockHash = object.bestBlockHash; - if (object.difficulty != null) - message.difficulty = Number(object.difficulty); - if (object.chainWork != null) - if (typeof object.chainWork === "string") - $util.base64.decode(object.chainWork, message.chainWork = $util.newBuffer($util.base64.length(object.chainWork)), 0); - else if (object.chainWork.length >= 0) - message.chainWork = object.chainWork; - if (object.isSynced != null) - message.isSynced = Boolean(object.isSynced); - if (object.syncProgress != null) - message.syncProgress = Number(object.syncProgress); - return message; - }; - - /** - * Creates a plain object from a Chain message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} message Chain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.headersCount = 0; - object.blocksCount = 0; - if (options.bytes === String) - object.bestBlockHash = ""; - else { - object.bestBlockHash = []; - if (options.bytes !== Array) - object.bestBlockHash = $util.newBuffer(object.bestBlockHash); - } - object.difficulty = 0; - if (options.bytes === String) - object.chainWork = ""; - else { - object.chainWork = []; - if (options.bytes !== Array) - object.chainWork = $util.newBuffer(object.chainWork); - } - object.isSynced = false; - object.syncProgress = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.headersCount != null && message.hasOwnProperty("headersCount")) - object.headersCount = message.headersCount; - if (message.blocksCount != null && message.hasOwnProperty("blocksCount")) - object.blocksCount = message.blocksCount; - if (message.bestBlockHash != null && message.hasOwnProperty("bestBlockHash")) - object.bestBlockHash = options.bytes === String ? $util.base64.encode(message.bestBlockHash, 0, message.bestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.bestBlockHash) : message.bestBlockHash; - if (message.difficulty != null && message.hasOwnProperty("difficulty")) - object.difficulty = options.json && !isFinite(message.difficulty) ? String(message.difficulty) : message.difficulty; - if (message.chainWork != null && message.hasOwnProperty("chainWork")) - object.chainWork = options.bytes === String ? $util.base64.encode(message.chainWork, 0, message.chainWork.length) : options.bytes === Array ? Array.prototype.slice.call(message.chainWork) : message.chainWork; - if (message.isSynced != null && message.hasOwnProperty("isSynced")) - object.isSynced = message.isSynced; - if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) - object.syncProgress = options.json && !isFinite(message.syncProgress) ? String(message.syncProgress) : message.syncProgress; - return object; - }; - - /** - * Converts this Chain to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain - * @instance - * @returns {Object.} JSON object - */ - Chain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Chain; - })(); - - GetBlockchainStatusResponse.NetworkFee = (function() { - - /** - * Properties of a NetworkFee. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @interface INetworkFee - * @property {number|null} [relay] NetworkFee relay - * @property {number|null} [incremental] NetworkFee incremental - */ - - /** - * Constructs a new NetworkFee. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @classdesc Represents a NetworkFee. - * @implements INetworkFee - * @constructor - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee=} [properties] Properties to set - */ - function NetworkFee(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkFee relay. - * @member {number} relay - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @instance - */ - NetworkFee.prototype.relay = 0; - - /** - * NetworkFee incremental. - * @member {number} incremental - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @instance - */ - NetworkFee.prototype.incremental = 0; - - /** - * Creates a new NetworkFee instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} NetworkFee instance - */ - NetworkFee.create = function create(properties) { - return new NetworkFee(properties); - }; - - /** - * Encodes the specified NetworkFee message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee} message NetworkFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.relay != null && Object.hasOwnProperty.call(message, "relay")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.relay); - if (message.incremental != null && Object.hasOwnProperty.call(message, "incremental")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.incremental); - return writer; - }; - - /** - * Encodes the specified NetworkFee message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee} message NetworkFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkFee message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} NetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkFee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.relay = reader.double(); - break; - case 2: - message.incremental = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} NetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkFee message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.relay != null && message.hasOwnProperty("relay")) - if (typeof message.relay !== "number") - return "relay: number expected"; - if (message.incremental != null && message.hasOwnProperty("incremental")) - if (typeof message.incremental !== "number") - return "incremental: number expected"; - return null; - }; - - /** - * Creates a NetworkFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} NetworkFee - */ - NetworkFee.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee(); - if (object.relay != null) - message.relay = Number(object.relay); - if (object.incremental != null) - message.incremental = Number(object.incremental); - return message; - }; - - /** - * Creates a plain object from a NetworkFee message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} message NetworkFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.relay = 0; - object.incremental = 0; - } - if (message.relay != null && message.hasOwnProperty("relay")) - object.relay = options.json && !isFinite(message.relay) ? String(message.relay) : message.relay; - if (message.incremental != null && message.hasOwnProperty("incremental")) - object.incremental = options.json && !isFinite(message.incremental) ? String(message.incremental) : message.incremental; - return object; - }; - - /** - * Converts this NetworkFee to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee - * @instance - * @returns {Object.} JSON object - */ - NetworkFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NetworkFee; - })(); - - GetBlockchainStatusResponse.Network = (function() { - - /** - * Properties of a Network. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @interface INetwork - * @property {number|null} [peersCount] Network peersCount - * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee|null} [fee] Network fee - */ - - /** - * Constructs a new Network. - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse - * @classdesc Represents a Network. - * @implements INetwork - * @constructor - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork=} [properties] Properties to set - */ - function Network(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Network peersCount. - * @member {number} peersCount - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @instance - */ - Network.prototype.peersCount = 0; - - /** - * Network fee. - * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee|null|undefined} fee - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @instance - */ - Network.prototype.fee = null; - - /** - * Creates a new Network instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} Network instance - */ - Network.create = function create(properties) { - return new Network(properties); - }; - - /** - * Encodes the specified Network message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork} message Network message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Network.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.peersCount != null && Object.hasOwnProperty.call(message, "peersCount")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.peersCount); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.encode(message.fee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Network message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork} message Network message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Network.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Network message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Network.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.peersCount = reader.uint32(); - break; - case 2: - message.fee = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Network message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Network.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Network message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Network.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.peersCount != null && message.hasOwnProperty("peersCount")) - if (!$util.isInteger(message.peersCount)) - return "peersCount: integer expected"; - if (message.fee != null && message.hasOwnProperty("fee")) { - var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.verify(message.fee); - if (error) - return "fee." + error; - } - return null; - }; - - /** - * Creates a Network message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} Network - */ - Network.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network(); - if (object.peersCount != null) - message.peersCount = object.peersCount >>> 0; - if (object.fee != null) { - if (typeof object.fee !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.fee: object expected"); - message.fee = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.fromObject(object.fee); - } - return message; - }; - - /** - * Creates a plain object from a Network message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @static - * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} message Network - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Network.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.peersCount = 0; - object.fee = null; - } - if (message.peersCount != null && message.hasOwnProperty("peersCount")) - object.peersCount = message.peersCount; - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.toObject(message.fee, options); - return object; - }; - - /** - * Converts this Network to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network - * @instance - * @returns {Object.} JSON object - */ - Network.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Network; - })(); - - return GetBlockchainStatusResponse; - })(); - - v0.GetMasternodeStatusRequest = (function() { - - /** - * Properties of a GetMasternodeStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetMasternodeStatusRequest - */ - - /** - * Constructs a new GetMasternodeStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetMasternodeStatusRequest. - * @implements IGetMasternodeStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest=} [properties] Properties to set - */ - function GetMasternodeStatusRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new GetMasternodeStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} GetMasternodeStatusRequest instance - */ - GetMasternodeStatusRequest.create = function create(properties) { - return new GetMasternodeStatusRequest(properties); - }; - - /** - * Encodes the specified GetMasternodeStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetMasternodeStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest} message GetMasternodeStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetMasternodeStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GetMasternodeStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetMasternodeStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest} message GetMasternodeStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetMasternodeStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetMasternodeStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} GetMasternodeStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetMasternodeStatusRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetMasternodeStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetMasternodeStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} GetMasternodeStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetMasternodeStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetMasternodeStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetMasternodeStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GetMasternodeStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} GetMasternodeStatusRequest - */ - GetMasternodeStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetMasternodeStatusRequest) - return object; - return new $root.org.dash.platform.dapi.v0.GetMasternodeStatusRequest(); - }; - - /** - * Creates a plain object from a GetMasternodeStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} message GetMasternodeStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetMasternodeStatusRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GetMasternodeStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest - * @instance - * @returns {Object.} JSON object - */ - GetMasternodeStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetMasternodeStatusRequest; - })(); - - v0.GetMasternodeStatusResponse = (function() { - - /** - * Properties of a GetMasternodeStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetMasternodeStatusResponse - * @property {org.dash.platform.dapi.v0.GetMasternodeStatusResponse.Status|null} [status] GetMasternodeStatusResponse status - * @property {Uint8Array|null} [proTxHash] GetMasternodeStatusResponse proTxHash - * @property {number|null} [posePenalty] GetMasternodeStatusResponse posePenalty - * @property {boolean|null} [isSynced] GetMasternodeStatusResponse isSynced - * @property {number|null} [syncProgress] GetMasternodeStatusResponse syncProgress - */ - - /** - * Constructs a new GetMasternodeStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetMasternodeStatusResponse. - * @implements IGetMasternodeStatusResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusResponse=} [properties] Properties to set - */ - function GetMasternodeStatusResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetMasternodeStatusResponse status. - * @member {org.dash.platform.dapi.v0.GetMasternodeStatusResponse.Status} status - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @instance - */ - GetMasternodeStatusResponse.prototype.status = 0; - - /** - * GetMasternodeStatusResponse proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @instance - */ - GetMasternodeStatusResponse.prototype.proTxHash = $util.newBuffer([]); - - /** - * GetMasternodeStatusResponse posePenalty. - * @member {number} posePenalty - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @instance - */ - GetMasternodeStatusResponse.prototype.posePenalty = 0; - - /** - * GetMasternodeStatusResponse isSynced. - * @member {boolean} isSynced - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @instance - */ - GetMasternodeStatusResponse.prototype.isSynced = false; - - /** - * GetMasternodeStatusResponse syncProgress. - * @member {number} syncProgress - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @instance - */ - GetMasternodeStatusResponse.prototype.syncProgress = 0; - - /** - * Creates a new GetMasternodeStatusResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} GetMasternodeStatusResponse instance - */ - GetMasternodeStatusResponse.create = function create(properties) { - return new GetMasternodeStatusResponse(properties); - }; - - /** - * Encodes the specified GetMasternodeStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetMasternodeStatusResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusResponse} message GetMasternodeStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetMasternodeStatusResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proTxHash); - if (message.posePenalty != null && Object.hasOwnProperty.call(message, "posePenalty")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.posePenalty); - if (message.isSynced != null && Object.hasOwnProperty.call(message, "isSynced")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isSynced); - if (message.syncProgress != null && Object.hasOwnProperty.call(message, "syncProgress")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.syncProgress); - return writer; - }; - - /** - * Encodes the specified GetMasternodeStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetMasternodeStatusResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusResponse} message GetMasternodeStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetMasternodeStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetMasternodeStatusResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} GetMasternodeStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetMasternodeStatusResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.status = reader.int32(); - break; - case 2: - message.proTxHash = reader.bytes(); - break; - case 3: - message.posePenalty = reader.uint32(); - break; - case 4: - message.isSynced = reader.bool(); - break; - case 5: - message.syncProgress = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetMasternodeStatusResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} GetMasternodeStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetMasternodeStatusResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetMasternodeStatusResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetMasternodeStatusResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - if (message.posePenalty != null && message.hasOwnProperty("posePenalty")) - if (!$util.isInteger(message.posePenalty)) - return "posePenalty: integer expected"; - if (message.isSynced != null && message.hasOwnProperty("isSynced")) - if (typeof message.isSynced !== "boolean") - return "isSynced: boolean expected"; - if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) - if (typeof message.syncProgress !== "number") - return "syncProgress: number expected"; - return null; - }; - - /** - * Creates a GetMasternodeStatusResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} GetMasternodeStatusResponse - */ - GetMasternodeStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse(); - switch (object.status) { - case "UNKNOWN": - case 0: - message.status = 0; - break; - case "WAITING_FOR_PROTX": - case 1: - message.status = 1; - break; - case "POSE_BANNED": - case 2: - message.status = 2; - break; - case "REMOVED": - case 3: - message.status = 3; - break; - case "OPERATOR_KEY_CHANGED": - case 4: - message.status = 4; - break; - case "PROTX_IP_CHANGED": - case 5: - message.status = 5; - break; - case "READY": - case 6: - message.status = 6; - break; - case "ERROR": - case 7: - message.status = 7; - break; - } - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - if (object.posePenalty != null) - message.posePenalty = object.posePenalty >>> 0; - if (object.isSynced != null) - message.isSynced = Boolean(object.isSynced); - if (object.syncProgress != null) - message.syncProgress = Number(object.syncProgress); - return message; - }; - - /** - * Creates a plain object from a GetMasternodeStatusResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} message GetMasternodeStatusResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetMasternodeStatusResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.status = options.enums === String ? "UNKNOWN" : 0; - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - object.posePenalty = 0; - object.isSynced = false; - object.syncProgress = 0; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse.Status[message.status] : message.status; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - if (message.posePenalty != null && message.hasOwnProperty("posePenalty")) - object.posePenalty = message.posePenalty; - if (message.isSynced != null && message.hasOwnProperty("isSynced")) - object.isSynced = message.isSynced; - if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) - object.syncProgress = options.json && !isFinite(message.syncProgress) ? String(message.syncProgress) : message.syncProgress; - return object; - }; - - /** - * Converts this GetMasternodeStatusResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse - * @instance - * @returns {Object.} JSON object - */ - GetMasternodeStatusResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Status enum. - * @name org.dash.platform.dapi.v0.GetMasternodeStatusResponse.Status - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} WAITING_FOR_PROTX=1 WAITING_FOR_PROTX value - * @property {number} POSE_BANNED=2 POSE_BANNED value - * @property {number} REMOVED=3 REMOVED value - * @property {number} OPERATOR_KEY_CHANGED=4 OPERATOR_KEY_CHANGED value - * @property {number} PROTX_IP_CHANGED=5 PROTX_IP_CHANGED value - * @property {number} READY=6 READY value - * @property {number} ERROR=7 ERROR value - */ - GetMasternodeStatusResponse.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "WAITING_FOR_PROTX"] = 1; - values[valuesById[2] = "POSE_BANNED"] = 2; - values[valuesById[3] = "REMOVED"] = 3; - values[valuesById[4] = "OPERATOR_KEY_CHANGED"] = 4; - values[valuesById[5] = "PROTX_IP_CHANGED"] = 5; - values[valuesById[6] = "READY"] = 6; - values[valuesById[7] = "ERROR"] = 7; - return values; - })(); - - return GetMasternodeStatusResponse; - })(); - - v0.GetBlockRequest = (function() { - - /** - * Properties of a GetBlockRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetBlockRequest - * @property {number|null} [height] GetBlockRequest height - * @property {string|null} [hash] GetBlockRequest hash - */ - - /** - * Constructs a new GetBlockRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetBlockRequest. - * @implements IGetBlockRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetBlockRequest=} [properties] Properties to set - */ - function GetBlockRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBlockRequest height. - * @member {number} height - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @instance - */ - GetBlockRequest.prototype.height = 0; - - /** - * GetBlockRequest hash. - * @member {string} hash - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @instance - */ - GetBlockRequest.prototype.hash = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetBlockRequest block. - * @member {"height"|"hash"|undefined} block - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @instance - */ - Object.defineProperty(GetBlockRequest.prototype, "block", { - get: $util.oneOfGetter($oneOfFields = ["height", "hash"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetBlockRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockRequest} GetBlockRequest instance - */ - GetBlockRequest.create = function create(properties) { - return new GetBlockRequest(properties); - }; - - /** - * Encodes the specified GetBlockRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockRequest} message GetBlockRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBlockRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.height); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.hash); - return writer; - }; - - /** - * Encodes the specified GetBlockRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockRequest} message GetBlockRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBlockRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBlockRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockRequest} GetBlockRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBlockRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.uint32(); - break; - case 2: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBlockRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockRequest} GetBlockRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBlockRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBlockRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBlockRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.height != null && message.hasOwnProperty("height")) { - properties.block = 1; - if (!$util.isInteger(message.height)) - return "height: integer expected"; - } - if (message.hash != null && message.hasOwnProperty("hash")) { - if (properties.block === 1) - return "block: multiple values"; - properties.block = 1; - if (!$util.isString(message.hash)) - return "hash: string expected"; - } - return null; - }; - - /** - * Creates a GetBlockRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockRequest} GetBlockRequest - */ - GetBlockRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBlockRequest(); - if (object.height != null) - message.height = object.height >>> 0; - if (object.hash != null) - message.hash = String(object.hash); - return message; - }; - - /** - * Creates a plain object from a GetBlockRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @static - * @param {org.dash.platform.dapi.v0.GetBlockRequest} message GetBlockRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBlockRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.height != null && message.hasOwnProperty("height")) { - object.height = message.height; - if (options.oneofs) - object.block = "height"; - } - if (message.hash != null && message.hasOwnProperty("hash")) { - object.hash = message.hash; - if (options.oneofs) - object.block = "hash"; - } - return object; - }; - - /** - * Converts this GetBlockRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockRequest - * @instance - * @returns {Object.} JSON object - */ - GetBlockRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetBlockRequest; - })(); - - v0.GetBlockResponse = (function() { - - /** - * Properties of a GetBlockResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetBlockResponse - * @property {Uint8Array|null} [block] GetBlockResponse block - */ - - /** - * Constructs a new GetBlockResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetBlockResponse. - * @implements IGetBlockResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetBlockResponse=} [properties] Properties to set - */ - function GetBlockResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBlockResponse block. - * @member {Uint8Array} block - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.block = $util.newBuffer([]); - - /** - * Creates a new GetBlockResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBlockResponse} GetBlockResponse instance - */ - GetBlockResponse.create = function create(properties) { - return new GetBlockResponse(properties); - }; - - /** - * Encodes the specified GetBlockResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockResponse} message GetBlockResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBlockResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.block); - return writer; - }; - - /** - * Encodes the specified GetBlockResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBlockResponse} message GetBlockResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBlockResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBlockResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBlockResponse} GetBlockResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBlockResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBlockResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBlockResponse} GetBlockResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBlockResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBlockResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBlockResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) - if (!(message.block && typeof message.block.length === "number" || $util.isString(message.block))) - return "block: buffer expected"; - return null; - }; - - /** - * Creates a GetBlockResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBlockResponse} GetBlockResponse - */ - GetBlockResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBlockResponse(); - if (object.block != null) - if (typeof object.block === "string") - $util.base64.decode(object.block, message.block = $util.newBuffer($util.base64.length(object.block)), 0); - else if (object.block.length >= 0) - message.block = object.block; - return message; - }; - - /** - * Creates a plain object from a GetBlockResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @static - * @param {org.dash.platform.dapi.v0.GetBlockResponse} message GetBlockResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBlockResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.block = ""; - else { - object.block = []; - if (options.bytes !== Array) - object.block = $util.newBuffer(object.block); - } - if (message.block != null && message.hasOwnProperty("block")) - object.block = options.bytes === String ? $util.base64.encode(message.block, 0, message.block.length) : options.bytes === Array ? Array.prototype.slice.call(message.block) : message.block; - return object; - }; - - /** - * Converts this GetBlockResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBlockResponse - * @instance - * @returns {Object.} JSON object - */ - GetBlockResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetBlockResponse; - })(); - - v0.GetBestBlockHeightRequest = (function() { - - /** - * Properties of a GetBestBlockHeightRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetBestBlockHeightRequest - */ - - /** - * Constructs a new GetBestBlockHeightRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetBestBlockHeightRequest. - * @implements IGetBestBlockHeightRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest=} [properties] Properties to set - */ - function GetBestBlockHeightRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new GetBestBlockHeightRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} GetBestBlockHeightRequest instance - */ - GetBestBlockHeightRequest.create = function create(properties) { - return new GetBestBlockHeightRequest(properties); - }; - - /** - * Encodes the specified GetBestBlockHeightRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBestBlockHeightRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest} message GetBestBlockHeightRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBestBlockHeightRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GetBestBlockHeightRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBestBlockHeightRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest} message GetBestBlockHeightRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBestBlockHeightRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBestBlockHeightRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} GetBestBlockHeightRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBestBlockHeightRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBestBlockHeightRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBestBlockHeightRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} GetBestBlockHeightRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBestBlockHeightRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBestBlockHeightRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBestBlockHeightRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GetBestBlockHeightRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} GetBestBlockHeightRequest - */ - GetBestBlockHeightRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBestBlockHeightRequest) - return object; - return new $root.org.dash.platform.dapi.v0.GetBestBlockHeightRequest(); - }; - - /** - * Creates a plain object from a GetBestBlockHeightRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @static - * @param {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} message GetBestBlockHeightRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBestBlockHeightRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GetBestBlockHeightRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest - * @instance - * @returns {Object.} JSON object - */ - GetBestBlockHeightRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetBestBlockHeightRequest; - })(); - - v0.GetBestBlockHeightResponse = (function() { - - /** - * Properties of a GetBestBlockHeightResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetBestBlockHeightResponse - * @property {number|null} [height] GetBestBlockHeightResponse height - */ - - /** - * Constructs a new GetBestBlockHeightResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetBestBlockHeightResponse. - * @implements IGetBestBlockHeightResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightResponse=} [properties] Properties to set - */ - function GetBestBlockHeightResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBestBlockHeightResponse height. - * @member {number} height - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @instance - */ - GetBestBlockHeightResponse.prototype.height = 0; - - /** - * Creates a new GetBestBlockHeightResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} GetBestBlockHeightResponse instance - */ - GetBestBlockHeightResponse.create = function create(properties) { - return new GetBestBlockHeightResponse(properties); - }; - - /** - * Encodes the specified GetBestBlockHeightResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBestBlockHeightResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightResponse} message GetBestBlockHeightResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBestBlockHeightResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.height); - return writer; - }; - - /** - * Encodes the specified GetBestBlockHeightResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBestBlockHeightResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightResponse} message GetBestBlockHeightResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBestBlockHeightResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBestBlockHeightResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} GetBestBlockHeightResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBestBlockHeightResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBestBlockHeightResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBestBlockHeightResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} GetBestBlockHeightResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBestBlockHeightResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBestBlockHeightResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBestBlockHeightResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - return null; - }; - - /** - * Creates a GetBestBlockHeightResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} GetBestBlockHeightResponse - */ - GetBestBlockHeightResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetBestBlockHeightResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetBestBlockHeightResponse(); - if (object.height != null) - message.height = object.height >>> 0; - return message; - }; - - /** - * Creates a plain object from a GetBestBlockHeightResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @static - * @param {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} message GetBestBlockHeightResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBestBlockHeightResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.height = 0; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - return object; - }; - - /** - * Converts this GetBestBlockHeightResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse - * @instance - * @returns {Object.} JSON object - */ - GetBestBlockHeightResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetBestBlockHeightResponse; - })(); - - v0.BroadcastTransactionRequest = (function() { - - /** - * Properties of a BroadcastTransactionRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IBroadcastTransactionRequest - * @property {Uint8Array|null} [transaction] BroadcastTransactionRequest transaction - * @property {boolean|null} [allowHighFees] BroadcastTransactionRequest allowHighFees - * @property {boolean|null} [bypassLimits] BroadcastTransactionRequest bypassLimits - */ - - /** - * Constructs a new BroadcastTransactionRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BroadcastTransactionRequest. - * @implements IBroadcastTransactionRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest=} [properties] Properties to set - */ - function BroadcastTransactionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BroadcastTransactionRequest transaction. - * @member {Uint8Array} transaction - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @instance - */ - BroadcastTransactionRequest.prototype.transaction = $util.newBuffer([]); - - /** - * BroadcastTransactionRequest allowHighFees. - * @member {boolean} allowHighFees - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @instance - */ - BroadcastTransactionRequest.prototype.allowHighFees = false; - - /** - * BroadcastTransactionRequest bypassLimits. - * @member {boolean} bypassLimits - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @instance - */ - BroadcastTransactionRequest.prototype.bypassLimits = false; - - /** - * Creates a new BroadcastTransactionRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BroadcastTransactionRequest} BroadcastTransactionRequest instance - */ - BroadcastTransactionRequest.create = function create(properties) { - return new BroadcastTransactionRequest(properties); - }; - - /** - * Encodes the specified BroadcastTransactionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastTransactionRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest} message BroadcastTransactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastTransactionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - if (message.allowHighFees != null && Object.hasOwnProperty.call(message, "allowHighFees")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowHighFees); - if (message.bypassLimits != null && Object.hasOwnProperty.call(message, "bypassLimits")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.bypassLimits); - return writer; - }; - - /** - * Encodes the specified BroadcastTransactionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastTransactionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest} message BroadcastTransactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BroadcastTransactionRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BroadcastTransactionRequest} BroadcastTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastTransactionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastTransactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.transaction = reader.bytes(); - break; - case 2: - message.allowHighFees = reader.bool(); - break; - case 3: - message.bypassLimits = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BroadcastTransactionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BroadcastTransactionRequest} BroadcastTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastTransactionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BroadcastTransactionRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BroadcastTransactionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - if (message.allowHighFees != null && message.hasOwnProperty("allowHighFees")) - if (typeof message.allowHighFees !== "boolean") - return "allowHighFees: boolean expected"; - if (message.bypassLimits != null && message.hasOwnProperty("bypassLimits")) - if (typeof message.bypassLimits !== "boolean") - return "bypassLimits: boolean expected"; - return null; - }; - - /** - * Creates a BroadcastTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BroadcastTransactionRequest} BroadcastTransactionRequest - */ - BroadcastTransactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastTransactionRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.BroadcastTransactionRequest(); - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length >= 0) - message.transaction = object.transaction; - if (object.allowHighFees != null) - message.allowHighFees = Boolean(object.allowHighFees); - if (object.bypassLimits != null) - message.bypassLimits = Boolean(object.bypassLimits); - return message; - }; - - /** - * Creates a plain object from a BroadcastTransactionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @static - * @param {org.dash.platform.dapi.v0.BroadcastTransactionRequest} message BroadcastTransactionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BroadcastTransactionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - object.allowHighFees = false; - object.bypassLimits = false; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (message.allowHighFees != null && message.hasOwnProperty("allowHighFees")) - object.allowHighFees = message.allowHighFees; - if (message.bypassLimits != null && message.hasOwnProperty("bypassLimits")) - object.bypassLimits = message.bypassLimits; - return object; - }; - - /** - * Converts this BroadcastTransactionRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest - * @instance - * @returns {Object.} JSON object - */ - BroadcastTransactionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BroadcastTransactionRequest; - })(); - - v0.BroadcastTransactionResponse = (function() { - - /** - * Properties of a BroadcastTransactionResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IBroadcastTransactionResponse - * @property {string|null} [transactionId] BroadcastTransactionResponse transactionId - */ - - /** - * Constructs a new BroadcastTransactionResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BroadcastTransactionResponse. - * @implements IBroadcastTransactionResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionResponse=} [properties] Properties to set - */ - function BroadcastTransactionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BroadcastTransactionResponse transactionId. - * @member {string} transactionId - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @instance - */ - BroadcastTransactionResponse.prototype.transactionId = ""; - - /** - * Creates a new BroadcastTransactionResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BroadcastTransactionResponse} BroadcastTransactionResponse instance - */ - BroadcastTransactionResponse.create = function create(properties) { - return new BroadcastTransactionResponse(properties); - }; - - /** - * Encodes the specified BroadcastTransactionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastTransactionResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionResponse} message BroadcastTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastTransactionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.transactionId); - return writer; - }; - - /** - * Encodes the specified BroadcastTransactionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastTransactionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastTransactionResponse} message BroadcastTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BroadcastTransactionResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BroadcastTransactionResponse} BroadcastTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastTransactionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastTransactionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.transactionId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BroadcastTransactionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BroadcastTransactionResponse} BroadcastTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastTransactionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BroadcastTransactionResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BroadcastTransactionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - if (!$util.isString(message.transactionId)) - return "transactionId: string expected"; - return null; - }; - - /** - * Creates a BroadcastTransactionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BroadcastTransactionResponse} BroadcastTransactionResponse - */ - BroadcastTransactionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastTransactionResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.BroadcastTransactionResponse(); - if (object.transactionId != null) - message.transactionId = String(object.transactionId); - return message; - }; - - /** - * Creates a plain object from a BroadcastTransactionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @static - * @param {org.dash.platform.dapi.v0.BroadcastTransactionResponse} message BroadcastTransactionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BroadcastTransactionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.transactionId = ""; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) - object.transactionId = message.transactionId; - return object; - }; - - /** - * Converts this BroadcastTransactionResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse - * @instance - * @returns {Object.} JSON object - */ - BroadcastTransactionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BroadcastTransactionResponse; - })(); - - v0.GetTransactionRequest = (function() { - - /** - * Properties of a GetTransactionRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTransactionRequest - * @property {string|null} [id] GetTransactionRequest id - */ - - /** - * Constructs a new GetTransactionRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTransactionRequest. - * @implements IGetTransactionRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTransactionRequest=} [properties] Properties to set - */ - function GetTransactionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTransactionRequest id. - * @member {string} id - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @instance - */ - GetTransactionRequest.prototype.id = ""; - - /** - * Creates a new GetTransactionRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTransactionRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTransactionRequest} GetTransactionRequest instance - */ - GetTransactionRequest.create = function create(properties) { - return new GetTransactionRequest(properties); - }; - - /** - * Encodes the specified GetTransactionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTransactionRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTransactionRequest} message GetTransactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTransactionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - return writer; - }; - - /** - * Encodes the specified GetTransactionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTransactionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTransactionRequest} message GetTransactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTransactionRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTransactionRequest} GetTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTransactionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTransactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTransactionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTransactionRequest} GetTransactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTransactionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTransactionRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTransactionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - return null; - }; - - /** - * Creates a GetTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTransactionRequest} GetTransactionRequest - */ - GetTransactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTransactionRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTransactionRequest(); - if (object.id != null) - message.id = String(object.id); - return message; - }; - - /** - * Creates a plain object from a GetTransactionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTransactionRequest} message GetTransactionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTransactionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - return object; - }; - - /** - * Converts this GetTransactionRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTransactionRequest - * @instance - * @returns {Object.} JSON object - */ - GetTransactionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTransactionRequest; - })(); - - v0.GetTransactionResponse = (function() { - - /** - * Properties of a GetTransactionResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTransactionResponse - * @property {Uint8Array|null} [transaction] GetTransactionResponse transaction - * @property {Uint8Array|null} [blockHash] GetTransactionResponse blockHash - * @property {number|null} [height] GetTransactionResponse height - * @property {number|null} [confirmations] GetTransactionResponse confirmations - * @property {boolean|null} [isInstantLocked] GetTransactionResponse isInstantLocked - * @property {boolean|null} [isChainLocked] GetTransactionResponse isChainLocked - */ - - /** - * Constructs a new GetTransactionResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTransactionResponse. - * @implements IGetTransactionResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTransactionResponse=} [properties] Properties to set - */ - function GetTransactionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTransactionResponse transaction. - * @member {Uint8Array} transaction - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @instance - */ - GetTransactionResponse.prototype.transaction = $util.newBuffer([]); - - /** - * GetTransactionResponse blockHash. - * @member {Uint8Array} blockHash - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @instance - */ - GetTransactionResponse.prototype.blockHash = $util.newBuffer([]); - - /** - * GetTransactionResponse height. - * @member {number} height - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @instance - */ - GetTransactionResponse.prototype.height = 0; - - /** - * GetTransactionResponse confirmations. - * @member {number} confirmations - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @instance - */ - GetTransactionResponse.prototype.confirmations = 0; - - /** - * GetTransactionResponse isInstantLocked. - * @member {boolean} isInstantLocked - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @instance - */ - GetTransactionResponse.prototype.isInstantLocked = false; - - /** - * GetTransactionResponse isChainLocked. - * @member {boolean} isChainLocked - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @instance - */ - GetTransactionResponse.prototype.isChainLocked = false; - - /** - * Creates a new GetTransactionResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTransactionResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTransactionResponse} GetTransactionResponse instance - */ - GetTransactionResponse.create = function create(properties) { - return new GetTransactionResponse(properties); - }; - - /** - * Encodes the specified GetTransactionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTransactionResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTransactionResponse} message GetTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTransactionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - if (message.blockHash != null && Object.hasOwnProperty.call(message, "blockHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.blockHash); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.height); - if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.confirmations); - if (message.isInstantLocked != null && Object.hasOwnProperty.call(message, "isInstantLocked")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isInstantLocked); - if (message.isChainLocked != null && Object.hasOwnProperty.call(message, "isChainLocked")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isChainLocked); - return writer; - }; - - /** - * Encodes the specified GetTransactionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTransactionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTransactionResponse} message GetTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTransactionResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTransactionResponse} GetTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTransactionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTransactionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.transaction = reader.bytes(); - break; - case 2: - message.blockHash = reader.bytes(); - break; - case 3: - message.height = reader.uint32(); - break; - case 4: - message.confirmations = reader.uint32(); - break; - case 5: - message.isInstantLocked = reader.bool(); - break; - case 6: - message.isChainLocked = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTransactionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTransactionResponse} GetTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTransactionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTransactionResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTransactionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - if (message.blockHash != null && message.hasOwnProperty("blockHash")) - if (!(message.blockHash && typeof message.blockHash.length === "number" || $util.isString(message.blockHash))) - return "blockHash: buffer expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.confirmations != null && message.hasOwnProperty("confirmations")) - if (!$util.isInteger(message.confirmations)) - return "confirmations: integer expected"; - if (message.isInstantLocked != null && message.hasOwnProperty("isInstantLocked")) - if (typeof message.isInstantLocked !== "boolean") - return "isInstantLocked: boolean expected"; - if (message.isChainLocked != null && message.hasOwnProperty("isChainLocked")) - if (typeof message.isChainLocked !== "boolean") - return "isChainLocked: boolean expected"; - return null; - }; - - /** - * Creates a GetTransactionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTransactionResponse} GetTransactionResponse - */ - GetTransactionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTransactionResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTransactionResponse(); - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length >= 0) - message.transaction = object.transaction; - if (object.blockHash != null) - if (typeof object.blockHash === "string") - $util.base64.decode(object.blockHash, message.blockHash = $util.newBuffer($util.base64.length(object.blockHash)), 0); - else if (object.blockHash.length >= 0) - message.blockHash = object.blockHash; - if (object.height != null) - message.height = object.height >>> 0; - if (object.confirmations != null) - message.confirmations = object.confirmations >>> 0; - if (object.isInstantLocked != null) - message.isInstantLocked = Boolean(object.isInstantLocked); - if (object.isChainLocked != null) - message.isChainLocked = Boolean(object.isChainLocked); - return message; - }; - - /** - * Creates a plain object from a GetTransactionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTransactionResponse} message GetTransactionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTransactionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - if (options.bytes === String) - object.blockHash = ""; - else { - object.blockHash = []; - if (options.bytes !== Array) - object.blockHash = $util.newBuffer(object.blockHash); - } - object.height = 0; - object.confirmations = 0; - object.isInstantLocked = false; - object.isChainLocked = false; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (message.blockHash != null && message.hasOwnProperty("blockHash")) - object.blockHash = options.bytes === String ? $util.base64.encode(message.blockHash, 0, message.blockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.blockHash) : message.blockHash; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.confirmations != null && message.hasOwnProperty("confirmations")) - object.confirmations = message.confirmations; - if (message.isInstantLocked != null && message.hasOwnProperty("isInstantLocked")) - object.isInstantLocked = message.isInstantLocked; - if (message.isChainLocked != null && message.hasOwnProperty("isChainLocked")) - object.isChainLocked = message.isChainLocked; - return object; - }; - - /** - * Converts this GetTransactionResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTransactionResponse - * @instance - * @returns {Object.} JSON object - */ - GetTransactionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTransactionResponse; - })(); - - v0.BlockHeadersWithChainLocksRequest = (function() { - - /** - * Properties of a BlockHeadersWithChainLocksRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IBlockHeadersWithChainLocksRequest - * @property {Uint8Array|null} [fromBlockHash] BlockHeadersWithChainLocksRequest fromBlockHash - * @property {number|null} [fromBlockHeight] BlockHeadersWithChainLocksRequest fromBlockHeight - * @property {number|null} [count] BlockHeadersWithChainLocksRequest count - */ - - /** - * Constructs a new BlockHeadersWithChainLocksRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BlockHeadersWithChainLocksRequest. - * @implements IBlockHeadersWithChainLocksRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest=} [properties] Properties to set - */ - function BlockHeadersWithChainLocksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockHeadersWithChainLocksRequest fromBlockHash. - * @member {Uint8Array} fromBlockHash - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @instance - */ - BlockHeadersWithChainLocksRequest.prototype.fromBlockHash = $util.newBuffer([]); - - /** - * BlockHeadersWithChainLocksRequest fromBlockHeight. - * @member {number} fromBlockHeight - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @instance - */ - BlockHeadersWithChainLocksRequest.prototype.fromBlockHeight = 0; - - /** - * BlockHeadersWithChainLocksRequest count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @instance - */ - BlockHeadersWithChainLocksRequest.prototype.count = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BlockHeadersWithChainLocksRequest fromBlock. - * @member {"fromBlockHash"|"fromBlockHeight"|undefined} fromBlock - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @instance - */ - Object.defineProperty(BlockHeadersWithChainLocksRequest.prototype, "fromBlock", { - get: $util.oneOfGetter($oneOfFields = ["fromBlockHash", "fromBlockHeight"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BlockHeadersWithChainLocksRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} BlockHeadersWithChainLocksRequest instance - */ - BlockHeadersWithChainLocksRequest.create = function create(properties) { - return new BlockHeadersWithChainLocksRequest(properties); - }; - - /** - * Encodes the specified BlockHeadersWithChainLocksRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest} message BlockHeadersWithChainLocksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockHeadersWithChainLocksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fromBlockHash != null && Object.hasOwnProperty.call(message, "fromBlockHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.fromBlockHash); - if (message.fromBlockHeight != null && Object.hasOwnProperty.call(message, "fromBlockHeight")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.fromBlockHeight); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.count); - return writer; - }; - - /** - * Encodes the specified BlockHeadersWithChainLocksRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest} message BlockHeadersWithChainLocksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockHeadersWithChainLocksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockHeadersWithChainLocksRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} BlockHeadersWithChainLocksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockHeadersWithChainLocksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fromBlockHash = reader.bytes(); - break; - case 2: - message.fromBlockHeight = reader.uint32(); - break; - case 3: - message.count = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockHeadersWithChainLocksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} BlockHeadersWithChainLocksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockHeadersWithChainLocksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockHeadersWithChainLocksRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockHeadersWithChainLocksRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.fromBlockHash != null && message.hasOwnProperty("fromBlockHash")) { - properties.fromBlock = 1; - if (!(message.fromBlockHash && typeof message.fromBlockHash.length === "number" || $util.isString(message.fromBlockHash))) - return "fromBlockHash: buffer expected"; - } - if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) { - if (properties.fromBlock === 1) - return "fromBlock: multiple values"; - properties.fromBlock = 1; - if (!$util.isInteger(message.fromBlockHeight)) - return "fromBlockHeight: integer expected"; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; - - /** - * Creates a BlockHeadersWithChainLocksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} BlockHeadersWithChainLocksRequest - */ - BlockHeadersWithChainLocksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest(); - if (object.fromBlockHash != null) - if (typeof object.fromBlockHash === "string") - $util.base64.decode(object.fromBlockHash, message.fromBlockHash = $util.newBuffer($util.base64.length(object.fromBlockHash)), 0); - else if (object.fromBlockHash.length >= 0) - message.fromBlockHash = object.fromBlockHash; - if (object.fromBlockHeight != null) - message.fromBlockHeight = object.fromBlockHeight >>> 0; - if (object.count != null) - message.count = object.count >>> 0; - return message; - }; - - /** - * Creates a plain object from a BlockHeadersWithChainLocksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @static - * @param {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} message BlockHeadersWithChainLocksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockHeadersWithChainLocksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.count = 0; - if (message.fromBlockHash != null && message.hasOwnProperty("fromBlockHash")) { - object.fromBlockHash = options.bytes === String ? $util.base64.encode(message.fromBlockHash, 0, message.fromBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.fromBlockHash) : message.fromBlockHash; - if (options.oneofs) - object.fromBlock = "fromBlockHash"; - } - if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) { - object.fromBlockHeight = message.fromBlockHeight; - if (options.oneofs) - object.fromBlock = "fromBlockHeight"; - } - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; - - /** - * Converts this BlockHeadersWithChainLocksRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest - * @instance - * @returns {Object.} JSON object - */ - BlockHeadersWithChainLocksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockHeadersWithChainLocksRequest; - })(); - - v0.BlockHeadersWithChainLocksResponse = (function() { - - /** - * Properties of a BlockHeadersWithChainLocksResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IBlockHeadersWithChainLocksResponse - * @property {org.dash.platform.dapi.v0.IBlockHeaders|null} [blockHeaders] BlockHeadersWithChainLocksResponse blockHeaders - * @property {Uint8Array|null} [chainLock] BlockHeadersWithChainLocksResponse chainLock - */ - - /** - * Constructs a new BlockHeadersWithChainLocksResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BlockHeadersWithChainLocksResponse. - * @implements IBlockHeadersWithChainLocksResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksResponse=} [properties] Properties to set - */ - function BlockHeadersWithChainLocksResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockHeadersWithChainLocksResponse blockHeaders. - * @member {org.dash.platform.dapi.v0.IBlockHeaders|null|undefined} blockHeaders - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @instance - */ - BlockHeadersWithChainLocksResponse.prototype.blockHeaders = null; - - /** - * BlockHeadersWithChainLocksResponse chainLock. - * @member {Uint8Array} chainLock - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @instance - */ - BlockHeadersWithChainLocksResponse.prototype.chainLock = $util.newBuffer([]); - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BlockHeadersWithChainLocksResponse responses. - * @member {"blockHeaders"|"chainLock"|undefined} responses - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @instance - */ - Object.defineProperty(BlockHeadersWithChainLocksResponse.prototype, "responses", { - get: $util.oneOfGetter($oneOfFields = ["blockHeaders", "chainLock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BlockHeadersWithChainLocksResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} BlockHeadersWithChainLocksResponse instance - */ - BlockHeadersWithChainLocksResponse.create = function create(properties) { - return new BlockHeadersWithChainLocksResponse(properties); - }; - - /** - * Encodes the specified BlockHeadersWithChainLocksResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksResponse} message BlockHeadersWithChainLocksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockHeadersWithChainLocksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.blockHeaders != null && Object.hasOwnProperty.call(message, "blockHeaders")) - $root.org.dash.platform.dapi.v0.BlockHeaders.encode(message.blockHeaders, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.chainLock != null && Object.hasOwnProperty.call(message, "chainLock")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chainLock); - return writer; - }; - - /** - * Encodes the specified BlockHeadersWithChainLocksResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksResponse} message BlockHeadersWithChainLocksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockHeadersWithChainLocksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockHeadersWithChainLocksResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} BlockHeadersWithChainLocksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockHeadersWithChainLocksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.blockHeaders = $root.org.dash.platform.dapi.v0.BlockHeaders.decode(reader, reader.uint32()); - break; - case 2: - message.chainLock = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockHeadersWithChainLocksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} BlockHeadersWithChainLocksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockHeadersWithChainLocksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockHeadersWithChainLocksResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockHeadersWithChainLocksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.blockHeaders != null && message.hasOwnProperty("blockHeaders")) { - properties.responses = 1; - { - var error = $root.org.dash.platform.dapi.v0.BlockHeaders.verify(message.blockHeaders); - if (error) - return "blockHeaders." + error; - } - } - if (message.chainLock != null && message.hasOwnProperty("chainLock")) { - if (properties.responses === 1) - return "responses: multiple values"; - properties.responses = 1; - if (!(message.chainLock && typeof message.chainLock.length === "number" || $util.isString(message.chainLock))) - return "chainLock: buffer expected"; - } - return null; - }; - - /** - * Creates a BlockHeadersWithChainLocksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} BlockHeadersWithChainLocksResponse - */ - BlockHeadersWithChainLocksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse(); - if (object.blockHeaders != null) { - if (typeof object.blockHeaders !== "object") - throw TypeError(".org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse.blockHeaders: object expected"); - message.blockHeaders = $root.org.dash.platform.dapi.v0.BlockHeaders.fromObject(object.blockHeaders); - } - if (object.chainLock != null) - if (typeof object.chainLock === "string") - $util.base64.decode(object.chainLock, message.chainLock = $util.newBuffer($util.base64.length(object.chainLock)), 0); - else if (object.chainLock.length >= 0) - message.chainLock = object.chainLock; - return message; - }; - - /** - * Creates a plain object from a BlockHeadersWithChainLocksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @static - * @param {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} message BlockHeadersWithChainLocksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockHeadersWithChainLocksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.blockHeaders != null && message.hasOwnProperty("blockHeaders")) { - object.blockHeaders = $root.org.dash.platform.dapi.v0.BlockHeaders.toObject(message.blockHeaders, options); - if (options.oneofs) - object.responses = "blockHeaders"; - } - if (message.chainLock != null && message.hasOwnProperty("chainLock")) { - object.chainLock = options.bytes === String ? $util.base64.encode(message.chainLock, 0, message.chainLock.length) : options.bytes === Array ? Array.prototype.slice.call(message.chainLock) : message.chainLock; - if (options.oneofs) - object.responses = "chainLock"; - } - return object; - }; - - /** - * Converts this BlockHeadersWithChainLocksResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse - * @instance - * @returns {Object.} JSON object - */ - BlockHeadersWithChainLocksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockHeadersWithChainLocksResponse; - })(); - - v0.BlockHeaders = (function() { - - /** - * Properties of a BlockHeaders. - * @memberof org.dash.platform.dapi.v0 - * @interface IBlockHeaders - * @property {Array.|null} [headers] BlockHeaders headers - */ - - /** - * Constructs a new BlockHeaders. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BlockHeaders. - * @implements IBlockHeaders - * @constructor - * @param {org.dash.platform.dapi.v0.IBlockHeaders=} [properties] Properties to set - */ - function BlockHeaders(properties) { - this.headers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockHeaders headers. - * @member {Array.} headers - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @instance - */ - BlockHeaders.prototype.headers = $util.emptyArray; - - /** - * Creates a new BlockHeaders instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeaders=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BlockHeaders} BlockHeaders instance - */ - BlockHeaders.create = function create(properties) { - return new BlockHeaders(properties); - }; - - /** - * Encodes the specified BlockHeaders message. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeaders.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeaders} message BlockHeaders message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockHeaders.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.headers != null && message.headers.length) - for (var i = 0; i < message.headers.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.headers[i]); - return writer; - }; - - /** - * Encodes the specified BlockHeaders message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeaders.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @static - * @param {org.dash.platform.dapi.v0.IBlockHeaders} message BlockHeaders message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockHeaders.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockHeaders message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BlockHeaders} BlockHeaders - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockHeaders.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BlockHeaders(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.headers && message.headers.length)) - message.headers = []; - message.headers.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockHeaders message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BlockHeaders} BlockHeaders - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockHeaders.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockHeaders message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockHeaders.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.headers != null && message.hasOwnProperty("headers")) { - if (!Array.isArray(message.headers)) - return "headers: array expected"; - for (var i = 0; i < message.headers.length; ++i) - if (!(message.headers[i] && typeof message.headers[i].length === "number" || $util.isString(message.headers[i]))) - return "headers: buffer[] expected"; - } - return null; - }; - - /** - * Creates a BlockHeaders message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BlockHeaders} BlockHeaders - */ - BlockHeaders.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BlockHeaders) - return object; - var message = new $root.org.dash.platform.dapi.v0.BlockHeaders(); - if (object.headers) { - if (!Array.isArray(object.headers)) - throw TypeError(".org.dash.platform.dapi.v0.BlockHeaders.headers: array expected"); - message.headers = []; - for (var i = 0; i < object.headers.length; ++i) - if (typeof object.headers[i] === "string") - $util.base64.decode(object.headers[i], message.headers[i] = $util.newBuffer($util.base64.length(object.headers[i])), 0); - else if (object.headers[i].length >= 0) - message.headers[i] = object.headers[i]; - } - return message; - }; - - /** - * Creates a plain object from a BlockHeaders message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @static - * @param {org.dash.platform.dapi.v0.BlockHeaders} message BlockHeaders - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockHeaders.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.headers = []; - if (message.headers && message.headers.length) { - object.headers = []; - for (var j = 0; j < message.headers.length; ++j) - object.headers[j] = options.bytes === String ? $util.base64.encode(message.headers[j], 0, message.headers[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.headers[j]) : message.headers[j]; - } - return object; - }; - - /** - * Converts this BlockHeaders to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BlockHeaders - * @instance - * @returns {Object.} JSON object - */ - BlockHeaders.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockHeaders; - })(); - - v0.GetEstimatedTransactionFeeRequest = (function() { - - /** - * Properties of a GetEstimatedTransactionFeeRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEstimatedTransactionFeeRequest - * @property {number|null} [blocks] GetEstimatedTransactionFeeRequest blocks - */ - - /** - * Constructs a new GetEstimatedTransactionFeeRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEstimatedTransactionFeeRequest. - * @implements IGetEstimatedTransactionFeeRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest=} [properties] Properties to set - */ - function GetEstimatedTransactionFeeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEstimatedTransactionFeeRequest blocks. - * @member {number} blocks - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @instance - */ - GetEstimatedTransactionFeeRequest.prototype.blocks = 0; - - /** - * Creates a new GetEstimatedTransactionFeeRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} GetEstimatedTransactionFeeRequest instance - */ - GetEstimatedTransactionFeeRequest.create = function create(properties) { - return new GetEstimatedTransactionFeeRequest(properties); - }; - - /** - * Encodes the specified GetEstimatedTransactionFeeRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest} message GetEstimatedTransactionFeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEstimatedTransactionFeeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.blocks != null && Object.hasOwnProperty.call(message, "blocks")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.blocks); - return writer; - }; - - /** - * Encodes the specified GetEstimatedTransactionFeeRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest} message GetEstimatedTransactionFeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEstimatedTransactionFeeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEstimatedTransactionFeeRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} GetEstimatedTransactionFeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEstimatedTransactionFeeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.blocks = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEstimatedTransactionFeeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} GetEstimatedTransactionFeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEstimatedTransactionFeeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEstimatedTransactionFeeRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEstimatedTransactionFeeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.blocks != null && message.hasOwnProperty("blocks")) - if (!$util.isInteger(message.blocks)) - return "blocks: integer expected"; - return null; - }; - - /** - * Creates a GetEstimatedTransactionFeeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} GetEstimatedTransactionFeeRequest - */ - GetEstimatedTransactionFeeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest(); - if (object.blocks != null) - message.blocks = object.blocks >>> 0; - return message; - }; - - /** - * Creates a plain object from a GetEstimatedTransactionFeeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @static - * @param {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} message GetEstimatedTransactionFeeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEstimatedTransactionFeeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.blocks = 0; - if (message.blocks != null && message.hasOwnProperty("blocks")) - object.blocks = message.blocks; - return object; - }; - - /** - * Converts this GetEstimatedTransactionFeeRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest - * @instance - * @returns {Object.} JSON object - */ - GetEstimatedTransactionFeeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetEstimatedTransactionFeeRequest; - })(); - - v0.GetEstimatedTransactionFeeResponse = (function() { - - /** - * Properties of a GetEstimatedTransactionFeeResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEstimatedTransactionFeeResponse - * @property {number|null} [fee] GetEstimatedTransactionFeeResponse fee - */ - - /** - * Constructs a new GetEstimatedTransactionFeeResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEstimatedTransactionFeeResponse. - * @implements IGetEstimatedTransactionFeeResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeResponse=} [properties] Properties to set - */ - function GetEstimatedTransactionFeeResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEstimatedTransactionFeeResponse fee. - * @member {number} fee - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @instance - */ - GetEstimatedTransactionFeeResponse.prototype.fee = 0; - - /** - * Creates a new GetEstimatedTransactionFeeResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} GetEstimatedTransactionFeeResponse instance - */ - GetEstimatedTransactionFeeResponse.create = function create(properties) { - return new GetEstimatedTransactionFeeResponse(properties); - }; - - /** - * Encodes the specified GetEstimatedTransactionFeeResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeResponse} message GetEstimatedTransactionFeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEstimatedTransactionFeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.fee); - return writer; - }; - - /** - * Encodes the specified GetEstimatedTransactionFeeResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeResponse} message GetEstimatedTransactionFeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEstimatedTransactionFeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEstimatedTransactionFeeResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} GetEstimatedTransactionFeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEstimatedTransactionFeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEstimatedTransactionFeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} GetEstimatedTransactionFeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEstimatedTransactionFeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEstimatedTransactionFeeResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEstimatedTransactionFeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee != null && message.hasOwnProperty("fee")) - if (typeof message.fee !== "number") - return "fee: number expected"; - return null; - }; - - /** - * Creates a GetEstimatedTransactionFeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} GetEstimatedTransactionFeeResponse - */ - GetEstimatedTransactionFeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse(); - if (object.fee != null) - message.fee = Number(object.fee); - return message; - }; - - /** - * Creates a plain object from a GetEstimatedTransactionFeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @static - * @param {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} message GetEstimatedTransactionFeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEstimatedTransactionFeeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.fee = 0; - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = options.json && !isFinite(message.fee) ? String(message.fee) : message.fee; - return object; - }; - - /** - * Converts this GetEstimatedTransactionFeeResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse - * @instance - * @returns {Object.} JSON object - */ - GetEstimatedTransactionFeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetEstimatedTransactionFeeResponse; - })(); - - v0.TransactionsWithProofsRequest = (function() { - - /** - * Properties of a TransactionsWithProofsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface ITransactionsWithProofsRequest - * @property {org.dash.platform.dapi.v0.IBloomFilter|null} [bloomFilter] TransactionsWithProofsRequest bloomFilter - * @property {Uint8Array|null} [fromBlockHash] TransactionsWithProofsRequest fromBlockHash - * @property {number|null} [fromBlockHeight] TransactionsWithProofsRequest fromBlockHeight - * @property {number|null} [count] TransactionsWithProofsRequest count - * @property {boolean|null} [sendTransactionHashes] TransactionsWithProofsRequest sendTransactionHashes - */ - - /** - * Constructs a new TransactionsWithProofsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a TransactionsWithProofsRequest. - * @implements ITransactionsWithProofsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest=} [properties] Properties to set - */ - function TransactionsWithProofsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransactionsWithProofsRequest bloomFilter. - * @member {org.dash.platform.dapi.v0.IBloomFilter|null|undefined} bloomFilter - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @instance - */ - TransactionsWithProofsRequest.prototype.bloomFilter = null; - - /** - * TransactionsWithProofsRequest fromBlockHash. - * @member {Uint8Array} fromBlockHash - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @instance - */ - TransactionsWithProofsRequest.prototype.fromBlockHash = $util.newBuffer([]); - - /** - * TransactionsWithProofsRequest fromBlockHeight. - * @member {number} fromBlockHeight - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @instance - */ - TransactionsWithProofsRequest.prototype.fromBlockHeight = 0; - - /** - * TransactionsWithProofsRequest count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @instance - */ - TransactionsWithProofsRequest.prototype.count = 0; - - /** - * TransactionsWithProofsRequest sendTransactionHashes. - * @member {boolean} sendTransactionHashes - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @instance - */ - TransactionsWithProofsRequest.prototype.sendTransactionHashes = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransactionsWithProofsRequest fromBlock. - * @member {"fromBlockHash"|"fromBlockHeight"|undefined} fromBlock - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @instance - */ - Object.defineProperty(TransactionsWithProofsRequest.prototype, "fromBlock", { - get: $util.oneOfGetter($oneOfFields = ["fromBlockHash", "fromBlockHeight"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransactionsWithProofsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @static - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} TransactionsWithProofsRequest instance - */ - TransactionsWithProofsRequest.create = function create(properties) { - return new TransactionsWithProofsRequest(properties); - }; - - /** - * Encodes the specified TransactionsWithProofsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.TransactionsWithProofsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @static - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest} message TransactionsWithProofsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionsWithProofsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bloomFilter != null && Object.hasOwnProperty.call(message, "bloomFilter")) - $root.org.dash.platform.dapi.v0.BloomFilter.encode(message.bloomFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fromBlockHash != null && Object.hasOwnProperty.call(message, "fromBlockHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.fromBlockHash); - if (message.fromBlockHeight != null && Object.hasOwnProperty.call(message, "fromBlockHeight")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.fromBlockHeight); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.count); - if (message.sendTransactionHashes != null && Object.hasOwnProperty.call(message, "sendTransactionHashes")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.sendTransactionHashes); - return writer; - }; - - /** - * Encodes the specified TransactionsWithProofsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.TransactionsWithProofsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @static - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest} message TransactionsWithProofsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionsWithProofsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransactionsWithProofsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} TransactionsWithProofsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionsWithProofsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.TransactionsWithProofsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.bloomFilter = $root.org.dash.platform.dapi.v0.BloomFilter.decode(reader, reader.uint32()); - break; - case 2: - message.fromBlockHash = reader.bytes(); - break; - case 3: - message.fromBlockHeight = reader.uint32(); - break; - case 4: - message.count = reader.uint32(); - break; - case 5: - message.sendTransactionHashes = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransactionsWithProofsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} TransactionsWithProofsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionsWithProofsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransactionsWithProofsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransactionsWithProofsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.bloomFilter != null && message.hasOwnProperty("bloomFilter")) { - var error = $root.org.dash.platform.dapi.v0.BloomFilter.verify(message.bloomFilter); - if (error) - return "bloomFilter." + error; - } - if (message.fromBlockHash != null && message.hasOwnProperty("fromBlockHash")) { - properties.fromBlock = 1; - if (!(message.fromBlockHash && typeof message.fromBlockHash.length === "number" || $util.isString(message.fromBlockHash))) - return "fromBlockHash: buffer expected"; - } - if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) { - if (properties.fromBlock === 1) - return "fromBlock: multiple values"; - properties.fromBlock = 1; - if (!$util.isInteger(message.fromBlockHeight)) - return "fromBlockHeight: integer expected"; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.sendTransactionHashes != null && message.hasOwnProperty("sendTransactionHashes")) - if (typeof message.sendTransactionHashes !== "boolean") - return "sendTransactionHashes: boolean expected"; - return null; - }; - - /** - * Creates a TransactionsWithProofsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} TransactionsWithProofsRequest - */ - TransactionsWithProofsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.TransactionsWithProofsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.TransactionsWithProofsRequest(); - if (object.bloomFilter != null) { - if (typeof object.bloomFilter !== "object") - throw TypeError(".org.dash.platform.dapi.v0.TransactionsWithProofsRequest.bloomFilter: object expected"); - message.bloomFilter = $root.org.dash.platform.dapi.v0.BloomFilter.fromObject(object.bloomFilter); - } - if (object.fromBlockHash != null) - if (typeof object.fromBlockHash === "string") - $util.base64.decode(object.fromBlockHash, message.fromBlockHash = $util.newBuffer($util.base64.length(object.fromBlockHash)), 0); - else if (object.fromBlockHash.length >= 0) - message.fromBlockHash = object.fromBlockHash; - if (object.fromBlockHeight != null) - message.fromBlockHeight = object.fromBlockHeight >>> 0; - if (object.count != null) - message.count = object.count >>> 0; - if (object.sendTransactionHashes != null) - message.sendTransactionHashes = Boolean(object.sendTransactionHashes); - return message; - }; - - /** - * Creates a plain object from a TransactionsWithProofsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @static - * @param {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} message TransactionsWithProofsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransactionsWithProofsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bloomFilter = null; - object.count = 0; - object.sendTransactionHashes = false; - } - if (message.bloomFilter != null && message.hasOwnProperty("bloomFilter")) - object.bloomFilter = $root.org.dash.platform.dapi.v0.BloomFilter.toObject(message.bloomFilter, options); - if (message.fromBlockHash != null && message.hasOwnProperty("fromBlockHash")) { - object.fromBlockHash = options.bytes === String ? $util.base64.encode(message.fromBlockHash, 0, message.fromBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.fromBlockHash) : message.fromBlockHash; - if (options.oneofs) - object.fromBlock = "fromBlockHash"; - } - if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) { - object.fromBlockHeight = message.fromBlockHeight; - if (options.oneofs) - object.fromBlock = "fromBlockHeight"; - } - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.sendTransactionHashes != null && message.hasOwnProperty("sendTransactionHashes")) - object.sendTransactionHashes = message.sendTransactionHashes; - return object; - }; - - /** - * Converts this TransactionsWithProofsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest - * @instance - * @returns {Object.} JSON object - */ - TransactionsWithProofsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TransactionsWithProofsRequest; - })(); - - v0.BloomFilter = (function() { - - /** - * Properties of a BloomFilter. - * @memberof org.dash.platform.dapi.v0 - * @interface IBloomFilter - * @property {Uint8Array|null} [vData] BloomFilter vData - * @property {number|null} [nHashFuncs] BloomFilter nHashFuncs - * @property {number|null} [nTweak] BloomFilter nTweak - * @property {number|null} [nFlags] BloomFilter nFlags - */ - - /** - * Constructs a new BloomFilter. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BloomFilter. - * @implements IBloomFilter - * @constructor - * @param {org.dash.platform.dapi.v0.IBloomFilter=} [properties] Properties to set - */ - function BloomFilter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BloomFilter vData. - * @member {Uint8Array} vData - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @instance - */ - BloomFilter.prototype.vData = $util.newBuffer([]); - - /** - * BloomFilter nHashFuncs. - * @member {number} nHashFuncs - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @instance - */ - BloomFilter.prototype.nHashFuncs = 0; - - /** - * BloomFilter nTweak. - * @member {number} nTweak - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @instance - */ - BloomFilter.prototype.nTweak = 0; - - /** - * BloomFilter nFlags. - * @member {number} nFlags - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @instance - */ - BloomFilter.prototype.nFlags = 0; - - /** - * Creates a new BloomFilter instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @static - * @param {org.dash.platform.dapi.v0.IBloomFilter=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BloomFilter} BloomFilter instance - */ - BloomFilter.create = function create(properties) { - return new BloomFilter(properties); - }; - - /** - * Encodes the specified BloomFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.BloomFilter.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @static - * @param {org.dash.platform.dapi.v0.IBloomFilter} message BloomFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BloomFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.vData != null && Object.hasOwnProperty.call(message, "vData")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.vData); - if (message.nHashFuncs != null && Object.hasOwnProperty.call(message, "nHashFuncs")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.nHashFuncs); - if (message.nTweak != null && Object.hasOwnProperty.call(message, "nTweak")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.nTweak); - if (message.nFlags != null && Object.hasOwnProperty.call(message, "nFlags")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.nFlags); - return writer; - }; - - /** - * Encodes the specified BloomFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BloomFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @static - * @param {org.dash.platform.dapi.v0.IBloomFilter} message BloomFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BloomFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BloomFilter message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BloomFilter} BloomFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BloomFilter.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BloomFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.vData = reader.bytes(); - break; - case 2: - message.nHashFuncs = reader.uint32(); - break; - case 3: - message.nTweak = reader.uint32(); - break; - case 4: - message.nFlags = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BloomFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BloomFilter} BloomFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BloomFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BloomFilter message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BloomFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.vData != null && message.hasOwnProperty("vData")) - if (!(message.vData && typeof message.vData.length === "number" || $util.isString(message.vData))) - return "vData: buffer expected"; - if (message.nHashFuncs != null && message.hasOwnProperty("nHashFuncs")) - if (!$util.isInteger(message.nHashFuncs)) - return "nHashFuncs: integer expected"; - if (message.nTweak != null && message.hasOwnProperty("nTweak")) - if (!$util.isInteger(message.nTweak)) - return "nTweak: integer expected"; - if (message.nFlags != null && message.hasOwnProperty("nFlags")) - if (!$util.isInteger(message.nFlags)) - return "nFlags: integer expected"; - return null; - }; - - /** - * Creates a BloomFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BloomFilter} BloomFilter - */ - BloomFilter.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BloomFilter) - return object; - var message = new $root.org.dash.platform.dapi.v0.BloomFilter(); - if (object.vData != null) - if (typeof object.vData === "string") - $util.base64.decode(object.vData, message.vData = $util.newBuffer($util.base64.length(object.vData)), 0); - else if (object.vData.length >= 0) - message.vData = object.vData; - if (object.nHashFuncs != null) - message.nHashFuncs = object.nHashFuncs >>> 0; - if (object.nTweak != null) - message.nTweak = object.nTweak >>> 0; - if (object.nFlags != null) - message.nFlags = object.nFlags >>> 0; - return message; - }; - - /** - * Creates a plain object from a BloomFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @static - * @param {org.dash.platform.dapi.v0.BloomFilter} message BloomFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BloomFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.vData = ""; - else { - object.vData = []; - if (options.bytes !== Array) - object.vData = $util.newBuffer(object.vData); - } - object.nHashFuncs = 0; - object.nTweak = 0; - object.nFlags = 0; - } - if (message.vData != null && message.hasOwnProperty("vData")) - object.vData = options.bytes === String ? $util.base64.encode(message.vData, 0, message.vData.length) : options.bytes === Array ? Array.prototype.slice.call(message.vData) : message.vData; - if (message.nHashFuncs != null && message.hasOwnProperty("nHashFuncs")) - object.nHashFuncs = message.nHashFuncs; - if (message.nTweak != null && message.hasOwnProperty("nTweak")) - object.nTweak = message.nTweak; - if (message.nFlags != null && message.hasOwnProperty("nFlags")) - object.nFlags = message.nFlags; - return object; - }; - - /** - * Converts this BloomFilter to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BloomFilter - * @instance - * @returns {Object.} JSON object - */ - BloomFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BloomFilter; - })(); - - v0.TransactionsWithProofsResponse = (function() { - - /** - * Properties of a TransactionsWithProofsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface ITransactionsWithProofsResponse - * @property {org.dash.platform.dapi.v0.IRawTransactions|null} [rawTransactions] TransactionsWithProofsResponse rawTransactions - * @property {org.dash.platform.dapi.v0.IInstantSendLockMessages|null} [instantSendLockMessages] TransactionsWithProofsResponse instantSendLockMessages - * @property {Uint8Array|null} [rawMerkleBlock] TransactionsWithProofsResponse rawMerkleBlock - */ - - /** - * Constructs a new TransactionsWithProofsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a TransactionsWithProofsResponse. - * @implements ITransactionsWithProofsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsResponse=} [properties] Properties to set - */ - function TransactionsWithProofsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TransactionsWithProofsResponse rawTransactions. - * @member {org.dash.platform.dapi.v0.IRawTransactions|null|undefined} rawTransactions - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @instance - */ - TransactionsWithProofsResponse.prototype.rawTransactions = null; - - /** - * TransactionsWithProofsResponse instantSendLockMessages. - * @member {org.dash.platform.dapi.v0.IInstantSendLockMessages|null|undefined} instantSendLockMessages - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @instance - */ - TransactionsWithProofsResponse.prototype.instantSendLockMessages = null; - - /** - * TransactionsWithProofsResponse rawMerkleBlock. - * @member {Uint8Array} rawMerkleBlock - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @instance - */ - TransactionsWithProofsResponse.prototype.rawMerkleBlock = $util.newBuffer([]); - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransactionsWithProofsResponse responses. - * @member {"rawTransactions"|"instantSendLockMessages"|"rawMerkleBlock"|undefined} responses - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @instance - */ - Object.defineProperty(TransactionsWithProofsResponse.prototype, "responses", { - get: $util.oneOfGetter($oneOfFields = ["rawTransactions", "instantSendLockMessages", "rawMerkleBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransactionsWithProofsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @static - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} TransactionsWithProofsResponse instance - */ - TransactionsWithProofsResponse.create = function create(properties) { - return new TransactionsWithProofsResponse(properties); - }; - - /** - * Encodes the specified TransactionsWithProofsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.TransactionsWithProofsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @static - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsResponse} message TransactionsWithProofsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionsWithProofsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rawTransactions != null && Object.hasOwnProperty.call(message, "rawTransactions")) - $root.org.dash.platform.dapi.v0.RawTransactions.encode(message.rawTransactions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instantSendLockMessages != null && Object.hasOwnProperty.call(message, "instantSendLockMessages")) - $root.org.dash.platform.dapi.v0.InstantSendLockMessages.encode(message.instantSendLockMessages, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.rawMerkleBlock != null && Object.hasOwnProperty.call(message, "rawMerkleBlock")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.rawMerkleBlock); - return writer; - }; - - /** - * Encodes the specified TransactionsWithProofsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.TransactionsWithProofsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @static - * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsResponse} message TransactionsWithProofsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransactionsWithProofsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransactionsWithProofsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} TransactionsWithProofsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionsWithProofsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.TransactionsWithProofsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rawTransactions = $root.org.dash.platform.dapi.v0.RawTransactions.decode(reader, reader.uint32()); - break; - case 2: - message.instantSendLockMessages = $root.org.dash.platform.dapi.v0.InstantSendLockMessages.decode(reader, reader.uint32()); - break; - case 3: - message.rawMerkleBlock = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransactionsWithProofsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} TransactionsWithProofsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransactionsWithProofsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransactionsWithProofsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransactionsWithProofsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.rawTransactions != null && message.hasOwnProperty("rawTransactions")) { - properties.responses = 1; - { - var error = $root.org.dash.platform.dapi.v0.RawTransactions.verify(message.rawTransactions); - if (error) - return "rawTransactions." + error; - } - } - if (message.instantSendLockMessages != null && message.hasOwnProperty("instantSendLockMessages")) { - if (properties.responses === 1) - return "responses: multiple values"; - properties.responses = 1; - { - var error = $root.org.dash.platform.dapi.v0.InstantSendLockMessages.verify(message.instantSendLockMessages); - if (error) - return "instantSendLockMessages." + error; - } - } - if (message.rawMerkleBlock != null && message.hasOwnProperty("rawMerkleBlock")) { - if (properties.responses === 1) - return "responses: multiple values"; - properties.responses = 1; - if (!(message.rawMerkleBlock && typeof message.rawMerkleBlock.length === "number" || $util.isString(message.rawMerkleBlock))) - return "rawMerkleBlock: buffer expected"; - } - return null; - }; - - /** - * Creates a TransactionsWithProofsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} TransactionsWithProofsResponse - */ - TransactionsWithProofsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.TransactionsWithProofsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.TransactionsWithProofsResponse(); - if (object.rawTransactions != null) { - if (typeof object.rawTransactions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.TransactionsWithProofsResponse.rawTransactions: object expected"); - message.rawTransactions = $root.org.dash.platform.dapi.v0.RawTransactions.fromObject(object.rawTransactions); - } - if (object.instantSendLockMessages != null) { - if (typeof object.instantSendLockMessages !== "object") - throw TypeError(".org.dash.platform.dapi.v0.TransactionsWithProofsResponse.instantSendLockMessages: object expected"); - message.instantSendLockMessages = $root.org.dash.platform.dapi.v0.InstantSendLockMessages.fromObject(object.instantSendLockMessages); - } - if (object.rawMerkleBlock != null) - if (typeof object.rawMerkleBlock === "string") - $util.base64.decode(object.rawMerkleBlock, message.rawMerkleBlock = $util.newBuffer($util.base64.length(object.rawMerkleBlock)), 0); - else if (object.rawMerkleBlock.length >= 0) - message.rawMerkleBlock = object.rawMerkleBlock; - return message; - }; - - /** - * Creates a plain object from a TransactionsWithProofsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @static - * @param {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} message TransactionsWithProofsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransactionsWithProofsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.rawTransactions != null && message.hasOwnProperty("rawTransactions")) { - object.rawTransactions = $root.org.dash.platform.dapi.v0.RawTransactions.toObject(message.rawTransactions, options); - if (options.oneofs) - object.responses = "rawTransactions"; - } - if (message.instantSendLockMessages != null && message.hasOwnProperty("instantSendLockMessages")) { - object.instantSendLockMessages = $root.org.dash.platform.dapi.v0.InstantSendLockMessages.toObject(message.instantSendLockMessages, options); - if (options.oneofs) - object.responses = "instantSendLockMessages"; - } - if (message.rawMerkleBlock != null && message.hasOwnProperty("rawMerkleBlock")) { - object.rawMerkleBlock = options.bytes === String ? $util.base64.encode(message.rawMerkleBlock, 0, message.rawMerkleBlock.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawMerkleBlock) : message.rawMerkleBlock; - if (options.oneofs) - object.responses = "rawMerkleBlock"; - } - return object; - }; - - /** - * Converts this TransactionsWithProofsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse - * @instance - * @returns {Object.} JSON object - */ - TransactionsWithProofsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TransactionsWithProofsResponse; - })(); - - v0.RawTransactions = (function() { - - /** - * Properties of a RawTransactions. - * @memberof org.dash.platform.dapi.v0 - * @interface IRawTransactions - * @property {Array.|null} [transactions] RawTransactions transactions - */ - - /** - * Constructs a new RawTransactions. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a RawTransactions. - * @implements IRawTransactions - * @constructor - * @param {org.dash.platform.dapi.v0.IRawTransactions=} [properties] Properties to set - */ - function RawTransactions(properties) { - this.transactions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RawTransactions transactions. - * @member {Array.} transactions - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @instance - */ - RawTransactions.prototype.transactions = $util.emptyArray; - - /** - * Creates a new RawTransactions instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @static - * @param {org.dash.platform.dapi.v0.IRawTransactions=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.RawTransactions} RawTransactions instance - */ - RawTransactions.create = function create(properties) { - return new RawTransactions(properties); - }; - - /** - * Encodes the specified RawTransactions message. Does not implicitly {@link org.dash.platform.dapi.v0.RawTransactions.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @static - * @param {org.dash.platform.dapi.v0.IRawTransactions} message RawTransactions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RawTransactions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transactions != null && message.transactions.length) - for (var i = 0; i < message.transactions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transactions[i]); - return writer; - }; - - /** - * Encodes the specified RawTransactions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.RawTransactions.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @static - * @param {org.dash.platform.dapi.v0.IRawTransactions} message RawTransactions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RawTransactions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RawTransactions message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.RawTransactions} RawTransactions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RawTransactions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.RawTransactions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.transactions && message.transactions.length)) - message.transactions = []; - message.transactions.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RawTransactions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.RawTransactions} RawTransactions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RawTransactions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RawTransactions message. - * @function verify - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RawTransactions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transactions != null && message.hasOwnProperty("transactions")) { - if (!Array.isArray(message.transactions)) - return "transactions: array expected"; - for (var i = 0; i < message.transactions.length; ++i) - if (!(message.transactions[i] && typeof message.transactions[i].length === "number" || $util.isString(message.transactions[i]))) - return "transactions: buffer[] expected"; - } - return null; - }; - - /** - * Creates a RawTransactions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.RawTransactions} RawTransactions - */ - RawTransactions.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.RawTransactions) - return object; - var message = new $root.org.dash.platform.dapi.v0.RawTransactions(); - if (object.transactions) { - if (!Array.isArray(object.transactions)) - throw TypeError(".org.dash.platform.dapi.v0.RawTransactions.transactions: array expected"); - message.transactions = []; - for (var i = 0; i < object.transactions.length; ++i) - if (typeof object.transactions[i] === "string") - $util.base64.decode(object.transactions[i], message.transactions[i] = $util.newBuffer($util.base64.length(object.transactions[i])), 0); - else if (object.transactions[i].length >= 0) - message.transactions[i] = object.transactions[i]; - } - return message; - }; - - /** - * Creates a plain object from a RawTransactions message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @static - * @param {org.dash.platform.dapi.v0.RawTransactions} message RawTransactions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RawTransactions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.transactions = []; - if (message.transactions && message.transactions.length) { - object.transactions = []; - for (var j = 0; j < message.transactions.length; ++j) - object.transactions[j] = options.bytes === String ? $util.base64.encode(message.transactions[j], 0, message.transactions[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.transactions[j]) : message.transactions[j]; - } - return object; - }; - - /** - * Converts this RawTransactions to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.RawTransactions - * @instance - * @returns {Object.} JSON object - */ - RawTransactions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RawTransactions; - })(); - - v0.InstantSendLockMessages = (function() { - - /** - * Properties of an InstantSendLockMessages. - * @memberof org.dash.platform.dapi.v0 - * @interface IInstantSendLockMessages - * @property {Array.|null} [messages] InstantSendLockMessages messages - */ - - /** - * Constructs a new InstantSendLockMessages. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents an InstantSendLockMessages. - * @implements IInstantSendLockMessages - * @constructor - * @param {org.dash.platform.dapi.v0.IInstantSendLockMessages=} [properties] Properties to set - */ - function InstantSendLockMessages(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstantSendLockMessages messages. - * @member {Array.} messages - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @instance - */ - InstantSendLockMessages.prototype.messages = $util.emptyArray; - - /** - * Creates a new InstantSendLockMessages instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @static - * @param {org.dash.platform.dapi.v0.IInstantSendLockMessages=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.InstantSendLockMessages} InstantSendLockMessages instance - */ - InstantSendLockMessages.create = function create(properties) { - return new InstantSendLockMessages(properties); - }; - - /** - * Encodes the specified InstantSendLockMessages message. Does not implicitly {@link org.dash.platform.dapi.v0.InstantSendLockMessages.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @static - * @param {org.dash.platform.dapi.v0.IInstantSendLockMessages} message InstantSendLockMessages message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstantSendLockMessages.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.messages[i]); - return writer; - }; - - /** - * Encodes the specified InstantSendLockMessages message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.InstantSendLockMessages.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @static - * @param {org.dash.platform.dapi.v0.IInstantSendLockMessages} message InstantSendLockMessages message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstantSendLockMessages.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstantSendLockMessages message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.InstantSendLockMessages} InstantSendLockMessages - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstantSendLockMessages.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.InstantSendLockMessages(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstantSendLockMessages message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.InstantSendLockMessages} InstantSendLockMessages - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstantSendLockMessages.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstantSendLockMessages message. - * @function verify - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstantSendLockMessages.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) - if (!(message.messages[i] && typeof message.messages[i].length === "number" || $util.isString(message.messages[i]))) - return "messages: buffer[] expected"; - } - return null; - }; - - /** - * Creates an InstantSendLockMessages message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.InstantSendLockMessages} InstantSendLockMessages - */ - InstantSendLockMessages.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.InstantSendLockMessages) - return object; - var message = new $root.org.dash.platform.dapi.v0.InstantSendLockMessages(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".org.dash.platform.dapi.v0.InstantSendLockMessages.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) - if (typeof object.messages[i] === "string") - $util.base64.decode(object.messages[i], message.messages[i] = $util.newBuffer($util.base64.length(object.messages[i])), 0); - else if (object.messages[i].length >= 0) - message.messages[i] = object.messages[i]; - } - return message; - }; - - /** - * Creates a plain object from an InstantSendLockMessages message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @static - * @param {org.dash.platform.dapi.v0.InstantSendLockMessages} message InstantSendLockMessages - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstantSendLockMessages.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = options.bytes === String ? $util.base64.encode(message.messages[j], 0, message.messages[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.messages[j]) : message.messages[j]; - } - return object; - }; - - /** - * Converts this InstantSendLockMessages to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages - * @instance - * @returns {Object.} JSON object - */ - InstantSendLockMessages.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InstantSendLockMessages; - })(); - - v0.MasternodeListRequest = (function() { - - /** - * Properties of a MasternodeListRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IMasternodeListRequest - */ - - /** - * Constructs a new MasternodeListRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a MasternodeListRequest. - * @implements IMasternodeListRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IMasternodeListRequest=} [properties] Properties to set - */ - function MasternodeListRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new MasternodeListRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @static - * @param {org.dash.platform.dapi.v0.IMasternodeListRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.MasternodeListRequest} MasternodeListRequest instance - */ - MasternodeListRequest.create = function create(properties) { - return new MasternodeListRequest(properties); - }; - - /** - * Encodes the specified MasternodeListRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.MasternodeListRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @static - * @param {org.dash.platform.dapi.v0.IMasternodeListRequest} message MasternodeListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MasternodeListRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MasternodeListRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.MasternodeListRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @static - * @param {org.dash.platform.dapi.v0.IMasternodeListRequest} message MasternodeListRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MasternodeListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MasternodeListRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.MasternodeListRequest} MasternodeListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MasternodeListRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.MasternodeListRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MasternodeListRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.MasternodeListRequest} MasternodeListRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MasternodeListRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MasternodeListRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MasternodeListRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MasternodeListRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.MasternodeListRequest} MasternodeListRequest - */ - MasternodeListRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.MasternodeListRequest) - return object; - return new $root.org.dash.platform.dapi.v0.MasternodeListRequest(); - }; - - /** - * Creates a plain object from a MasternodeListRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @static - * @param {org.dash.platform.dapi.v0.MasternodeListRequest} message MasternodeListRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MasternodeListRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MasternodeListRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.MasternodeListRequest - * @instance - * @returns {Object.} JSON object - */ - MasternodeListRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MasternodeListRequest; - })(); - - v0.MasternodeListResponse = (function() { - - /** - * Properties of a MasternodeListResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IMasternodeListResponse - * @property {Uint8Array|null} [masternodeListDiff] MasternodeListResponse masternodeListDiff - */ - - /** - * Constructs a new MasternodeListResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a MasternodeListResponse. - * @implements IMasternodeListResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IMasternodeListResponse=} [properties] Properties to set - */ - function MasternodeListResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MasternodeListResponse masternodeListDiff. - * @member {Uint8Array} masternodeListDiff - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @instance - */ - MasternodeListResponse.prototype.masternodeListDiff = $util.newBuffer([]); - - /** - * Creates a new MasternodeListResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @static - * @param {org.dash.platform.dapi.v0.IMasternodeListResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.MasternodeListResponse} MasternodeListResponse instance - */ - MasternodeListResponse.create = function create(properties) { - return new MasternodeListResponse(properties); - }; - - /** - * Encodes the specified MasternodeListResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.MasternodeListResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @static - * @param {org.dash.platform.dapi.v0.IMasternodeListResponse} message MasternodeListResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MasternodeListResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.masternodeListDiff != null && Object.hasOwnProperty.call(message, "masternodeListDiff")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.masternodeListDiff); - return writer; - }; - - /** - * Encodes the specified MasternodeListResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.MasternodeListResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @static - * @param {org.dash.platform.dapi.v0.IMasternodeListResponse} message MasternodeListResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MasternodeListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MasternodeListResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.MasternodeListResponse} MasternodeListResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MasternodeListResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.MasternodeListResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.masternodeListDiff = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MasternodeListResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.MasternodeListResponse} MasternodeListResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MasternodeListResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MasternodeListResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MasternodeListResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.masternodeListDiff != null && message.hasOwnProperty("masternodeListDiff")) - if (!(message.masternodeListDiff && typeof message.masternodeListDiff.length === "number" || $util.isString(message.masternodeListDiff))) - return "masternodeListDiff: buffer expected"; - return null; - }; - - /** - * Creates a MasternodeListResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.MasternodeListResponse} MasternodeListResponse - */ - MasternodeListResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.MasternodeListResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.MasternodeListResponse(); - if (object.masternodeListDiff != null) - if (typeof object.masternodeListDiff === "string") - $util.base64.decode(object.masternodeListDiff, message.masternodeListDiff = $util.newBuffer($util.base64.length(object.masternodeListDiff)), 0); - else if (object.masternodeListDiff.length >= 0) - message.masternodeListDiff = object.masternodeListDiff; - return message; - }; - - /** - * Creates a plain object from a MasternodeListResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @static - * @param {org.dash.platform.dapi.v0.MasternodeListResponse} message MasternodeListResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MasternodeListResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.masternodeListDiff = ""; - else { - object.masternodeListDiff = []; - if (options.bytes !== Array) - object.masternodeListDiff = $util.newBuffer(object.masternodeListDiff); - } - if (message.masternodeListDiff != null && message.hasOwnProperty("masternodeListDiff")) - object.masternodeListDiff = options.bytes === String ? $util.base64.encode(message.masternodeListDiff, 0, message.masternodeListDiff.length) : options.bytes === Array ? Array.prototype.slice.call(message.masternodeListDiff) : message.masternodeListDiff; - return object; - }; - - /** - * Converts this MasternodeListResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.MasternodeListResponse - * @instance - * @returns {Object.} JSON object - */ - MasternodeListResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MasternodeListResponse; - })(); - - return v0; - })(); - - return dapi; - })(); - - return platform; - })(); - - return dash; - })(); - - return org; -})(); - module.exports = $root; diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js index 78a5f777f78..dfbcb436b02 100644 --- a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js @@ -9,71310 +9,4 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut // Exported root namespace var $root = $protobuf.roots.platform_root || ($protobuf.roots.platform_root = {}); -$root.org = (function() { - - /** - * Namespace org. - * @exports org - * @namespace - */ - var org = {}; - - org.dash = (function() { - - /** - * Namespace dash. - * @memberof org - * @namespace - */ - var dash = {}; - - dash.platform = (function() { - - /** - * Namespace platform. - * @memberof org.dash - * @namespace - */ - var platform = {}; - - platform.drive = (function() { - - /** - * Namespace drive. - * @memberof org.dash.platform - * @namespace - */ - var drive = {}; - - drive.v0 = (function() { - - /** - * Namespace v0. - * @memberof org.dash.platform.drive - * @namespace - */ - var v0 = {}; - - v0.DriveInternal = (function() { - - /** - * Constructs a new DriveInternal service. - * @memberof org.dash.platform.drive.v0 - * @classdesc Represents a DriveInternal - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function DriveInternal(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (DriveInternal.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DriveInternal; - - /** - * Creates new DriveInternal service using the specified rpc implementation. - * @function create - * @memberof org.dash.platform.drive.v0.DriveInternal - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {DriveInternal} RPC service. Useful where requests and/or responses are streamed. - */ - DriveInternal.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link org.dash.platform.drive.v0.DriveInternal#getProofs}. - * @memberof org.dash.platform.drive.v0.DriveInternal - * @typedef getProofsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.drive.v0.GetProofsResponse} [response] GetProofsResponse - */ - - /** - * Calls getProofs. - * @function getProofs - * @memberof org.dash.platform.drive.v0.DriveInternal - * @instance - * @param {org.dash.platform.drive.v0.IGetProofsRequest} request GetProofsRequest message or plain object - * @param {org.dash.platform.drive.v0.DriveInternal.getProofsCallback} callback Node-style callback called with the error, if any, and GetProofsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DriveInternal.prototype.getProofs = function getProofs(request, callback) { - return this.rpcCall(getProofs, $root.org.dash.platform.drive.v0.GetProofsRequest, $root.org.dash.platform.drive.v0.GetProofsResponse, request, callback); - }, "name", { value: "getProofs" }); - - /** - * Calls getProofs. - * @function getProofs - * @memberof org.dash.platform.drive.v0.DriveInternal - * @instance - * @param {org.dash.platform.drive.v0.IGetProofsRequest} request GetProofsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DriveInternal; - })(); - - v0.GetProofsRequest = (function() { - - /** - * Properties of a GetProofsRequest. - * @memberof org.dash.platform.drive.v0 - * @interface IGetProofsRequest - * @property {Uint8Array|null} [stateTransition] GetProofsRequest stateTransition - */ - - /** - * Constructs a new GetProofsRequest. - * @memberof org.dash.platform.drive.v0 - * @classdesc Represents a GetProofsRequest. - * @implements IGetProofsRequest - * @constructor - * @param {org.dash.platform.drive.v0.IGetProofsRequest=} [properties] Properties to set - */ - function GetProofsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProofsRequest stateTransition. - * @member {Uint8Array} stateTransition - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @instance - */ - GetProofsRequest.prototype.stateTransition = $util.newBuffer([]); - - /** - * Creates a new GetProofsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @static - * @param {org.dash.platform.drive.v0.IGetProofsRequest=} [properties] Properties to set - * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest instance - */ - GetProofsRequest.create = function create(properties) { - return new GetProofsRequest(properties); - }; - - /** - * Encodes the specified GetProofsRequest message. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @static - * @param {org.dash.platform.drive.v0.IGetProofsRequest} message GetProofsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransition); - return writer; - }; - - /** - * Encodes the specified GetProofsRequest message, length delimited. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @static - * @param {org.dash.platform.drive.v0.IGetProofsRequest} message GetProofsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProofsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.drive.v0.GetProofsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.stateTransition = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProofsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProofsRequest message. - * @function verify - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProofsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) - if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) - return "stateTransition: buffer expected"; - return null; - }; - - /** - * Creates a GetProofsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest - */ - GetProofsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.drive.v0.GetProofsRequest) - return object; - var message = new $root.org.dash.platform.drive.v0.GetProofsRequest(); - if (object.stateTransition != null) - if (typeof object.stateTransition === "string") - $util.base64.decode(object.stateTransition, message.stateTransition = $util.newBuffer($util.base64.length(object.stateTransition)), 0); - else if (object.stateTransition.length >= 0) - message.stateTransition = object.stateTransition; - return message; - }; - - /** - * Creates a plain object from a GetProofsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @static - * @param {org.dash.platform.drive.v0.GetProofsRequest} message GetProofsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProofsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.stateTransition = ""; - else { - object.stateTransition = []; - if (options.bytes !== Array) - object.stateTransition = $util.newBuffer(object.stateTransition); - } - if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) - object.stateTransition = options.bytes === String ? $util.base64.encode(message.stateTransition, 0, message.stateTransition.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransition) : message.stateTransition; - return object; - }; - - /** - * Converts this GetProofsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.drive.v0.GetProofsRequest - * @instance - * @returns {Object.} JSON object - */ - GetProofsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetProofsRequest; - })(); - - v0.GetProofsResponse = (function() { - - /** - * Properties of a GetProofsResponse. - * @memberof org.dash.platform.drive.v0 - * @interface IGetProofsResponse - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProofsResponse proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProofsResponse metadata - */ - - /** - * Constructs a new GetProofsResponse. - * @memberof org.dash.platform.drive.v0 - * @classdesc Represents a GetProofsResponse. - * @implements IGetProofsResponse - * @constructor - * @param {org.dash.platform.drive.v0.IGetProofsResponse=} [properties] Properties to set - */ - function GetProofsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProofsResponse proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @instance - */ - GetProofsResponse.prototype.proof = null; - - /** - * GetProofsResponse metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @instance - */ - GetProofsResponse.prototype.metadata = null; - - /** - * Creates a new GetProofsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @static - * @param {org.dash.platform.drive.v0.IGetProofsResponse=} [properties] Properties to set - * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse instance - */ - GetProofsResponse.create = function create(properties) { - return new GetProofsResponse(properties); - }; - - /** - * Encodes the specified GetProofsResponse message. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @static - * @param {org.dash.platform.drive.v0.IGetProofsResponse} message GetProofsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProofsResponse message, length delimited. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @static - * @param {org.dash.platform.drive.v0.IGetProofsResponse} message GetProofsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProofsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProofsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.drive.v0.GetProofsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 2: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProofsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProofsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProofsResponse message. - * @function verify - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProofsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetProofsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse - */ - GetProofsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.drive.v0.GetProofsResponse) - return object; - var message = new $root.org.dash.platform.drive.v0.GetProofsResponse(); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.drive.v0.GetProofsResponse.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.drive.v0.GetProofsResponse.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetProofsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @static - * @param {org.dash.platform.drive.v0.GetProofsResponse} message GetProofsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProofsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.proof = null; - object.metadata = null; - } - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetProofsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.drive.v0.GetProofsResponse - * @instance - * @returns {Object.} JSON object - */ - GetProofsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetProofsResponse; - })(); - - return v0; - })(); - - return drive; - })(); - - platform.dapi = (function() { - - /** - * Namespace dapi. - * @memberof org.dash.platform - * @namespace - */ - var dapi = {}; - - dapi.v0 = (function() { - - /** - * Namespace v0. - * @memberof org.dash.platform.dapi - * @namespace - */ - var v0 = {}; - - v0.Platform = (function() { - - /** - * Constructs a new Platform service. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a Platform - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Platform(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Platform.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Platform; - - /** - * Creates new Platform service using the specified rpc implementation. - * @function create - * @memberof org.dash.platform.dapi.v0.Platform - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Platform} RPC service. Useful where requests and/or responses are streamed. - */ - Platform.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#broadcastStateTransition}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef broadcastStateTransitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} [response] BroadcastStateTransitionResponse - */ - - /** - * Calls broadcastStateTransition. - * @function broadcastStateTransition - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.broadcastStateTransitionCallback} callback Node-style callback called with the error, if any, and BroadcastStateTransitionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.broadcastStateTransition = function broadcastStateTransition(request, callback) { - return this.rpcCall(broadcastStateTransition, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse, request, callback); - }, "name", { value: "broadcastStateTransition" }); - - /** - * Calls broadcastStateTransition. - * @function broadcastStateTransition - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentity}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityResponse} [response] GetIdentityResponse - */ - - /** - * Calls getIdentity. - * @function getIdentity - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityCallback} callback Node-style callback called with the error, if any, and GetIdentityResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentity = function getIdentity(request, callback) { - return this.rpcCall(getIdentity, $root.org.dash.platform.dapi.v0.GetIdentityRequest, $root.org.dash.platform.dapi.v0.GetIdentityResponse, request, callback); - }, "name", { value: "getIdentity" }); - - /** - * Calls getIdentity. - * @function getIdentity - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityKeys}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityKeysCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} [response] GetIdentityKeysResponse - */ - - /** - * Calls getIdentityKeys. - * @function getIdentityKeys - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityKeysCallback} callback Node-style callback called with the error, if any, and GetIdentityKeysResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityKeys = function getIdentityKeys(request, callback) { - return this.rpcCall(getIdentityKeys, $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse, request, callback); - }, "name", { value: "getIdentityKeys" }); - - /** - * Calls getIdentityKeys. - * @function getIdentityKeys - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesContractKeys}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentitiesContractKeysCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} [response] GetIdentitiesContractKeysResponse - */ - - /** - * Calls getIdentitiesContractKeys. - * @function getIdentitiesContractKeys - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesContractKeysCallback} callback Node-style callback called with the error, if any, and GetIdentitiesContractKeysResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentitiesContractKeys = function getIdentitiesContractKeys(request, callback) { - return this.rpcCall(getIdentitiesContractKeys, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse, request, callback); - }, "name", { value: "getIdentitiesContractKeys" }); - - /** - * Calls getIdentitiesContractKeys. - * @function getIdentitiesContractKeys - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityNonce}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityNonceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} [response] GetIdentityNonceResponse - */ - - /** - * Calls getIdentityNonce. - * @function getIdentityNonce - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityNonceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityNonce = function getIdentityNonce(request, callback) { - return this.rpcCall(getIdentityNonce, $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse, request, callback); - }, "name", { value: "getIdentityNonce" }); - - /** - * Calls getIdentityNonce. - * @function getIdentityNonce - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityContractNonce}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityContractNonceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} [response] GetIdentityContractNonceResponse - */ - - /** - * Calls getIdentityContractNonce. - * @function getIdentityContractNonce - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityContractNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityContractNonceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityContractNonce = function getIdentityContractNonce(request, callback) { - return this.rpcCall(getIdentityContractNonce, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse, request, callback); - }, "name", { value: "getIdentityContractNonce" }); - - /** - * Calls getIdentityContractNonce. - * @function getIdentityContractNonce - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalance}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityBalanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} [response] GetIdentityBalanceResponse - */ - - /** - * Calls getIdentityBalance. - * @function getIdentityBalance - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityBalance = function getIdentityBalance(request, callback) { - return this.rpcCall(getIdentityBalance, $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse, request, callback); - }, "name", { value: "getIdentityBalance" }); - - /** - * Calls getIdentityBalance. - * @function getIdentityBalance - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesBalances}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentitiesBalancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} [response] GetIdentitiesBalancesResponse - */ - - /** - * Calls getIdentitiesBalances. - * @function getIdentitiesBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesBalancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentitiesBalances = function getIdentitiesBalances(request, callback) { - return this.rpcCall(getIdentitiesBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse, request, callback); - }, "name", { value: "getIdentitiesBalances" }); - - /** - * Calls getIdentitiesBalances. - * @function getIdentitiesBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalanceAndRevision}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityBalanceAndRevisionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} [response] GetIdentityBalanceAndRevisionResponse - */ - - /** - * Calls getIdentityBalanceAndRevision. - * @function getIdentityBalanceAndRevision - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceAndRevisionCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceAndRevisionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(request, callback) { - return this.rpcCall(getIdentityBalanceAndRevision, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse, request, callback); - }, "name", { value: "getIdentityBalanceAndRevision" }); - - /** - * Calls getIdentityBalanceAndRevision. - * @function getIdentityBalanceAndRevision - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByIds}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getEvonodesProposedEpochBlocksByIdsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse - */ - - /** - * Calls getEvonodesProposedEpochBlocksByIds. - * @function getEvonodesProposedEpochBlocksByIds - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByIdsCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByIds = function getEvonodesProposedEpochBlocksByIds(request, callback) { - return this.rpcCall(getEvonodesProposedEpochBlocksByIds, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); - }, "name", { value: "getEvonodesProposedEpochBlocksByIds" }); - - /** - * Calls getEvonodesProposedEpochBlocksByIds. - * @function getEvonodesProposedEpochBlocksByIds - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByRange}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getEvonodesProposedEpochBlocksByRangeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse - */ - - /** - * Calls getEvonodesProposedEpochBlocksByRange. - * @function getEvonodesProposedEpochBlocksByRange - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByRangeCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByRange = function getEvonodesProposedEpochBlocksByRange(request, callback) { - return this.rpcCall(getEvonodesProposedEpochBlocksByRange, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); - }, "name", { value: "getEvonodesProposedEpochBlocksByRange" }); - - /** - * Calls getEvonodesProposedEpochBlocksByRange. - * @function getEvonodesProposedEpochBlocksByRange - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContract}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDataContractCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDataContractResponse} [response] GetDataContractResponse - */ - - /** - * Calls getDataContract. - * @function getDataContract - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDataContractCallback} callback Node-style callback called with the error, if any, and GetDataContractResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDataContract = function getDataContract(request, callback) { - return this.rpcCall(getDataContract, $root.org.dash.platform.dapi.v0.GetDataContractRequest, $root.org.dash.platform.dapi.v0.GetDataContractResponse, request, callback); - }, "name", { value: "getDataContract" }); - - /** - * Calls getDataContract. - * @function getDataContract - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContractHistory}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDataContractHistoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} [response] GetDataContractHistoryResponse - */ - - /** - * Calls getDataContractHistory. - * @function getDataContractHistory - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDataContractHistoryCallback} callback Node-style callback called with the error, if any, and GetDataContractHistoryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDataContractHistory = function getDataContractHistory(request, callback) { - return this.rpcCall(getDataContractHistory, $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest, $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse, request, callback); - }, "name", { value: "getDataContractHistory" }); - - /** - * Calls getDataContractHistory. - * @function getDataContractHistory - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContracts}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDataContractsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} [response] GetDataContractsResponse - */ - - /** - * Calls getDataContracts. - * @function getDataContracts - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDataContractsCallback} callback Node-style callback called with the error, if any, and GetDataContractsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDataContracts = function getDataContracts(request, callback) { - return this.rpcCall(getDataContracts, $root.org.dash.platform.dapi.v0.GetDataContractsRequest, $root.org.dash.platform.dapi.v0.GetDataContractsResponse, request, callback); - }, "name", { value: "getDataContracts" }); - - /** - * Calls getDataContracts. - * @function getDataContracts - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDocuments}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} [response] GetDocumentsResponse - */ - - /** - * Calls getDocuments. - * @function getDocuments - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDocumentsCallback} callback Node-style callback called with the error, if any, and GetDocumentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDocuments = function getDocuments(request, callback) { - return this.rpcCall(getDocuments, $root.org.dash.platform.dapi.v0.GetDocumentsRequest, $root.org.dash.platform.dapi.v0.GetDocumentsResponse, request, callback); - }, "name", { value: "getDocuments" }); - - /** - * Calls getDocuments. - * @function getDocuments - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityByPublicKeyHash}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityByPublicKeyHashCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} [response] GetIdentityByPublicKeyHashResponse - */ - - /** - * Calls getIdentityByPublicKeyHash. - * @function getIdentityByPublicKeyHash - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHashCallback} callback Node-style callback called with the error, if any, and GetIdentityByPublicKeyHashResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityByPublicKeyHash = function getIdentityByPublicKeyHash(request, callback) { - return this.rpcCall(getIdentityByPublicKeyHash, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse, request, callback); - }, "name", { value: "getIdentityByPublicKeyHash" }); - - /** - * Calls getIdentityByPublicKeyHash. - * @function getIdentityByPublicKeyHash - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#waitForStateTransitionResult}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef waitForStateTransitionResultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} [response] WaitForStateTransitionResultResponse - */ - - /** - * Calls waitForStateTransitionResult. - * @function waitForStateTransitionResult - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.waitForStateTransitionResultCallback} callback Node-style callback called with the error, if any, and WaitForStateTransitionResultResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.waitForStateTransitionResult = function waitForStateTransitionResult(request, callback) { - return this.rpcCall(waitForStateTransitionResult, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, request, callback); - }, "name", { value: "waitForStateTransitionResult" }); - - /** - * Calls waitForStateTransitionResult. - * @function waitForStateTransitionResult - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getConsensusParams}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getConsensusParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} [response] GetConsensusParamsResponse - */ - - /** - * Calls getConsensusParams. - * @function getConsensusParams - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getConsensusParamsCallback} callback Node-style callback called with the error, if any, and GetConsensusParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getConsensusParams = function getConsensusParams(request, callback) { - return this.rpcCall(getConsensusParams, $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest, $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse, request, callback); - }, "name", { value: "getConsensusParams" }); - - /** - * Calls getConsensusParams. - * @function getConsensusParams - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeState}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getProtocolVersionUpgradeStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} [response] GetProtocolVersionUpgradeStateResponse - */ - - /** - * Calls getProtocolVersionUpgradeState. - * @function getProtocolVersionUpgradeState - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeStateCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeState = function getProtocolVersionUpgradeState(request, callback) { - return this.rpcCall(getProtocolVersionUpgradeState, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse, request, callback); - }, "name", { value: "getProtocolVersionUpgradeState" }); - - /** - * Calls getProtocolVersionUpgradeState. - * @function getProtocolVersionUpgradeState - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeVoteStatus}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getProtocolVersionUpgradeVoteStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} [response] GetProtocolVersionUpgradeVoteStatusResponse - */ - - /** - * Calls getProtocolVersionUpgradeVoteStatus. - * @function getProtocolVersionUpgradeVoteStatus - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeVoteStatusCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeVoteStatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeVoteStatus = function getProtocolVersionUpgradeVoteStatus(request, callback) { - return this.rpcCall(getProtocolVersionUpgradeVoteStatus, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse, request, callback); - }, "name", { value: "getProtocolVersionUpgradeVoteStatus" }); - - /** - * Calls getProtocolVersionUpgradeVoteStatus. - * @function getProtocolVersionUpgradeVoteStatus - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEpochsInfo}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getEpochsInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} [response] GetEpochsInfoResponse - */ - - /** - * Calls getEpochsInfo. - * @function getEpochsInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getEpochsInfoCallback} callback Node-style callback called with the error, if any, and GetEpochsInfoResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getEpochsInfo = function getEpochsInfo(request, callback) { - return this.rpcCall(getEpochsInfo, $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest, $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse, request, callback); - }, "name", { value: "getEpochsInfo" }); - - /** - * Calls getEpochsInfo. - * @function getEpochsInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResources}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getContestedResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} [response] GetContestedResourcesResponse - */ - - /** - * Calls getContestedResources. - * @function getContestedResources - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getContestedResourcesCallback} callback Node-style callback called with the error, if any, and GetContestedResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getContestedResources = function getContestedResources(request, callback) { - return this.rpcCall(getContestedResources, $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse, request, callback); - }, "name", { value: "getContestedResources" }); - - /** - * Calls getContestedResources. - * @function getContestedResources - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVoteState}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getContestedResourceVoteStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} [response] GetContestedResourceVoteStateResponse - */ - - /** - * Calls getContestedResourceVoteState. - * @function getContestedResourceVoteState - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVoteStateCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVoteStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getContestedResourceVoteState = function getContestedResourceVoteState(request, callback) { - return this.rpcCall(getContestedResourceVoteState, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse, request, callback); - }, "name", { value: "getContestedResourceVoteState" }); - - /** - * Calls getContestedResourceVoteState. - * @function getContestedResourceVoteState - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVotersForIdentity}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getContestedResourceVotersForIdentityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} [response] GetContestedResourceVotersForIdentityResponse - */ - - /** - * Calls getContestedResourceVotersForIdentity. - * @function getContestedResourceVotersForIdentity - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVotersForIdentityCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVotersForIdentityResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getContestedResourceVotersForIdentity = function getContestedResourceVotersForIdentity(request, callback) { - return this.rpcCall(getContestedResourceVotersForIdentity, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse, request, callback); - }, "name", { value: "getContestedResourceVotersForIdentity" }); - - /** - * Calls getContestedResourceVotersForIdentity. - * @function getContestedResourceVotersForIdentity - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceIdentityVotes}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getContestedResourceIdentityVotesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} [response] GetContestedResourceIdentityVotesResponse - */ - - /** - * Calls getContestedResourceIdentityVotes. - * @function getContestedResourceIdentityVotes - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceIdentityVotesCallback} callback Node-style callback called with the error, if any, and GetContestedResourceIdentityVotesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getContestedResourceIdentityVotes = function getContestedResourceIdentityVotes(request, callback) { - return this.rpcCall(getContestedResourceIdentityVotes, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse, request, callback); - }, "name", { value: "getContestedResourceIdentityVotes" }); - - /** - * Calls getContestedResourceIdentityVotes. - * @function getContestedResourceIdentityVotes - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getVotePollsByEndDate}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getVotePollsByEndDateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} [response] GetVotePollsByEndDateResponse - */ - - /** - * Calls getVotePollsByEndDate. - * @function getVotePollsByEndDate - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getVotePollsByEndDateCallback} callback Node-style callback called with the error, if any, and GetVotePollsByEndDateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getVotePollsByEndDate = function getVotePollsByEndDate(request, callback) { - return this.rpcCall(getVotePollsByEndDate, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse, request, callback); - }, "name", { value: "getVotePollsByEndDate" }); - - /** - * Calls getVotePollsByEndDate. - * @function getVotePollsByEndDate - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPrefundedSpecializedBalance}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getPrefundedSpecializedBalanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} [response] GetPrefundedSpecializedBalanceResponse - */ - - /** - * Calls getPrefundedSpecializedBalance. - * @function getPrefundedSpecializedBalance - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getPrefundedSpecializedBalanceCallback} callback Node-style callback called with the error, if any, and GetPrefundedSpecializedBalanceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getPrefundedSpecializedBalance = function getPrefundedSpecializedBalance(request, callback) { - return this.rpcCall(getPrefundedSpecializedBalance, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse, request, callback); - }, "name", { value: "getPrefundedSpecializedBalance" }); - - /** - * Calls getPrefundedSpecializedBalance. - * @function getPrefundedSpecializedBalance - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTotalCreditsInPlatform}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTotalCreditsInPlatformCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} [response] GetTotalCreditsInPlatformResponse - */ - - /** - * Calls getTotalCreditsInPlatform. - * @function getTotalCreditsInPlatform - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTotalCreditsInPlatformCallback} callback Node-style callback called with the error, if any, and GetTotalCreditsInPlatformResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTotalCreditsInPlatform = function getTotalCreditsInPlatform(request, callback) { - return this.rpcCall(getTotalCreditsInPlatform, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse, request, callback); - }, "name", { value: "getTotalCreditsInPlatform" }); - - /** - * Calls getTotalCreditsInPlatform. - * @function getTotalCreditsInPlatform - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPathElements}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getPathElementsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} [response] GetPathElementsResponse - */ - - /** - * Calls getPathElements. - * @function getPathElements - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getPathElementsCallback} callback Node-style callback called with the error, if any, and GetPathElementsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getPathElements = function getPathElements(request, callback) { - return this.rpcCall(getPathElements, $root.org.dash.platform.dapi.v0.GetPathElementsRequest, $root.org.dash.platform.dapi.v0.GetPathElementsResponse, request, callback); - }, "name", { value: "getPathElements" }); - - /** - * Calls getPathElements. - * @function getPathElements - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getStatus}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetStatusResponse} [response] GetStatusResponse - */ - - /** - * Calls getStatus. - * @function getStatus - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getStatusCallback} callback Node-style callback called with the error, if any, and GetStatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getStatus = function getStatus(request, callback) { - return this.rpcCall(getStatus, $root.org.dash.platform.dapi.v0.GetStatusRequest, $root.org.dash.platform.dapi.v0.GetStatusResponse, request, callback); - }, "name", { value: "getStatus" }); - - /** - * Calls getStatus. - * @function getStatus - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getCurrentQuorumsInfo}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getCurrentQuorumsInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} [response] GetCurrentQuorumsInfoResponse - */ - - /** - * Calls getCurrentQuorumsInfo. - * @function getCurrentQuorumsInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfoCallback} callback Node-style callback called with the error, if any, and GetCurrentQuorumsInfoResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(request, callback) { - return this.rpcCall(getCurrentQuorumsInfo, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse, request, callback); - }, "name", { value: "getCurrentQuorumsInfo" }); - - /** - * Calls getCurrentQuorumsInfo. - * @function getCurrentQuorumsInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenBalances}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityTokenBalancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} [response] GetIdentityTokenBalancesResponse - */ - - /** - * Calls getIdentityTokenBalances. - * @function getIdentityTokenBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenBalancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityTokenBalances = function getIdentityTokenBalances(request, callback) { - return this.rpcCall(getIdentityTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse, request, callback); - }, "name", { value: "getIdentityTokenBalances" }); - - /** - * Calls getIdentityTokenBalances. - * @function getIdentityTokenBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenBalances}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentitiesTokenBalancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} [response] GetIdentitiesTokenBalancesResponse - */ - - /** - * Calls getIdentitiesTokenBalances. - * @function getIdentitiesTokenBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenBalancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentitiesTokenBalances = function getIdentitiesTokenBalances(request, callback) { - return this.rpcCall(getIdentitiesTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse, request, callback); - }, "name", { value: "getIdentitiesTokenBalances" }); - - /** - * Calls getIdentitiesTokenBalances. - * @function getIdentitiesTokenBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenInfos}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityTokenInfosCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} [response] GetIdentityTokenInfosResponse - */ - - /** - * Calls getIdentityTokenInfos. - * @function getIdentityTokenInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenInfosResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityTokenInfos = function getIdentityTokenInfos(request, callback) { - return this.rpcCall(getIdentityTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse, request, callback); - }, "name", { value: "getIdentityTokenInfos" }); - - /** - * Calls getIdentityTokenInfos. - * @function getIdentityTokenInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenInfos}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentitiesTokenInfosCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} [response] GetIdentitiesTokenInfosResponse - */ - - /** - * Calls getIdentitiesTokenInfos. - * @function getIdentitiesTokenInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenInfosResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentitiesTokenInfos = function getIdentitiesTokenInfos(request, callback) { - return this.rpcCall(getIdentitiesTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse, request, callback); - }, "name", { value: "getIdentitiesTokenInfos" }); - - /** - * Calls getIdentitiesTokenInfos. - * @function getIdentitiesTokenInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenStatuses}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTokenStatusesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} [response] GetTokenStatusesResponse - */ - - /** - * Calls getTokenStatuses. - * @function getTokenStatuses - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTokenStatusesCallback} callback Node-style callback called with the error, if any, and GetTokenStatusesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTokenStatuses = function getTokenStatuses(request, callback) { - return this.rpcCall(getTokenStatuses, $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest, $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse, request, callback); - }, "name", { value: "getTokenStatuses" }); - - /** - * Calls getTokenStatuses. - * @function getTokenStatuses - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenDirectPurchasePrices}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTokenDirectPurchasePricesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} [response] GetTokenDirectPurchasePricesResponse - */ - - /** - * Calls getTokenDirectPurchasePrices. - * @function getTokenDirectPurchasePrices - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTokenDirectPurchasePricesCallback} callback Node-style callback called with the error, if any, and GetTokenDirectPurchasePricesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTokenDirectPurchasePrices = function getTokenDirectPurchasePrices(request, callback) { - return this.rpcCall(getTokenDirectPurchasePrices, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, request, callback); - }, "name", { value: "getTokenDirectPurchasePrices" }); - - /** - * Calls getTokenDirectPurchasePrices. - * @function getTokenDirectPurchasePrices - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenPreProgrammedDistributions}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTokenPreProgrammedDistributionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} [response] GetTokenPreProgrammedDistributionsResponse - */ - - /** - * Calls getTokenPreProgrammedDistributions. - * @function getTokenPreProgrammedDistributions - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributionsCallback} callback Node-style callback called with the error, if any, and GetTokenPreProgrammedDistributionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTokenPreProgrammedDistributions = function getTokenPreProgrammedDistributions(request, callback) { - return this.rpcCall(getTokenPreProgrammedDistributions, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse, request, callback); - }, "name", { value: "getTokenPreProgrammedDistributions" }); - - /** - * Calls getTokenPreProgrammedDistributions. - * @function getTokenPreProgrammedDistributions - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenTotalSupply}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTokenTotalSupplyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} [response] GetTokenTotalSupplyResponse - */ - - /** - * Calls getTokenTotalSupply. - * @function getTokenTotalSupply - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTokenTotalSupplyCallback} callback Node-style callback called with the error, if any, and GetTokenTotalSupplyResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTokenTotalSupply = function getTokenTotalSupply(request, callback) { - return this.rpcCall(getTokenTotalSupply, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse, request, callback); - }, "name", { value: "getTokenTotalSupply" }); - - /** - * Calls getTokenTotalSupply. - * @function getTokenTotalSupply - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfo}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getGroupInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} [response] GetGroupInfoResponse - */ - - /** - * Calls getGroupInfo. - * @function getGroupInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getGroupInfoCallback} callback Node-style callback called with the error, if any, and GetGroupInfoResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getGroupInfo = function getGroupInfo(request, callback) { - return this.rpcCall(getGroupInfo, $root.org.dash.platform.dapi.v0.GetGroupInfoRequest, $root.org.dash.platform.dapi.v0.GetGroupInfoResponse, request, callback); - }, "name", { value: "getGroupInfo" }); - - /** - * Calls getGroupInfo. - * @function getGroupInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfos}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getGroupInfosCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} [response] GetGroupInfosResponse - */ - - /** - * Calls getGroupInfos. - * @function getGroupInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getGroupInfosCallback} callback Node-style callback called with the error, if any, and GetGroupInfosResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getGroupInfos = function getGroupInfos(request, callback) { - return this.rpcCall(getGroupInfos, $root.org.dash.platform.dapi.v0.GetGroupInfosRequest, $root.org.dash.platform.dapi.v0.GetGroupInfosResponse, request, callback); - }, "name", { value: "getGroupInfos" }); - - /** - * Calls getGroupInfos. - * @function getGroupInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActions}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getGroupActionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} [response] GetGroupActionsResponse - */ - - /** - * Calls getGroupActions. - * @function getGroupActions - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getGroupActionsCallback} callback Node-style callback called with the error, if any, and GetGroupActionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getGroupActions = function getGroupActions(request, callback) { - return this.rpcCall(getGroupActions, $root.org.dash.platform.dapi.v0.GetGroupActionsRequest, $root.org.dash.platform.dapi.v0.GetGroupActionsResponse, request, callback); - }, "name", { value: "getGroupActions" }); - - /** - * Calls getGroupActions. - * @function getGroupActions - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActionSigners}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getGroupActionSignersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} [response] GetGroupActionSignersResponse - */ - - /** - * Calls getGroupActionSigners. - * @function getGroupActionSigners - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getGroupActionSignersCallback} callback Node-style callback called with the error, if any, and GetGroupActionSignersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getGroupActionSigners = function getGroupActionSigners(request, callback) { - return this.rpcCall(getGroupActionSigners, $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest, $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse, request, callback); - }, "name", { value: "getGroupActionSigners" }); - - /** - * Calls getGroupActionSigners. - * @function getGroupActionSigners - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Platform; - })(); - - v0.Proof = (function() { - - /** - * Properties of a Proof. - * @memberof org.dash.platform.dapi.v0 - * @interface IProof - * @property {Uint8Array|null} [grovedbProof] Proof grovedbProof - * @property {Uint8Array|null} [quorumHash] Proof quorumHash - * @property {Uint8Array|null} [signature] Proof signature - * @property {number|null} [round] Proof round - * @property {Uint8Array|null} [blockIdHash] Proof blockIdHash - * @property {number|null} [quorumType] Proof quorumType - */ - - /** - * Constructs a new Proof. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a Proof. - * @implements IProof - * @constructor - * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set - */ - function Proof(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proof grovedbProof. - * @member {Uint8Array} grovedbProof - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.grovedbProof = $util.newBuffer([]); - - /** - * Proof quorumHash. - * @member {Uint8Array} quorumHash - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.quorumHash = $util.newBuffer([]); - - /** - * Proof signature. - * @member {Uint8Array} signature - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.signature = $util.newBuffer([]); - - /** - * Proof round. - * @member {number} round - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.round = 0; - - /** - * Proof blockIdHash. - * @member {Uint8Array} blockIdHash - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.blockIdHash = $util.newBuffer([]); - - /** - * Proof quorumType. - * @member {number} quorumType - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.quorumType = 0; - - /** - * Creates a new Proof instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.Proof} Proof instance - */ - Proof.create = function create(properties) { - return new Proof(properties); - }; - - /** - * Encodes the specified Proof message. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.grovedbProof != null && Object.hasOwnProperty.call(message, "grovedbProof")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.grovedbProof); - if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.quorumHash); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.round); - if (message.blockIdHash != null && Object.hasOwnProperty.call(message, "blockIdHash")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.blockIdHash); - if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.quorumType); - return writer; - }; - - /** - * Encodes the specified Proof message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proof message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.Proof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.grovedbProof = reader.bytes(); - break; - case 2: - message.quorumHash = reader.bytes(); - break; - case 3: - message.signature = reader.bytes(); - break; - case 4: - message.round = reader.uint32(); - break; - case 5: - message.blockIdHash = reader.bytes(); - break; - case 6: - message.quorumType = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proof message. - * @function verify - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) - if (!(message.grovedbProof && typeof message.grovedbProof.length === "number" || $util.isString(message.grovedbProof))) - return "grovedbProof: buffer expected"; - if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) - if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) - return "quorumHash: buffer expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) - if (!(message.blockIdHash && typeof message.blockIdHash.length === "number" || $util.isString(message.blockIdHash))) - return "blockIdHash: buffer expected"; - if (message.quorumType != null && message.hasOwnProperty("quorumType")) - if (!$util.isInteger(message.quorumType)) - return "quorumType: integer expected"; - return null; - }; - - /** - * Creates a Proof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.Proof} Proof - */ - Proof.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.Proof) - return object; - var message = new $root.org.dash.platform.dapi.v0.Proof(); - if (object.grovedbProof != null) - if (typeof object.grovedbProof === "string") - $util.base64.decode(object.grovedbProof, message.grovedbProof = $util.newBuffer($util.base64.length(object.grovedbProof)), 0); - else if (object.grovedbProof.length >= 0) - message.grovedbProof = object.grovedbProof; - if (object.quorumHash != null) - if (typeof object.quorumHash === "string") - $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); - else if (object.quorumHash.length >= 0) - message.quorumHash = object.quorumHash; - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length >= 0) - message.signature = object.signature; - if (object.round != null) - message.round = object.round >>> 0; - if (object.blockIdHash != null) - if (typeof object.blockIdHash === "string") - $util.base64.decode(object.blockIdHash, message.blockIdHash = $util.newBuffer($util.base64.length(object.blockIdHash)), 0); - else if (object.blockIdHash.length >= 0) - message.blockIdHash = object.blockIdHash; - if (object.quorumType != null) - message.quorumType = object.quorumType >>> 0; - return message; - }; - - /** - * Creates a plain object from a Proof message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {org.dash.platform.dapi.v0.Proof} message Proof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.grovedbProof = ""; - else { - object.grovedbProof = []; - if (options.bytes !== Array) - object.grovedbProof = $util.newBuffer(object.grovedbProof); - } - if (options.bytes === String) - object.quorumHash = ""; - else { - object.quorumHash = []; - if (options.bytes !== Array) - object.quorumHash = $util.newBuffer(object.quorumHash); - } - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.round = 0; - if (options.bytes === String) - object.blockIdHash = ""; - else { - object.blockIdHash = []; - if (options.bytes !== Array) - object.blockIdHash = $util.newBuffer(object.blockIdHash); - } - object.quorumType = 0; - } - if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) - object.grovedbProof = options.bytes === String ? $util.base64.encode(message.grovedbProof, 0, message.grovedbProof.length) : options.bytes === Array ? Array.prototype.slice.call(message.grovedbProof) : message.grovedbProof; - if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) - object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) - object.blockIdHash = options.bytes === String ? $util.base64.encode(message.blockIdHash, 0, message.blockIdHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.blockIdHash) : message.blockIdHash; - if (message.quorumType != null && message.hasOwnProperty("quorumType")) - object.quorumType = message.quorumType; - return object; - }; - - /** - * Converts this Proof to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - * @returns {Object.} JSON object - */ - Proof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proof; - })(); - - v0.ResponseMetadata = (function() { - - /** - * Properties of a ResponseMetadata. - * @memberof org.dash.platform.dapi.v0 - * @interface IResponseMetadata - * @property {number|Long|null} [height] ResponseMetadata height - * @property {number|null} [coreChainLockedHeight] ResponseMetadata coreChainLockedHeight - * @property {number|null} [epoch] ResponseMetadata epoch - * @property {number|Long|null} [timeMs] ResponseMetadata timeMs - * @property {number|null} [protocolVersion] ResponseMetadata protocolVersion - * @property {string|null} [chainId] ResponseMetadata chainId - */ - - /** - * Constructs a new ResponseMetadata. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a ResponseMetadata. - * @implements IResponseMetadata - * @constructor - * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set - */ - function ResponseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseMetadata height. - * @member {number|Long} height - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ResponseMetadata coreChainLockedHeight. - * @member {number} coreChainLockedHeight - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.coreChainLockedHeight = 0; - - /** - * ResponseMetadata epoch. - * @member {number} epoch - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.epoch = 0; - - /** - * ResponseMetadata timeMs. - * @member {number|Long} timeMs - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.timeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ResponseMetadata protocolVersion. - * @member {number} protocolVersion - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.protocolVersion = 0; - - /** - * ResponseMetadata chainId. - * @member {string} chainId - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.chainId = ""; - - /** - * Creates a new ResponseMetadata instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata instance - */ - ResponseMetadata.create = function create(properties) { - return new ResponseMetadata(properties); - }; - - /** - * Encodes the specified ResponseMetadata message. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); - if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreChainLockedHeight); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.epoch); - if (message.timeMs != null && Object.hasOwnProperty.call(message, "timeMs")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timeMs); - if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.protocolVersion); - if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.chainId); - return writer; - }; - - /** - * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseMetadata message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.uint64(); - break; - case 2: - message.coreChainLockedHeight = reader.uint32(); - break; - case 3: - message.epoch = reader.uint32(); - break; - case 4: - message.timeMs = reader.uint64(); - break; - case 5: - message.protocolVersion = reader.uint32(); - break; - case 6: - message.chainId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseMetadata message. - * @function verify - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) - if (!$util.isInteger(message.coreChainLockedHeight)) - return "coreChainLockedHeight: integer expected"; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - if (message.timeMs != null && message.hasOwnProperty("timeMs")) - if (!$util.isInteger(message.timeMs) && !(message.timeMs && $util.isInteger(message.timeMs.low) && $util.isInteger(message.timeMs.high))) - return "timeMs: integer|Long expected"; - if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) - if (!$util.isInteger(message.protocolVersion)) - return "protocolVersion: integer expected"; - if (message.chainId != null && message.hasOwnProperty("chainId")) - if (!$util.isString(message.chainId)) - return "chainId: string expected"; - return null; - }; - - /** - * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata - */ - ResponseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.ResponseMetadata) - return object; - var message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = true; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); - if (object.coreChainLockedHeight != null) - message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; - if (object.epoch != null) - message.epoch = object.epoch >>> 0; - if (object.timeMs != null) - if ($util.Long) - (message.timeMs = $util.Long.fromValue(object.timeMs)).unsigned = true; - else if (typeof object.timeMs === "string") - message.timeMs = parseInt(object.timeMs, 10); - else if (typeof object.timeMs === "number") - message.timeMs = object.timeMs; - else if (typeof object.timeMs === "object") - message.timeMs = new $util.LongBits(object.timeMs.low >>> 0, object.timeMs.high >>> 0).toNumber(true); - if (object.protocolVersion != null) - message.protocolVersion = object.protocolVersion >>> 0; - if (object.chainId != null) - message.chainId = String(object.chainId); - return message; - }; - - /** - * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {org.dash.platform.dapi.v0.ResponseMetadata} message ResponseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.coreChainLockedHeight = 0; - object.epoch = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeMs = options.longs === String ? "0" : 0; - object.protocolVersion = 0; - object.chainId = ""; - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; - if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) - object.coreChainLockedHeight = message.coreChainLockedHeight; - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - if (message.timeMs != null && message.hasOwnProperty("timeMs")) - if (typeof message.timeMs === "number") - object.timeMs = options.longs === String ? String(message.timeMs) : message.timeMs; - else - object.timeMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeMs) : options.longs === Number ? new $util.LongBits(message.timeMs.low >>> 0, message.timeMs.high >>> 0).toNumber(true) : message.timeMs; - if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) - object.protocolVersion = message.protocolVersion; - if (message.chainId != null && message.hasOwnProperty("chainId")) - object.chainId = message.chainId; - return object; - }; - - /** - * Converts this ResponseMetadata to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - * @returns {Object.} JSON object - */ - ResponseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseMetadata; - })(); - - v0.StateTransitionBroadcastError = (function() { - - /** - * Properties of a StateTransitionBroadcastError. - * @memberof org.dash.platform.dapi.v0 - * @interface IStateTransitionBroadcastError - * @property {number|null} [code] StateTransitionBroadcastError code - * @property {string|null} [message] StateTransitionBroadcastError message - * @property {Uint8Array|null} [data] StateTransitionBroadcastError data - */ - - /** - * Constructs a new StateTransitionBroadcastError. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a StateTransitionBroadcastError. - * @implements IStateTransitionBroadcastError - * @constructor - * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set - */ - function StateTransitionBroadcastError(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StateTransitionBroadcastError code. - * @member {number} code - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @instance - */ - StateTransitionBroadcastError.prototype.code = 0; - - /** - * StateTransitionBroadcastError message. - * @member {string} message - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @instance - */ - StateTransitionBroadcastError.prototype.message = ""; - - /** - * StateTransitionBroadcastError data. - * @member {Uint8Array} data - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @instance - */ - StateTransitionBroadcastError.prototype.data = $util.newBuffer([]); - - /** - * Creates a new StateTransitionBroadcastError instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError instance - */ - StateTransitionBroadcastError.create = function create(properties) { - return new StateTransitionBroadcastError(properties); - }; - - /** - * Encodes the specified StateTransitionBroadcastError message. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateTransitionBroadcastError.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified StateTransitionBroadcastError message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateTransitionBroadcastError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StateTransitionBroadcastError message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateTransitionBroadcastError.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 2: - message.message = reader.string(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StateTransitionBroadcastError message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateTransitionBroadcastError.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StateTransitionBroadcastError message. - * @function verify - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StateTransitionBroadcastError.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a StateTransitionBroadcastError message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError - */ - StateTransitionBroadcastError.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError) - return object; - var message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); - if (object.code != null) - message.code = object.code >>> 0; - if (object.message != null) - message.message = String(object.message); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a StateTransitionBroadcastError message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {org.dash.platform.dapi.v0.StateTransitionBroadcastError} message StateTransitionBroadcastError - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StateTransitionBroadcastError.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.code = 0; - object.message = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this StateTransitionBroadcastError to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @instance - * @returns {Object.} JSON object - */ - StateTransitionBroadcastError.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StateTransitionBroadcastError; - })(); - - /** - * KeyPurpose enum. - * @name org.dash.platform.dapi.v0.KeyPurpose - * @enum {number} - * @property {number} AUTHENTICATION=0 AUTHENTICATION value - * @property {number} ENCRYPTION=1 ENCRYPTION value - * @property {number} DECRYPTION=2 DECRYPTION value - * @property {number} TRANSFER=3 TRANSFER value - * @property {number} VOTING=5 VOTING value - */ - v0.KeyPurpose = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUTHENTICATION"] = 0; - values[valuesById[1] = "ENCRYPTION"] = 1; - values[valuesById[2] = "DECRYPTION"] = 2; - values[valuesById[3] = "TRANSFER"] = 3; - values[valuesById[5] = "VOTING"] = 5; - return values; - })(); - - v0.BroadcastStateTransitionRequest = (function() { - - /** - * Properties of a BroadcastStateTransitionRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IBroadcastStateTransitionRequest - * @property {Uint8Array|null} [stateTransition] BroadcastStateTransitionRequest stateTransition - */ - - /** - * Constructs a new BroadcastStateTransitionRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BroadcastStateTransitionRequest. - * @implements IBroadcastStateTransitionRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set - */ - function BroadcastStateTransitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BroadcastStateTransitionRequest stateTransition. - * @member {Uint8Array} stateTransition - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @instance - */ - BroadcastStateTransitionRequest.prototype.stateTransition = $util.newBuffer([]); - - /** - * Creates a new BroadcastStateTransitionRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest instance - */ - BroadcastStateTransitionRequest.create = function create(properties) { - return new BroadcastStateTransitionRequest(properties); - }; - - /** - * Encodes the specified BroadcastStateTransitionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastStateTransitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransition); - return writer; - }; - - /** - * Encodes the specified BroadcastStateTransitionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastStateTransitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastStateTransitionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.stateTransition = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastStateTransitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BroadcastStateTransitionRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BroadcastStateTransitionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) - if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) - return "stateTransition: buffer expected"; - return null; - }; - - /** - * Creates a BroadcastStateTransitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest - */ - BroadcastStateTransitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); - if (object.stateTransition != null) - if (typeof object.stateTransition === "string") - $util.base64.decode(object.stateTransition, message.stateTransition = $util.newBuffer($util.base64.length(object.stateTransition)), 0); - else if (object.stateTransition.length >= 0) - message.stateTransition = object.stateTransition; - return message; - }; - - /** - * Creates a plain object from a BroadcastStateTransitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message BroadcastStateTransitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BroadcastStateTransitionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.stateTransition = ""; - else { - object.stateTransition = []; - if (options.bytes !== Array) - object.stateTransition = $util.newBuffer(object.stateTransition); - } - if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) - object.stateTransition = options.bytes === String ? $util.base64.encode(message.stateTransition, 0, message.stateTransition.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransition) : message.stateTransition; - return object; - }; - - /** - * Converts this BroadcastStateTransitionRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @instance - * @returns {Object.} JSON object - */ - BroadcastStateTransitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BroadcastStateTransitionRequest; - })(); - - v0.BroadcastStateTransitionResponse = (function() { - - /** - * Properties of a BroadcastStateTransitionResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IBroadcastStateTransitionResponse - */ - - /** - * Constructs a new BroadcastStateTransitionResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BroadcastStateTransitionResponse. - * @implements IBroadcastStateTransitionResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set - */ - function BroadcastStateTransitionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new BroadcastStateTransitionResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse instance - */ - BroadcastStateTransitionResponse.create = function create(properties) { - return new BroadcastStateTransitionResponse(properties); - }; - - /** - * Encodes the specified BroadcastStateTransitionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastStateTransitionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified BroadcastStateTransitionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastStateTransitionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastStateTransitionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastStateTransitionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BroadcastStateTransitionResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BroadcastStateTransitionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a BroadcastStateTransitionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse - */ - BroadcastStateTransitionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse) - return object; - return new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); - }; - - /** - * Creates a plain object from a BroadcastStateTransitionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message BroadcastStateTransitionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BroadcastStateTransitionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this BroadcastStateTransitionResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @instance - * @returns {Object.} JSON object - */ - BroadcastStateTransitionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BroadcastStateTransitionResponse; - })(); - - v0.GetIdentityRequest = (function() { - - /** - * Properties of a GetIdentityRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityRequest - * @property {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null} [v0] GetIdentityRequest v0 - */ - - /** - * Constructs a new GetIdentityRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityRequest. - * @implements IGetIdentityRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set - */ - function GetIdentityRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @instance - */ - GetIdentityRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @instance - */ - Object.defineProperty(GetIdentityRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest instance - */ - GetIdentityRequest.create = function create(properties) { - return new GetIdentityRequest(properties); - }; - - /** - * Encodes the specified GetIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest - */ - GetIdentityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest} message GetIdentityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityRequest.GetIdentityRequestV0 = (function() { - - /** - * Properties of a GetIdentityRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @interface IGetIdentityRequestV0 - * @property {Uint8Array|null} [id] GetIdentityRequestV0 id - * @property {boolean|null} [prove] GetIdentityRequestV0 prove - */ - - /** - * Constructs a new GetIdentityRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @classdesc Represents a GetIdentityRequestV0. - * @implements IGetIdentityRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set - */ - function GetIdentityRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @instance - */ - GetIdentityRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetIdentityRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @instance - */ - GetIdentityRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 instance - */ - GetIdentityRequestV0.create = function create(properties) { - return new GetIdentityRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 - */ - GetIdentityRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} message GetIdentityRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityRequestV0; - })(); - - return GetIdentityRequest; - })(); - - v0.GetIdentityNonceRequest = (function() { - - /** - * Properties of a GetIdentityNonceRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityNonceRequest - * @property {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null} [v0] GetIdentityNonceRequest v0 - */ - - /** - * Constructs a new GetIdentityNonceRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityNonceRequest. - * @implements IGetIdentityNonceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set - */ - function GetIdentityNonceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityNonceRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @instance - */ - GetIdentityNonceRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityNonceRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @instance - */ - Object.defineProperty(GetIdentityNonceRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityNonceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest instance - */ - GetIdentityNonceRequest.create = function create(properties) { - return new GetIdentityNonceRequest(properties); - }; - - /** - * Encodes the specified GetIdentityNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityNonceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityNonceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityNonceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityNonceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityNonceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest - */ - GetIdentityNonceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityNonceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest} message GetIdentityNonceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityNonceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityNonceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityNonceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityNonceRequest.GetIdentityNonceRequestV0 = (function() { - - /** - * Properties of a GetIdentityNonceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @interface IGetIdentityNonceRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityNonceRequestV0 identityId - * @property {boolean|null} [prove] GetIdentityNonceRequestV0 prove - */ - - /** - * Constructs a new GetIdentityNonceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @classdesc Represents a GetIdentityNonceRequestV0. - * @implements IGetIdentityNonceRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set - */ - function GetIdentityNonceRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityNonceRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @instance - */ - GetIdentityNonceRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityNonceRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @instance - */ - GetIdentityNonceRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityNonceRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 instance - */ - GetIdentityNonceRequestV0.create = function create(properties) { - return new GetIdentityNonceRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityNonceRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityNonceRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityNonceRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 - */ - GetIdentityNonceRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityNonceRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityNonceRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityNonceRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityNonceRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityNonceRequestV0; - })(); - - return GetIdentityNonceRequest; - })(); - - v0.GetIdentityContractNonceRequest = (function() { - - /** - * Properties of a GetIdentityContractNonceRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityContractNonceRequest - * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null} [v0] GetIdentityContractNonceRequest v0 - */ - - /** - * Constructs a new GetIdentityContractNonceRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityContractNonceRequest. - * @implements IGetIdentityContractNonceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set - */ - function GetIdentityContractNonceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityContractNonceRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @instance - */ - GetIdentityContractNonceRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityContractNonceRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @instance - */ - Object.defineProperty(GetIdentityContractNonceRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityContractNonceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest instance - */ - GetIdentityContractNonceRequest.create = function create(properties) { - return new GetIdentityContractNonceRequest(properties); - }; - - /** - * Encodes the specified GetIdentityContractNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityContractNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityContractNonceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityContractNonceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityContractNonceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest - */ - GetIdentityContractNonceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityContractNonceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} message GetIdentityContractNonceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityContractNonceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityContractNonceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityContractNonceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 = (function() { - - /** - * Properties of a GetIdentityContractNonceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @interface IGetIdentityContractNonceRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityContractNonceRequestV0 identityId - * @property {Uint8Array|null} [contractId] GetIdentityContractNonceRequestV0 contractId - * @property {boolean|null} [prove] GetIdentityContractNonceRequestV0 prove - */ - - /** - * Constructs a new GetIdentityContractNonceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @classdesc Represents a GetIdentityContractNonceRequestV0. - * @implements IGetIdentityContractNonceRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set - */ - function GetIdentityContractNonceRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityContractNonceRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @instance - */ - GetIdentityContractNonceRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityContractNonceRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @instance - */ - GetIdentityContractNonceRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetIdentityContractNonceRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @instance - */ - GetIdentityContractNonceRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityContractNonceRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 instance - */ - GetIdentityContractNonceRequestV0.create = function create(properties) { - return new GetIdentityContractNonceRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityContractNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityContractNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.contractId = reader.bytes(); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityContractNonceRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityContractNonceRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityContractNonceRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 - */ - GetIdentityContractNonceRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityContractNonceRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityContractNonceRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityContractNonceRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityContractNonceRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityContractNonceRequestV0; - })(); - - return GetIdentityContractNonceRequest; - })(); - - v0.GetIdentityBalanceRequest = (function() { - - /** - * Properties of a GetIdentityBalanceRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityBalanceRequest - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null} [v0] GetIdentityBalanceRequest v0 - */ - - /** - * Constructs a new GetIdentityBalanceRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityBalanceRequest. - * @implements IGetIdentityBalanceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set - */ - function GetIdentityBalanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @instance - */ - GetIdentityBalanceRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @instance - */ - Object.defineProperty(GetIdentityBalanceRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest instance - */ - GetIdentityBalanceRequest.create = function create(properties) { - return new GetIdentityBalanceRequest(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityBalanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest - */ - GetIdentityBalanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} message GetIdentityBalanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityBalanceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 = (function() { - - /** - * Properties of a GetIdentityBalanceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @interface IGetIdentityBalanceRequestV0 - * @property {Uint8Array|null} [id] GetIdentityBalanceRequestV0 id - * @property {boolean|null} [prove] GetIdentityBalanceRequestV0 prove - */ - - /** - * Constructs a new GetIdentityBalanceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @classdesc Represents a GetIdentityBalanceRequestV0. - * @implements IGetIdentityBalanceRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set - */ - function GetIdentityBalanceRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @instance - */ - GetIdentityBalanceRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetIdentityBalanceRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @instance - */ - GetIdentityBalanceRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityBalanceRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 instance - */ - GetIdentityBalanceRequestV0.create = function create(properties) { - return new GetIdentityBalanceRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 - */ - GetIdentityBalanceRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityBalanceRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityBalanceRequestV0; - })(); - - return GetIdentityBalanceRequest; - })(); - - v0.GetIdentityBalanceAndRevisionRequest = (function() { - - /** - * Properties of a GetIdentityBalanceAndRevisionRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityBalanceAndRevisionRequest - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null} [v0] GetIdentityBalanceAndRevisionRequest v0 - */ - - /** - * Constructs a new GetIdentityBalanceAndRevisionRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityBalanceAndRevisionRequest. - * @implements IGetIdentityBalanceAndRevisionRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set - */ - function GetIdentityBalanceAndRevisionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceAndRevisionRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @instance - */ - GetIdentityBalanceAndRevisionRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceAndRevisionRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @instance - */ - Object.defineProperty(GetIdentityBalanceAndRevisionRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceAndRevisionRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest instance - */ - GetIdentityBalanceAndRevisionRequest.create = function create(properties) { - return new GetIdentityBalanceAndRevisionRequest(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceAndRevisionRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceAndRevisionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityBalanceAndRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest - */ - GetIdentityBalanceAndRevisionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceAndRevisionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceAndRevisionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityBalanceAndRevisionRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceAndRevisionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 = (function() { - - /** - * Properties of a GetIdentityBalanceAndRevisionRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @interface IGetIdentityBalanceAndRevisionRequestV0 - * @property {Uint8Array|null} [id] GetIdentityBalanceAndRevisionRequestV0 id - * @property {boolean|null} [prove] GetIdentityBalanceAndRevisionRequestV0 prove - */ - - /** - * Constructs a new GetIdentityBalanceAndRevisionRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @classdesc Represents a GetIdentityBalanceAndRevisionRequestV0. - * @implements IGetIdentityBalanceAndRevisionRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set - */ - function GetIdentityBalanceAndRevisionRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceAndRevisionRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @instance - */ - GetIdentityBalanceAndRevisionRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetIdentityBalanceAndRevisionRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @instance - */ - GetIdentityBalanceAndRevisionRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityBalanceAndRevisionRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 instance - */ - GetIdentityBalanceAndRevisionRequestV0.create = function create(properties) { - return new GetIdentityBalanceAndRevisionRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceAndRevisionRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceAndRevisionRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityBalanceAndRevisionRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 - */ - GetIdentityBalanceAndRevisionRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceAndRevisionRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceAndRevisionRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityBalanceAndRevisionRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceAndRevisionRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityBalanceAndRevisionRequestV0; - })(); - - return GetIdentityBalanceAndRevisionRequest; - })(); - - v0.GetIdentityResponse = (function() { - - /** - * Properties of a GetIdentityResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityResponse - * @property {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null} [v0] GetIdentityResponse v0 - */ - - /** - * Constructs a new GetIdentityResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityResponse. - * @implements IGetIdentityResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set - */ - function GetIdentityResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @instance - */ - GetIdentityResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @instance - */ - Object.defineProperty(GetIdentityResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse instance - */ - GetIdentityResponse.create = function create(properties) { - return new GetIdentityResponse(properties); - }; - - /** - * Encodes the specified GetIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse - */ - GetIdentityResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse} message GetIdentityResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityResponse.GetIdentityResponseV0 = (function() { - - /** - * Properties of a GetIdentityResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @interface IGetIdentityResponseV0 - * @property {Uint8Array|null} [identity] GetIdentityResponseV0 identity - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @classdesc Represents a GetIdentityResponseV0. - * @implements IGetIdentityResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set - */ - function GetIdentityResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityResponseV0 identity. - * @member {Uint8Array} identity - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - */ - GetIdentityResponseV0.prototype.identity = $util.newBuffer([]); - - /** - * GetIdentityResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - */ - GetIdentityResponseV0.prototype.proof = null; - - /** - * GetIdentityResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - */ - GetIdentityResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityResponseV0 result. - * @member {"identity"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 instance - */ - GetIdentityResponseV0.create = function create(properties) { - return new GetIdentityResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identity = reader.bytes(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identity != null && message.hasOwnProperty("identity")) { - properties.result = 1; - if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) - return "identity: buffer expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 - */ - GetIdentityResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); - if (object.identity != null) - if (typeof object.identity === "string") - $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); - else if (object.identity.length >= 0) - message.identity = object.identity; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} message GetIdentityResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identity != null && message.hasOwnProperty("identity")) { - object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; - if (options.oneofs) - object.result = "identity"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityResponseV0; - })(); - - return GetIdentityResponse; - })(); - - v0.GetIdentityNonceResponse = (function() { - - /** - * Properties of a GetIdentityNonceResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityNonceResponse - * @property {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null} [v0] GetIdentityNonceResponse v0 - */ - - /** - * Constructs a new GetIdentityNonceResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityNonceResponse. - * @implements IGetIdentityNonceResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set - */ - function GetIdentityNonceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityNonceResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @instance - */ - GetIdentityNonceResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityNonceResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @instance - */ - Object.defineProperty(GetIdentityNonceResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityNonceResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse instance - */ - GetIdentityNonceResponse.create = function create(properties) { - return new GetIdentityNonceResponse(properties); - }; - - /** - * Encodes the specified GetIdentityNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityNonceResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityNonceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityNonceResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityNonceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityNonceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse - */ - GetIdentityNonceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityNonceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} message GetIdentityNonceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityNonceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityNonceResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityNonceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityNonceResponse.GetIdentityNonceResponseV0 = (function() { - - /** - * Properties of a GetIdentityNonceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @interface IGetIdentityNonceResponseV0 - * @property {number|Long|null} [identityNonce] GetIdentityNonceResponseV0 identityNonce - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityNonceResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityNonceResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityNonceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @classdesc Represents a GetIdentityNonceResponseV0. - * @implements IGetIdentityNonceResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set - */ - function GetIdentityNonceResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityNonceResponseV0 identityNonce. - * @member {number|Long} identityNonce - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - */ - GetIdentityNonceResponseV0.prototype.identityNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetIdentityNonceResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - */ - GetIdentityNonceResponseV0.prototype.proof = null; - - /** - * GetIdentityNonceResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - */ - GetIdentityNonceResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityNonceResponseV0 result. - * @member {"identityNonce"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityNonceResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identityNonce", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityNonceResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 instance - */ - GetIdentityNonceResponseV0.create = function create(properties) { - return new GetIdentityNonceResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityNonce != null && Object.hasOwnProperty.call(message, "identityNonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityNonce); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityNonce = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityNonceResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityNonceResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { - properties.result = 1; - if (!$util.isInteger(message.identityNonce) && !(message.identityNonce && $util.isInteger(message.identityNonce.low) && $util.isInteger(message.identityNonce.high))) - return "identityNonce: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityNonceResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 - */ - GetIdentityNonceResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); - if (object.identityNonce != null) - if ($util.Long) - (message.identityNonce = $util.Long.fromValue(object.identityNonce)).unsigned = true; - else if (typeof object.identityNonce === "string") - message.identityNonce = parseInt(object.identityNonce, 10); - else if (typeof object.identityNonce === "number") - message.identityNonce = object.identityNonce; - else if (typeof object.identityNonce === "object") - message.identityNonce = new $util.LongBits(object.identityNonce.low >>> 0, object.identityNonce.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityNonceResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityNonceResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { - if (typeof message.identityNonce === "number") - object.identityNonce = options.longs === String ? String(message.identityNonce) : message.identityNonce; - else - object.identityNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityNonce) : options.longs === Number ? new $util.LongBits(message.identityNonce.low >>> 0, message.identityNonce.high >>> 0).toNumber(true) : message.identityNonce; - if (options.oneofs) - object.result = "identityNonce"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityNonceResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityNonceResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityNonceResponseV0; - })(); - - return GetIdentityNonceResponse; - })(); - - v0.GetIdentityContractNonceResponse = (function() { - - /** - * Properties of a GetIdentityContractNonceResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityContractNonceResponse - * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null} [v0] GetIdentityContractNonceResponse v0 - */ - - /** - * Constructs a new GetIdentityContractNonceResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityContractNonceResponse. - * @implements IGetIdentityContractNonceResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set - */ - function GetIdentityContractNonceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityContractNonceResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @instance - */ - GetIdentityContractNonceResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityContractNonceResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @instance - */ - Object.defineProperty(GetIdentityContractNonceResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityContractNonceResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse instance - */ - GetIdentityContractNonceResponse.create = function create(properties) { - return new GetIdentityContractNonceResponse(properties); - }; - - /** - * Encodes the specified GetIdentityContractNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityContractNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityContractNonceResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityContractNonceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityContractNonceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse - */ - GetIdentityContractNonceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityContractNonceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} message GetIdentityContractNonceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityContractNonceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityContractNonceResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityContractNonceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 = (function() { - - /** - * Properties of a GetIdentityContractNonceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @interface IGetIdentityContractNonceResponseV0 - * @property {number|Long|null} [identityContractNonce] GetIdentityContractNonceResponseV0 identityContractNonce - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityContractNonceResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityContractNonceResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityContractNonceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @classdesc Represents a GetIdentityContractNonceResponseV0. - * @implements IGetIdentityContractNonceResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set - */ - function GetIdentityContractNonceResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityContractNonceResponseV0 identityContractNonce. - * @member {number|Long} identityContractNonce - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - */ - GetIdentityContractNonceResponseV0.prototype.identityContractNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetIdentityContractNonceResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - */ - GetIdentityContractNonceResponseV0.prototype.proof = null; - - /** - * GetIdentityContractNonceResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - */ - GetIdentityContractNonceResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityContractNonceResponseV0 result. - * @member {"identityContractNonce"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityContractNonceResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identityContractNonce", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityContractNonceResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 instance - */ - GetIdentityContractNonceResponseV0.create = function create(properties) { - return new GetIdentityContractNonceResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityContractNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityContractNonce != null && Object.hasOwnProperty.call(message, "identityContractNonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityContractNonce); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityContractNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityContractNonce = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityContractNonceResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityContractNonceResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { - properties.result = 1; - if (!$util.isInteger(message.identityContractNonce) && !(message.identityContractNonce && $util.isInteger(message.identityContractNonce.low) && $util.isInteger(message.identityContractNonce.high))) - return "identityContractNonce: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityContractNonceResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 - */ - GetIdentityContractNonceResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); - if (object.identityContractNonce != null) - if ($util.Long) - (message.identityContractNonce = $util.Long.fromValue(object.identityContractNonce)).unsigned = true; - else if (typeof object.identityContractNonce === "string") - message.identityContractNonce = parseInt(object.identityContractNonce, 10); - else if (typeof object.identityContractNonce === "number") - message.identityContractNonce = object.identityContractNonce; - else if (typeof object.identityContractNonce === "object") - message.identityContractNonce = new $util.LongBits(object.identityContractNonce.low >>> 0, object.identityContractNonce.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityContractNonceResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityContractNonceResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { - if (typeof message.identityContractNonce === "number") - object.identityContractNonce = options.longs === String ? String(message.identityContractNonce) : message.identityContractNonce; - else - object.identityContractNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityContractNonce) : options.longs === Number ? new $util.LongBits(message.identityContractNonce.low >>> 0, message.identityContractNonce.high >>> 0).toNumber(true) : message.identityContractNonce; - if (options.oneofs) - object.result = "identityContractNonce"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityContractNonceResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityContractNonceResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityContractNonceResponseV0; - })(); - - return GetIdentityContractNonceResponse; - })(); - - v0.GetIdentityBalanceResponse = (function() { - - /** - * Properties of a GetIdentityBalanceResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityBalanceResponse - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null} [v0] GetIdentityBalanceResponse v0 - */ - - /** - * Constructs a new GetIdentityBalanceResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityBalanceResponse. - * @implements IGetIdentityBalanceResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set - */ - function GetIdentityBalanceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @instance - */ - GetIdentityBalanceResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @instance - */ - Object.defineProperty(GetIdentityBalanceResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse instance - */ - GetIdentityBalanceResponse.create = function create(properties) { - return new GetIdentityBalanceResponse(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityBalanceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse - */ - GetIdentityBalanceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} message GetIdentityBalanceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityBalanceResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 = (function() { - - /** - * Properties of a GetIdentityBalanceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @interface IGetIdentityBalanceResponseV0 - * @property {number|Long|null} [balance] GetIdentityBalanceResponseV0 balance - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityBalanceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @classdesc Represents a GetIdentityBalanceResponseV0. - * @implements IGetIdentityBalanceResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set - */ - function GetIdentityBalanceResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceResponseV0 balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - */ - GetIdentityBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetIdentityBalanceResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - */ - GetIdentityBalanceResponseV0.prototype.proof = null; - - /** - * GetIdentityBalanceResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - */ - GetIdentityBalanceResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceResponseV0 result. - * @member {"balance"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityBalanceResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 instance - */ - GetIdentityBalanceResponseV0.create = function create(properties) { - return new GetIdentityBalanceResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balance = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.balance != null && message.hasOwnProperty("balance")) { - properties.result = 1; - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 - */ - GetIdentityBalanceResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.balance != null && message.hasOwnProperty("balance")) { - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - if (options.oneofs) - object.result = "balance"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityBalanceResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityBalanceResponseV0; - })(); - - return GetIdentityBalanceResponse; - })(); - - v0.GetIdentityBalanceAndRevisionResponse = (function() { - - /** - * Properties of a GetIdentityBalanceAndRevisionResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityBalanceAndRevisionResponse - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null} [v0] GetIdentityBalanceAndRevisionResponse v0 - */ - - /** - * Constructs a new GetIdentityBalanceAndRevisionResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityBalanceAndRevisionResponse. - * @implements IGetIdentityBalanceAndRevisionResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set - */ - function GetIdentityBalanceAndRevisionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceAndRevisionResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @instance - */ - GetIdentityBalanceAndRevisionResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceAndRevisionResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @instance - */ - Object.defineProperty(GetIdentityBalanceAndRevisionResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceAndRevisionResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse instance - */ - GetIdentityBalanceAndRevisionResponse.create = function create(properties) { - return new GetIdentityBalanceAndRevisionResponse(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceAndRevisionResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceAndRevisionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityBalanceAndRevisionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse - */ - GetIdentityBalanceAndRevisionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceAndRevisionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceAndRevisionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityBalanceAndRevisionResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceAndRevisionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 = (function() { - - /** - * Properties of a GetIdentityBalanceAndRevisionResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @interface IGetIdentityBalanceAndRevisionResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null} [balanceAndRevision] GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceAndRevisionResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceAndRevisionResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityBalanceAndRevisionResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @classdesc Represents a GetIdentityBalanceAndRevisionResponseV0. - * @implements IGetIdentityBalanceAndRevisionResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set - */ - function GetIdentityBalanceAndRevisionResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null|undefined} balanceAndRevision - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - */ - GetIdentityBalanceAndRevisionResponseV0.prototype.balanceAndRevision = null; - - /** - * GetIdentityBalanceAndRevisionResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - */ - GetIdentityBalanceAndRevisionResponseV0.prototype.proof = null; - - /** - * GetIdentityBalanceAndRevisionResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - */ - GetIdentityBalanceAndRevisionResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceAndRevisionResponseV0 result. - * @member {"balanceAndRevision"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityBalanceAndRevisionResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["balanceAndRevision", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceAndRevisionResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 instance - */ - GetIdentityBalanceAndRevisionResponseV0.create = function create(properties) { - return new GetIdentityBalanceAndRevisionResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.balanceAndRevision != null && Object.hasOwnProperty.call(message, "balanceAndRevision")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.encode(message.balanceAndRevision, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceAndRevisionResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceAndRevisionResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify(message.balanceAndRevision); - if (error) - return "balanceAndRevision." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityBalanceAndRevisionResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 - */ - GetIdentityBalanceAndRevisionResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); - if (object.balanceAndRevision != null) { - if (typeof object.balanceAndRevision !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.balanceAndRevision: object expected"); - message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.fromObject(object.balanceAndRevision); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceAndRevisionResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceAndRevisionResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { - object.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.toObject(message.balanceAndRevision, options); - if (options.oneofs) - object.result = "balanceAndRevision"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityBalanceAndRevisionResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceAndRevisionResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision = (function() { - - /** - * Properties of a BalanceAndRevision. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @interface IBalanceAndRevision - * @property {number|Long|null} [balance] BalanceAndRevision balance - * @property {number|Long|null} [revision] BalanceAndRevision revision - */ - - /** - * Constructs a new BalanceAndRevision. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @classdesc Represents a BalanceAndRevision. - * @implements IBalanceAndRevision - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set - */ - function BalanceAndRevision(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BalanceAndRevision balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @instance - */ - BalanceAndRevision.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BalanceAndRevision revision. - * @member {number|Long} revision - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @instance - */ - BalanceAndRevision.prototype.revision = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new BalanceAndRevision instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision instance - */ - BalanceAndRevision.create = function create(properties) { - return new BalanceAndRevision(properties); - }; - - /** - * Encodes the specified BalanceAndRevision message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BalanceAndRevision.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision); - return writer; - }; - - /** - * Encodes the specified BalanceAndRevision message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BalanceAndRevision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BalanceAndRevision message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BalanceAndRevision.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balance = reader.uint64(); - break; - case 2: - message.revision = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BalanceAndRevision message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BalanceAndRevision.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BalanceAndRevision message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BalanceAndRevision.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.balance != null && message.hasOwnProperty("balance")) - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isInteger(message.revision) && !(message.revision && $util.isInteger(message.revision.low) && $util.isInteger(message.revision.high))) - return "revision: integer|Long expected"; - return null; - }; - - /** - * Creates a BalanceAndRevision message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision - */ - BalanceAndRevision.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - if (object.revision != null) - if ($util.Long) - (message.revision = $util.Long.fromValue(object.revision)).unsigned = true; - else if (typeof object.revision === "string") - message.revision = parseInt(object.revision, 10); - else if (typeof object.revision === "number") - message.revision = object.revision; - else if (typeof object.revision === "object") - message.revision = new $util.LongBits(object.revision.low >>> 0, object.revision.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a BalanceAndRevision message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} message BalanceAndRevision - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BalanceAndRevision.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.balance = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision = options.longs === String ? "0" : 0; - } - if (message.balance != null && message.hasOwnProperty("balance")) - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - if (message.revision != null && message.hasOwnProperty("revision")) - if (typeof message.revision === "number") - object.revision = options.longs === String ? String(message.revision) : message.revision; - else - object.revision = options.longs === String ? $util.Long.prototype.toString.call(message.revision) : options.longs === Number ? new $util.LongBits(message.revision.low >>> 0, message.revision.high >>> 0).toNumber(true) : message.revision; - return object; - }; - - /** - * Converts this BalanceAndRevision to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @instance - * @returns {Object.} JSON object - */ - BalanceAndRevision.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BalanceAndRevision; - })(); - - return GetIdentityBalanceAndRevisionResponseV0; - })(); - - return GetIdentityBalanceAndRevisionResponse; - })(); - - v0.KeyRequestType = (function() { - - /** - * Properties of a KeyRequestType. - * @memberof org.dash.platform.dapi.v0 - * @interface IKeyRequestType - * @property {org.dash.platform.dapi.v0.IAllKeys|null} [allKeys] KeyRequestType allKeys - * @property {org.dash.platform.dapi.v0.ISpecificKeys|null} [specificKeys] KeyRequestType specificKeys - * @property {org.dash.platform.dapi.v0.ISearchKey|null} [searchKey] KeyRequestType searchKey - */ - - /** - * Constructs a new KeyRequestType. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a KeyRequestType. - * @implements IKeyRequestType - * @constructor - * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set - */ - function KeyRequestType(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeyRequestType allKeys. - * @member {org.dash.platform.dapi.v0.IAllKeys|null|undefined} allKeys - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - */ - KeyRequestType.prototype.allKeys = null; - - /** - * KeyRequestType specificKeys. - * @member {org.dash.platform.dapi.v0.ISpecificKeys|null|undefined} specificKeys - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - */ - KeyRequestType.prototype.specificKeys = null; - - /** - * KeyRequestType searchKey. - * @member {org.dash.platform.dapi.v0.ISearchKey|null|undefined} searchKey - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - */ - KeyRequestType.prototype.searchKey = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KeyRequestType request. - * @member {"allKeys"|"specificKeys"|"searchKey"|undefined} request - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - */ - Object.defineProperty(KeyRequestType.prototype, "request", { - get: $util.oneOfGetter($oneOfFields = ["allKeys", "specificKeys", "searchKey"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyRequestType instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType instance - */ - KeyRequestType.create = function create(properties) { - return new KeyRequestType(properties); - }; - - /** - * Encodes the specified KeyRequestType message. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRequestType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allKeys != null && Object.hasOwnProperty.call(message, "allKeys")) - $root.org.dash.platform.dapi.v0.AllKeys.encode(message.allKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.specificKeys != null && Object.hasOwnProperty.call(message, "specificKeys")) - $root.org.dash.platform.dapi.v0.SpecificKeys.encode(message.specificKeys, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.searchKey != null && Object.hasOwnProperty.call(message, "searchKey")) - $root.org.dash.platform.dapi.v0.SearchKey.encode(message.searchKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KeyRequestType message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRequestType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyRequestType message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRequestType.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.decode(reader, reader.uint32()); - break; - case 2: - message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.decode(reader, reader.uint32()); - break; - case 3: - message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyRequestType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRequestType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyRequestType message. - * @function verify - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyRequestType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.allKeys != null && message.hasOwnProperty("allKeys")) { - properties.request = 1; - { - var error = $root.org.dash.platform.dapi.v0.AllKeys.verify(message.allKeys); - if (error) - return "allKeys." + error; - } - } - if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { - if (properties.request === 1) - return "request: multiple values"; - properties.request = 1; - { - var error = $root.org.dash.platform.dapi.v0.SpecificKeys.verify(message.specificKeys); - if (error) - return "specificKeys." + error; - } - } - if (message.searchKey != null && message.hasOwnProperty("searchKey")) { - if (properties.request === 1) - return "request: multiple values"; - properties.request = 1; - { - var error = $root.org.dash.platform.dapi.v0.SearchKey.verify(message.searchKey); - if (error) - return "searchKey." + error; - } - } - return null; - }; - - /** - * Creates a KeyRequestType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType - */ - KeyRequestType.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.KeyRequestType) - return object; - var message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); - if (object.allKeys != null) { - if (typeof object.allKeys !== "object") - throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.allKeys: object expected"); - message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.fromObject(object.allKeys); - } - if (object.specificKeys != null) { - if (typeof object.specificKeys !== "object") - throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.specificKeys: object expected"); - message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.fromObject(object.specificKeys); - } - if (object.searchKey != null) { - if (typeof object.searchKey !== "object") - throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.searchKey: object expected"); - message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.fromObject(object.searchKey); - } - return message; - }; - - /** - * Creates a plain object from a KeyRequestType message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {org.dash.platform.dapi.v0.KeyRequestType} message KeyRequestType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyRequestType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.allKeys != null && message.hasOwnProperty("allKeys")) { - object.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.toObject(message.allKeys, options); - if (options.oneofs) - object.request = "allKeys"; - } - if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { - object.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.toObject(message.specificKeys, options); - if (options.oneofs) - object.request = "specificKeys"; - } - if (message.searchKey != null && message.hasOwnProperty("searchKey")) { - object.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.toObject(message.searchKey, options); - if (options.oneofs) - object.request = "searchKey"; - } - return object; - }; - - /** - * Converts this KeyRequestType to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - * @returns {Object.} JSON object - */ - KeyRequestType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return KeyRequestType; - })(); - - v0.AllKeys = (function() { - - /** - * Properties of an AllKeys. - * @memberof org.dash.platform.dapi.v0 - * @interface IAllKeys - */ - - /** - * Constructs a new AllKeys. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents an AllKeys. - * @implements IAllKeys - * @constructor - * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set - */ - function AllKeys(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new AllKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys instance - */ - AllKeys.create = function create(properties) { - return new AllKeys(properties); - }; - - /** - * Encodes the specified AllKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified AllKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.AllKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an AllKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys - */ - AllKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.AllKeys) - return object; - return new $root.org.dash.platform.dapi.v0.AllKeys(); - }; - - /** - * Creates a plain object from an AllKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {org.dash.platform.dapi.v0.AllKeys} message AllKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllKeys.toObject = function toObject() { - return {}; - }; - - /** - * Converts this AllKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.AllKeys - * @instance - * @returns {Object.} JSON object - */ - AllKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AllKeys; - })(); - - v0.SpecificKeys = (function() { - - /** - * Properties of a SpecificKeys. - * @memberof org.dash.platform.dapi.v0 - * @interface ISpecificKeys - * @property {Array.|null} [keyIds] SpecificKeys keyIds - */ - - /** - * Constructs a new SpecificKeys. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a SpecificKeys. - * @implements ISpecificKeys - * @constructor - * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set - */ - function SpecificKeys(properties) { - this.keyIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpecificKeys keyIds. - * @member {Array.} keyIds - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @instance - */ - SpecificKeys.prototype.keyIds = $util.emptyArray; - - /** - * Creates a new SpecificKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys instance - */ - SpecificKeys.create = function create(properties) { - return new SpecificKeys(properties); - }; - - /** - * Encodes the specified SpecificKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpecificKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyIds != null && message.keyIds.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.keyIds.length; ++i) - writer.uint32(message.keyIds[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified SpecificKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpecificKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpecificKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpecificKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.keyIds && message.keyIds.length)) - message.keyIds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.keyIds.push(reader.uint32()); - } else - message.keyIds.push(reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpecificKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpecificKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpecificKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpecificKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyIds != null && message.hasOwnProperty("keyIds")) { - if (!Array.isArray(message.keyIds)) - return "keyIds: array expected"; - for (var i = 0; i < message.keyIds.length; ++i) - if (!$util.isInteger(message.keyIds[i])) - return "keyIds: integer[] expected"; - } - return null; - }; - - /** - * Creates a SpecificKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys - */ - SpecificKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.SpecificKeys) - return object; - var message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); - if (object.keyIds) { - if (!Array.isArray(object.keyIds)) - throw TypeError(".org.dash.platform.dapi.v0.SpecificKeys.keyIds: array expected"); - message.keyIds = []; - for (var i = 0; i < object.keyIds.length; ++i) - message.keyIds[i] = object.keyIds[i] >>> 0; - } - return message; - }; - - /** - * Creates a plain object from a SpecificKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {org.dash.platform.dapi.v0.SpecificKeys} message SpecificKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpecificKeys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keyIds = []; - if (message.keyIds && message.keyIds.length) { - object.keyIds = []; - for (var j = 0; j < message.keyIds.length; ++j) - object.keyIds[j] = message.keyIds[j]; - } - return object; - }; - - /** - * Converts this SpecificKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @instance - * @returns {Object.} JSON object - */ - SpecificKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SpecificKeys; - })(); - - v0.SearchKey = (function() { - - /** - * Properties of a SearchKey. - * @memberof org.dash.platform.dapi.v0 - * @interface ISearchKey - * @property {Object.|null} [purposeMap] SearchKey purposeMap - */ - - /** - * Constructs a new SearchKey. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a SearchKey. - * @implements ISearchKey - * @constructor - * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set - */ - function SearchKey(properties) { - this.purposeMap = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchKey purposeMap. - * @member {Object.} purposeMap - * @memberof org.dash.platform.dapi.v0.SearchKey - * @instance - */ - SearchKey.prototype.purposeMap = $util.emptyObject; - - /** - * Creates a new SearchKey instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey instance - */ - SearchKey.create = function create(properties) { - return new SearchKey(properties); - }; - - /** - * Encodes the specified SearchKey message. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.purposeMap != null && Object.hasOwnProperty.call(message, "purposeMap")) - for (var keys = Object.keys(message.purposeMap), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]); - $root.org.dash.platform.dapi.v0.SecurityLevelMap.encode(message.purposeMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified SearchKey message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchKey message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SearchKey(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (message.purposeMap === $util.emptyObject) - message.purposeMap = {}; - var end2 = reader.uint32() + reader.pos; - key = 0; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.uint32(); - break; - case 2: - value = $root.org.dash.platform.dapi.v0.SecurityLevelMap.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.purposeMap[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchKey message. - * @function verify - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.purposeMap != null && message.hasOwnProperty("purposeMap")) { - if (!$util.isObject(message.purposeMap)) - return "purposeMap: object expected"; - var key = Object.keys(message.purposeMap); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "purposeMap: integer key{k:uint32} expected"; - { - var error = $root.org.dash.platform.dapi.v0.SecurityLevelMap.verify(message.purposeMap[key[i]]); - if (error) - return "purposeMap." + error; - } - } - } - return null; - }; - - /** - * Creates a SearchKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey - */ - SearchKey.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.SearchKey) - return object; - var message = new $root.org.dash.platform.dapi.v0.SearchKey(); - if (object.purposeMap) { - if (typeof object.purposeMap !== "object") - throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); - message.purposeMap = {}; - for (var keys = Object.keys(object.purposeMap), i = 0; i < keys.length; ++i) { - if (typeof object.purposeMap[keys[i]] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); - message.purposeMap[keys[i]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.fromObject(object.purposeMap[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a SearchKey message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {org.dash.platform.dapi.v0.SearchKey} message SearchKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.purposeMap = {}; - var keys2; - if (message.purposeMap && (keys2 = Object.keys(message.purposeMap)).length) { - object.purposeMap = {}; - for (var j = 0; j < keys2.length; ++j) - object.purposeMap[keys2[j]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.toObject(message.purposeMap[keys2[j]], options); - } - return object; - }; - - /** - * Converts this SearchKey to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.SearchKey - * @instance - * @returns {Object.} JSON object - */ - SearchKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchKey; - })(); - - v0.SecurityLevelMap = (function() { - - /** - * Properties of a SecurityLevelMap. - * @memberof org.dash.platform.dapi.v0 - * @interface ISecurityLevelMap - * @property {Object.|null} [securityLevelMap] SecurityLevelMap securityLevelMap - */ - - /** - * Constructs a new SecurityLevelMap. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a SecurityLevelMap. - * @implements ISecurityLevelMap - * @constructor - * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set - */ - function SecurityLevelMap(properties) { - this.securityLevelMap = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityLevelMap securityLevelMap. - * @member {Object.} securityLevelMap - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @instance - */ - SecurityLevelMap.prototype.securityLevelMap = $util.emptyObject; - - /** - * Creates a new SecurityLevelMap instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap instance - */ - SecurityLevelMap.create = function create(properties) { - return new SecurityLevelMap(properties); - }; - - /** - * Encodes the specified SecurityLevelMap message. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityLevelMap.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.securityLevelMap != null && Object.hasOwnProperty.call(message, "securityLevelMap")) - for (var keys = Object.keys(message.securityLevelMap), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.securityLevelMap[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified SecurityLevelMap message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityLevelMap.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityLevelMap message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityLevelMap.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (message.securityLevelMap === $util.emptyObject) - message.securityLevelMap = {}; - var end2 = reader.uint32() + reader.pos; - key = 0; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.uint32(); - break; - case 2: - value = reader.int32(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.securityLevelMap[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityLevelMap message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityLevelMap.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityLevelMap message. - * @function verify - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityLevelMap.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.securityLevelMap != null && message.hasOwnProperty("securityLevelMap")) { - if (!$util.isObject(message.securityLevelMap)) - return "securityLevelMap: object expected"; - var key = Object.keys(message.securityLevelMap); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "securityLevelMap: integer key{k:uint32} expected"; - switch (message.securityLevelMap[key[i]]) { - default: - return "securityLevelMap: enum value{k:uint32} expected"; - case 0: - case 1: - break; - } - } - } - return null; - }; - - /** - * Creates a SecurityLevelMap message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap - */ - SecurityLevelMap.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.SecurityLevelMap) - return object; - var message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(); - if (object.securityLevelMap) { - if (typeof object.securityLevelMap !== "object") - throw TypeError(".org.dash.platform.dapi.v0.SecurityLevelMap.securityLevelMap: object expected"); - message.securityLevelMap = {}; - for (var keys = Object.keys(object.securityLevelMap), i = 0; i < keys.length; ++i) - switch (object.securityLevelMap[keys[i]]) { - case "CURRENT_KEY_OF_KIND_REQUEST": - case 0: - message.securityLevelMap[keys[i]] = 0; - break; - case "ALL_KEYS_OF_KIND_REQUEST": - case 1: - message.securityLevelMap[keys[i]] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a SecurityLevelMap message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {org.dash.platform.dapi.v0.SecurityLevelMap} message SecurityLevelMap - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityLevelMap.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.securityLevelMap = {}; - var keys2; - if (message.securityLevelMap && (keys2 = Object.keys(message.securityLevelMap)).length) { - object.securityLevelMap = {}; - for (var j = 0; j < keys2.length; ++j) - object.securityLevelMap[keys2[j]] = options.enums === String ? $root.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType[message.securityLevelMap[keys2[j]]] : message.securityLevelMap[keys2[j]]; - } - return object; - }; - - /** - * Converts this SecurityLevelMap to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @instance - * @returns {Object.} JSON object - */ - SecurityLevelMap.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * KeyKindRequestType enum. - * @name org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType - * @enum {number} - * @property {number} CURRENT_KEY_OF_KIND_REQUEST=0 CURRENT_KEY_OF_KIND_REQUEST value - * @property {number} ALL_KEYS_OF_KIND_REQUEST=1 ALL_KEYS_OF_KIND_REQUEST value - */ - SecurityLevelMap.KeyKindRequestType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CURRENT_KEY_OF_KIND_REQUEST"] = 0; - values[valuesById[1] = "ALL_KEYS_OF_KIND_REQUEST"] = 1; - return values; - })(); - - return SecurityLevelMap; - })(); - - v0.GetIdentityKeysRequest = (function() { - - /** - * Properties of a GetIdentityKeysRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityKeysRequest - * @property {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null} [v0] GetIdentityKeysRequest v0 - */ - - /** - * Constructs a new GetIdentityKeysRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityKeysRequest. - * @implements IGetIdentityKeysRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set - */ - function GetIdentityKeysRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityKeysRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @instance - */ - GetIdentityKeysRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityKeysRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @instance - */ - Object.defineProperty(GetIdentityKeysRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityKeysRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest instance - */ - GetIdentityKeysRequest.create = function create(properties) { - return new GetIdentityKeysRequest(properties); - }; - - /** - * Encodes the specified GetIdentityKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityKeysRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityKeysRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityKeysRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityKeysRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityKeysRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest - */ - GetIdentityKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityKeysRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest} message GetIdentityKeysRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityKeysRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityKeysRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityKeysRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityKeysRequest.GetIdentityKeysRequestV0 = (function() { - - /** - * Properties of a GetIdentityKeysRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @interface IGetIdentityKeysRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityKeysRequestV0 identityId - * @property {org.dash.platform.dapi.v0.IKeyRequestType|null} [requestType] GetIdentityKeysRequestV0 requestType - * @property {google.protobuf.IUInt32Value|null} [limit] GetIdentityKeysRequestV0 limit - * @property {google.protobuf.IUInt32Value|null} [offset] GetIdentityKeysRequestV0 offset - * @property {boolean|null} [prove] GetIdentityKeysRequestV0 prove - */ - - /** - * Constructs a new GetIdentityKeysRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @classdesc Represents a GetIdentityKeysRequestV0. - * @implements IGetIdentityKeysRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set - */ - function GetIdentityKeysRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityKeysRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityKeysRequestV0 requestType. - * @member {org.dash.platform.dapi.v0.IKeyRequestType|null|undefined} requestType - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.requestType = null; - - /** - * GetIdentityKeysRequestV0 limit. - * @member {google.protobuf.IUInt32Value|null|undefined} limit - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.limit = null; - - /** - * GetIdentityKeysRequestV0 offset. - * @member {google.protobuf.IUInt32Value|null|undefined} offset - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.offset = null; - - /** - * GetIdentityKeysRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityKeysRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 instance - */ - GetIdentityKeysRequestV0.create = function create(properties) { - return new GetIdentityKeysRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.requestType != null && Object.hasOwnProperty.call(message, "requestType")) - $root.org.dash.platform.dapi.v0.KeyRequestType.encode(message.requestType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.decode(reader, reader.uint32()); - break; - case 3: - message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 4: - message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityKeysRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityKeysRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.requestType != null && message.hasOwnProperty("requestType")) { - var error = $root.org.dash.platform.dapi.v0.KeyRequestType.verify(message.requestType); - if (error) - return "requestType." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.UInt32Value.verify(message.limit); - if (error) - return "limit." + error; - } - if (message.offset != null && message.hasOwnProperty("offset")) { - var error = $root.google.protobuf.UInt32Value.verify(message.offset); - if (error) - return "offset." + error; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityKeysRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 - */ - GetIdentityKeysRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.requestType != null) { - if (typeof object.requestType !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.requestType: object expected"); - message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.fromObject(object.requestType); - } - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.limit: object expected"); - message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); - } - if (object.offset != null) { - if (typeof object.offset !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.offset: object expected"); - message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityKeysRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityKeysRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.requestType = null; - object.limit = null; - object.offset = null; - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.requestType != null && message.hasOwnProperty("requestType")) - object.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.toObject(message.requestType, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityKeysRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityKeysRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityKeysRequestV0; - })(); - - return GetIdentityKeysRequest; - })(); - - v0.GetIdentityKeysResponse = (function() { - - /** - * Properties of a GetIdentityKeysResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityKeysResponse - * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null} [v0] GetIdentityKeysResponse v0 - */ - - /** - * Constructs a new GetIdentityKeysResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityKeysResponse. - * @implements IGetIdentityKeysResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set - */ - function GetIdentityKeysResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityKeysResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @instance - */ - GetIdentityKeysResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityKeysResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @instance - */ - Object.defineProperty(GetIdentityKeysResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityKeysResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse instance - */ - GetIdentityKeysResponse.create = function create(properties) { - return new GetIdentityKeysResponse(properties); - }; - - /** - * Encodes the specified GetIdentityKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityKeysResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityKeysResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityKeysResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityKeysResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityKeysResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse - */ - GetIdentityKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityKeysResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} message GetIdentityKeysResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityKeysResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityKeysResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityKeysResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityKeysResponse.GetIdentityKeysResponseV0 = (function() { - - /** - * Properties of a GetIdentityKeysResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @interface IGetIdentityKeysResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null} [keys] GetIdentityKeysResponseV0 keys - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityKeysResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityKeysResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityKeysResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @classdesc Represents a GetIdentityKeysResponseV0. - * @implements IGetIdentityKeysResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set - */ - function GetIdentityKeysResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityKeysResponseV0 keys. - * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null|undefined} keys - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - */ - GetIdentityKeysResponseV0.prototype.keys = null; - - /** - * GetIdentityKeysResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - */ - GetIdentityKeysResponseV0.prototype.proof = null; - - /** - * GetIdentityKeysResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - */ - GetIdentityKeysResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityKeysResponseV0 result. - * @member {"keys"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityKeysResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["keys", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityKeysResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 instance - */ - GetIdentityKeysResponseV0.create = function create(properties) { - return new GetIdentityKeysResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) - $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.encode(message.keys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityKeysResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityKeysResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.keys != null && message.hasOwnProperty("keys")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify(message.keys); - if (error) - return "keys." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityKeysResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 - */ - GetIdentityKeysResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); - if (object.keys != null) { - if (typeof object.keys !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.keys: object expected"); - message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.fromObject(object.keys); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityKeysResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityKeysResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.keys != null && message.hasOwnProperty("keys")) { - object.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.toObject(message.keys, options); - if (options.oneofs) - object.result = "keys"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityKeysResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityKeysResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityKeysResponseV0.Keys = (function() { - - /** - * Properties of a Keys. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @interface IKeys - * @property {Array.|null} [keysBytes] Keys keysBytes - */ - - /** - * Constructs a new Keys. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @classdesc Represents a Keys. - * @implements IKeys - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set - */ - function Keys(properties) { - this.keysBytes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Keys keysBytes. - * @member {Array.} keysBytes - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @instance - */ - Keys.prototype.keysBytes = $util.emptyArray; - - /** - * Creates a new Keys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys instance - */ - Keys.create = function create(properties) { - return new Keys(properties); - }; - - /** - * Encodes the specified Keys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Keys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keysBytes != null && message.keysBytes.length) - for (var i = 0; i < message.keysBytes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keysBytes[i]); - return writer; - }; - - /** - * Encodes the specified Keys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Keys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Keys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Keys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.keysBytes && message.keysBytes.length)) - message.keysBytes = []; - message.keysBytes.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Keys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Keys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Keys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Keys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { - if (!Array.isArray(message.keysBytes)) - return "keysBytes: array expected"; - for (var i = 0; i < message.keysBytes.length; ++i) - if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) - return "keysBytes: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Keys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys - */ - Keys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); - if (object.keysBytes) { - if (!Array.isArray(object.keysBytes)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.keysBytes: array expected"); - message.keysBytes = []; - for (var i = 0; i < object.keysBytes.length; ++i) - if (typeof object.keysBytes[i] === "string") - $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); - else if (object.keysBytes[i].length >= 0) - message.keysBytes[i] = object.keysBytes[i]; - } - return message; - }; - - /** - * Creates a plain object from a Keys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} message Keys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Keys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keysBytes = []; - if (message.keysBytes && message.keysBytes.length) { - object.keysBytes = []; - for (var j = 0; j < message.keysBytes.length; ++j) - object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; - } - return object; - }; - - /** - * Converts this Keys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @instance - * @returns {Object.} JSON object - */ - Keys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Keys; - })(); - - return GetIdentityKeysResponseV0; - })(); - - return GetIdentityKeysResponse; - })(); - - v0.GetIdentitiesContractKeysRequest = (function() { - - /** - * Properties of a GetIdentitiesContractKeysRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesContractKeysRequest - * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null} [v0] GetIdentitiesContractKeysRequest v0 - */ - - /** - * Constructs a new GetIdentitiesContractKeysRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesContractKeysRequest. - * @implements IGetIdentitiesContractKeysRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set - */ - function GetIdentitiesContractKeysRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesContractKeysRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @instance - */ - GetIdentitiesContractKeysRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesContractKeysRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @instance - */ - Object.defineProperty(GetIdentitiesContractKeysRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesContractKeysRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest instance - */ - GetIdentitiesContractKeysRequest.create = function create(properties) { - return new GetIdentitiesContractKeysRequest(properties); - }; - - /** - * Encodes the specified GetIdentitiesContractKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesContractKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesContractKeysRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesContractKeysRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesContractKeysRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest - */ - GetIdentitiesContractKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesContractKeysRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesContractKeysRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesContractKeysRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesContractKeysRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 = (function() { - - /** - * Properties of a GetIdentitiesContractKeysRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @interface IGetIdentitiesContractKeysRequestV0 - * @property {Array.|null} [identitiesIds] GetIdentitiesContractKeysRequestV0 identitiesIds - * @property {Uint8Array|null} [contractId] GetIdentitiesContractKeysRequestV0 contractId - * @property {string|null} [documentTypeName] GetIdentitiesContractKeysRequestV0 documentTypeName - * @property {Array.|null} [purposes] GetIdentitiesContractKeysRequestV0 purposes - * @property {boolean|null} [prove] GetIdentitiesContractKeysRequestV0 prove - */ - - /** - * Constructs a new GetIdentitiesContractKeysRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @classdesc Represents a GetIdentitiesContractKeysRequestV0. - * @implements IGetIdentitiesContractKeysRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set - */ - function GetIdentitiesContractKeysRequestV0(properties) { - this.identitiesIds = []; - this.purposes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesContractKeysRequestV0 identitiesIds. - * @member {Array.} identitiesIds - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.identitiesIds = $util.emptyArray; - - /** - * GetIdentitiesContractKeysRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetIdentitiesContractKeysRequestV0 documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.documentTypeName = ""; - - /** - * GetIdentitiesContractKeysRequestV0 purposes. - * @member {Array.} purposes - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.purposes = $util.emptyArray; - - /** - * GetIdentitiesContractKeysRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentitiesContractKeysRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 instance - */ - GetIdentitiesContractKeysRequestV0.create = function create(properties) { - return new GetIdentitiesContractKeysRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesContractKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identitiesIds != null && message.identitiesIds.length) - for (var i = 0; i < message.identitiesIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identitiesIds[i]); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentTypeName); - if (message.purposes != null && message.purposes.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.purposes.length; ++i) - writer.int32(message.purposes[i]); - writer.ldelim(); - } - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesContractKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.identitiesIds && message.identitiesIds.length)) - message.identitiesIds = []; - message.identitiesIds.push(reader.bytes()); - break; - case 2: - message.contractId = reader.bytes(); - break; - case 3: - message.documentTypeName = reader.string(); - break; - case 4: - if (!(message.purposes && message.purposes.length)) - message.purposes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.purposes.push(reader.int32()); - } else - message.purposes.push(reader.int32()); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesContractKeysRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesContractKeysRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identitiesIds != null && message.hasOwnProperty("identitiesIds")) { - if (!Array.isArray(message.identitiesIds)) - return "identitiesIds: array expected"; - for (var i = 0; i < message.identitiesIds.length; ++i) - if (!(message.identitiesIds[i] && typeof message.identitiesIds[i].length === "number" || $util.isString(message.identitiesIds[i]))) - return "identitiesIds: buffer[] expected"; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.purposes != null && message.hasOwnProperty("purposes")) { - if (!Array.isArray(message.purposes)) - return "purposes: array expected"; - for (var i = 0; i < message.purposes.length; ++i) - switch (message.purposes[i]) { - default: - return "purposes: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 5: - break; - } - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentitiesContractKeysRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 - */ - GetIdentitiesContractKeysRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); - if (object.identitiesIds) { - if (!Array.isArray(object.identitiesIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.identitiesIds: array expected"); - message.identitiesIds = []; - for (var i = 0; i < object.identitiesIds.length; ++i) - if (typeof object.identitiesIds[i] === "string") - $util.base64.decode(object.identitiesIds[i], message.identitiesIds[i] = $util.newBuffer($util.base64.length(object.identitiesIds[i])), 0); - else if (object.identitiesIds[i].length >= 0) - message.identitiesIds[i] = object.identitiesIds[i]; - } - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.purposes) { - if (!Array.isArray(object.purposes)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.purposes: array expected"); - message.purposes = []; - for (var i = 0; i < object.purposes.length; ++i) - switch (object.purposes[i]) { - default: - case "AUTHENTICATION": - case 0: - message.purposes[i] = 0; - break; - case "ENCRYPTION": - case 1: - message.purposes[i] = 1; - break; - case "DECRYPTION": - case 2: - message.purposes[i] = 2; - break; - case "TRANSFER": - case 3: - message.purposes[i] = 3; - break; - case "VOTING": - case 5: - message.purposes[i] = 5; - break; - } - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesContractKeysRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesContractKeysRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.identitiesIds = []; - object.purposes = []; - } - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.prove = false; - } - if (message.identitiesIds && message.identitiesIds.length) { - object.identitiesIds = []; - for (var j = 0; j < message.identitiesIds.length; ++j) - object.identitiesIds[j] = options.bytes === String ? $util.base64.encode(message.identitiesIds[j], 0, message.identitiesIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identitiesIds[j]) : message.identitiesIds[j]; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.purposes && message.purposes.length) { - object.purposes = []; - for (var j = 0; j < message.purposes.length; ++j) - object.purposes[j] = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purposes[j]] : message.purposes[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentitiesContractKeysRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesContractKeysRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesContractKeysRequestV0; - })(); - - return GetIdentitiesContractKeysRequest; - })(); - - v0.GetIdentitiesContractKeysResponse = (function() { - - /** - * Properties of a GetIdentitiesContractKeysResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesContractKeysResponse - * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null} [v0] GetIdentitiesContractKeysResponse v0 - */ - - /** - * Constructs a new GetIdentitiesContractKeysResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesContractKeysResponse. - * @implements IGetIdentitiesContractKeysResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set - */ - function GetIdentitiesContractKeysResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesContractKeysResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @instance - */ - GetIdentitiesContractKeysResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesContractKeysResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @instance - */ - Object.defineProperty(GetIdentitiesContractKeysResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesContractKeysResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse instance - */ - GetIdentitiesContractKeysResponse.create = function create(properties) { - return new GetIdentitiesContractKeysResponse(properties); - }; - - /** - * Encodes the specified GetIdentitiesContractKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesContractKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesContractKeysResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesContractKeysResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesContractKeysResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse - */ - GetIdentitiesContractKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesContractKeysResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesContractKeysResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesContractKeysResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesContractKeysResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 = (function() { - - /** - * Properties of a GetIdentitiesContractKeysResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @interface IGetIdentitiesContractKeysResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null} [identitiesKeys] GetIdentitiesContractKeysResponseV0 identitiesKeys - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesContractKeysResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesContractKeysResponseV0 metadata - */ - - /** - * Constructs a new GetIdentitiesContractKeysResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @classdesc Represents a GetIdentitiesContractKeysResponseV0. - * @implements IGetIdentitiesContractKeysResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set - */ - function GetIdentitiesContractKeysResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesContractKeysResponseV0 identitiesKeys. - * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null|undefined} identitiesKeys - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - */ - GetIdentitiesContractKeysResponseV0.prototype.identitiesKeys = null; - - /** - * GetIdentitiesContractKeysResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - */ - GetIdentitiesContractKeysResponseV0.prototype.proof = null; - - /** - * GetIdentitiesContractKeysResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - */ - GetIdentitiesContractKeysResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesContractKeysResponseV0 result. - * @member {"identitiesKeys"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - */ - Object.defineProperty(GetIdentitiesContractKeysResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identitiesKeys", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesContractKeysResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 instance - */ - GetIdentitiesContractKeysResponseV0.create = function create(properties) { - return new GetIdentitiesContractKeysResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesContractKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identitiesKeys != null && Object.hasOwnProperty.call(message, "identitiesKeys")) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.encode(message.identitiesKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesContractKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesContractKeysResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesContractKeysResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify(message.identitiesKeys); - if (error) - return "identitiesKeys." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentitiesContractKeysResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 - */ - GetIdentitiesContractKeysResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); - if (object.identitiesKeys != null) { - if (typeof object.identitiesKeys !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.identitiesKeys: object expected"); - message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.fromObject(object.identitiesKeys); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesContractKeysResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesContractKeysResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { - object.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.toObject(message.identitiesKeys, options); - if (options.oneofs) - object.result = "identitiesKeys"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentitiesContractKeysResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesContractKeysResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesContractKeysResponseV0.PurposeKeys = (function() { - - /** - * Properties of a PurposeKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @interface IPurposeKeys - * @property {org.dash.platform.dapi.v0.KeyPurpose|null} [purpose] PurposeKeys purpose - * @property {Array.|null} [keysBytes] PurposeKeys keysBytes - */ - - /** - * Constructs a new PurposeKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @classdesc Represents a PurposeKeys. - * @implements IPurposeKeys - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set - */ - function PurposeKeys(properties) { - this.keysBytes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PurposeKeys purpose. - * @member {org.dash.platform.dapi.v0.KeyPurpose} purpose - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @instance - */ - PurposeKeys.prototype.purpose = 0; - - /** - * PurposeKeys keysBytes. - * @member {Array.} keysBytes - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @instance - */ - PurposeKeys.prototype.keysBytes = $util.emptyArray; - - /** - * Creates a new PurposeKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys instance - */ - PurposeKeys.create = function create(properties) { - return new PurposeKeys(properties); - }; - - /** - * Encodes the specified PurposeKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurposeKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.purpose != null && Object.hasOwnProperty.call(message, "purpose")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.purpose); - if (message.keysBytes != null && message.keysBytes.length) - for (var i = 0; i < message.keysBytes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keysBytes[i]); - return writer; - }; - - /** - * Encodes the specified PurposeKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurposeKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PurposeKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurposeKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.purpose = reader.int32(); - break; - case 2: - if (!(message.keysBytes && message.keysBytes.length)) - message.keysBytes = []; - message.keysBytes.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PurposeKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurposeKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PurposeKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PurposeKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.purpose != null && message.hasOwnProperty("purpose")) - switch (message.purpose) { - default: - return "purpose: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 5: - break; - } - if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { - if (!Array.isArray(message.keysBytes)) - return "keysBytes: array expected"; - for (var i = 0; i < message.keysBytes.length; ++i) - if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) - return "keysBytes: buffer[] expected"; - } - return null; - }; - - /** - * Creates a PurposeKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys - */ - PurposeKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); - switch (object.purpose) { - case "AUTHENTICATION": - case 0: - message.purpose = 0; - break; - case "ENCRYPTION": - case 1: - message.purpose = 1; - break; - case "DECRYPTION": - case 2: - message.purpose = 2; - break; - case "TRANSFER": - case 3: - message.purpose = 3; - break; - case "VOTING": - case 5: - message.purpose = 5; - break; - } - if (object.keysBytes) { - if (!Array.isArray(object.keysBytes)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.keysBytes: array expected"); - message.keysBytes = []; - for (var i = 0; i < object.keysBytes.length; ++i) - if (typeof object.keysBytes[i] === "string") - $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); - else if (object.keysBytes[i].length >= 0) - message.keysBytes[i] = object.keysBytes[i]; - } - return message; - }; - - /** - * Creates a plain object from a PurposeKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} message PurposeKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PurposeKeys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keysBytes = []; - if (options.defaults) - object.purpose = options.enums === String ? "AUTHENTICATION" : 0; - if (message.purpose != null && message.hasOwnProperty("purpose")) - object.purpose = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purpose] : message.purpose; - if (message.keysBytes && message.keysBytes.length) { - object.keysBytes = []; - for (var j = 0; j < message.keysBytes.length; ++j) - object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; - } - return object; - }; - - /** - * Converts this PurposeKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @instance - * @returns {Object.} JSON object - */ - PurposeKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PurposeKeys; - })(); - - GetIdentitiesContractKeysResponseV0.IdentityKeys = (function() { - - /** - * Properties of an IdentityKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @interface IIdentityKeys - * @property {Uint8Array|null} [identityId] IdentityKeys identityId - * @property {Array.|null} [keys] IdentityKeys keys - */ - - /** - * Constructs a new IdentityKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @classdesc Represents an IdentityKeys. - * @implements IIdentityKeys - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set - */ - function IdentityKeys(properties) { - this.keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityKeys identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @instance - */ - IdentityKeys.prototype.identityId = $util.newBuffer([]); - - /** - * IdentityKeys keys. - * @member {Array.} keys - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @instance - */ - IdentityKeys.prototype.keys = $util.emptyArray; - - /** - * Creates a new IdentityKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys instance - */ - IdentityKeys.create = function create(properties) { - return new IdentityKeys(properties); - }; - - /** - * Encodes the specified IdentityKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.encode(message.keys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentityKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - return null; - }; - - /** - * Creates an IdentityKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys - */ - IdentityKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: object expected"); - message.keys[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.fromObject(object.keys[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentityKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} message IdentityKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityKeys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.toObject(message.keys[j], options); - } - return object; - }; - - /** - * Converts this IdentityKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @instance - * @returns {Object.} JSON object - */ - IdentityKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityKeys; - })(); - - GetIdentitiesContractKeysResponseV0.IdentitiesKeys = (function() { - - /** - * Properties of an IdentitiesKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @interface IIdentitiesKeys - * @property {Array.|null} [entries] IdentitiesKeys entries - */ - - /** - * Constructs a new IdentitiesKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @classdesc Represents an IdentitiesKeys. - * @implements IIdentitiesKeys - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set - */ - function IdentitiesKeys(properties) { - this.entries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentitiesKeys entries. - * @member {Array.} entries - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @instance - */ - IdentitiesKeys.prototype.entries = $util.emptyArray; - - /** - * Creates a new IdentitiesKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys instance - */ - IdentitiesKeys.create = function create(properties) { - return new IdentitiesKeys(properties); - }; - - /** - * Encodes the specified IdentitiesKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitiesKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (var i = 0; i < message.entries.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentitiesKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitiesKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentitiesKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitiesKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentitiesKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitiesKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentitiesKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentitiesKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (var i = 0; i < message.entries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify(message.entries[i]); - if (error) - return "entries." + error; - } - } - return null; - }; - - /** - * Creates an IdentitiesKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys - */ - IdentitiesKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: array expected"); - message.entries = []; - for (var i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: object expected"); - message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.fromObject(object.entries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentitiesKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} message IdentitiesKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentitiesKeys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entries = []; - if (message.entries && message.entries.length) { - object.entries = []; - for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.toObject(message.entries[j], options); - } - return object; - }; - - /** - * Converts this IdentitiesKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @instance - * @returns {Object.} JSON object - */ - IdentitiesKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentitiesKeys; - })(); - - return GetIdentitiesContractKeysResponseV0; - })(); - - return GetIdentitiesContractKeysResponse; - })(); - - v0.GetEvonodesProposedEpochBlocksByIdsRequest = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksByIdsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEvonodesProposedEpochBlocksByIdsRequest - * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByIdsRequest v0 - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequest. - * @implements IGetEvonodesProposedEpochBlocksByIdsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksByIdsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksByIdsRequest v0. - * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @instance - */ - GetEvonodesProposedEpochBlocksByIdsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksByIdsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksByIdsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksByIdsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest instance - */ - GetEvonodesProposedEpochBlocksByIdsRequest.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksByIdsRequest(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByIdsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByIdsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByIdsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksByIdsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksByIdsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksByIdsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest - */ - GetEvonodesProposedEpochBlocksByIdsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksByIdsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksByIdsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksByIdsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksByIdsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @interface IGetEvonodesProposedEpochBlocksByIdsRequestV0 - * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch - * @property {Array.|null} [ids] GetEvonodesProposedEpochBlocksByIdsRequestV0 ids - * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByIdsRequestV0 prove - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequestV0. - * @implements IGetEvonodesProposedEpochBlocksByIdsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksByIdsRequestV0(properties) { - this.ids = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch. - * @member {number} epoch - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.epoch = 0; - - /** - * GetEvonodesProposedEpochBlocksByIdsRequestV0 ids. - * @member {Array.} ids - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.ids = $util.emptyArray; - - /** - * GetEvonodesProposedEpochBlocksByIdsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.prove = false; - - /** - * Creates a new GetEvonodesProposedEpochBlocksByIdsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 instance - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksByIdsRequestV0(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); - if (message.ids != null && message.ids.length) - for (var i = 0; i < message.ids.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ids[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.epoch = reader.uint32(); - break; - case 2: - if (!(message.ids && message.ids.length)) - message.ids = []; - message.ids.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - if (message.ids != null && message.hasOwnProperty("ids")) { - if (!Array.isArray(message.ids)) - return "ids: array expected"; - for (var i = 0; i < message.ids.length; ++i) - if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) - return "ids: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); - if (object.epoch != null) - message.epoch = object.epoch >>> 0; - if (object.ids) { - if (!Array.isArray(object.ids)) - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.ids: array expected"); - message.ids = []; - for (var i = 0; i < object.ids.length; ++i) - if (typeof object.ids[i] === "string") - $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); - else if (object.ids[i].length >= 0) - message.ids[i] = object.ids[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ids = []; - if (options.defaults) { - object.epoch = 0; - object.prove = false; - } - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - if (message.ids && message.ids.length) { - object.ids = []; - for (var j = 0; j < message.ids.length; ++j) - object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksByIdsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetEvonodesProposedEpochBlocksByIdsRequestV0; - })(); - - return GetEvonodesProposedEpochBlocksByIdsRequest; - })(); - - v0.GetEvonodesProposedEpochBlocksResponse = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEvonodesProposedEpochBlocksResponse - * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null} [v0] GetEvonodesProposedEpochBlocksResponse v0 - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEvonodesProposedEpochBlocksResponse. - * @implements IGetEvonodesProposedEpochBlocksResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksResponse v0. - * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @instance - */ - GetEvonodesProposedEpochBlocksResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse instance - */ - GetEvonodesProposedEpochBlocksResponse.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksResponse(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse - */ - GetEvonodesProposedEpochBlocksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksResponseV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @interface IGetEvonodesProposedEpochBlocksResponseV0 - * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null} [evonodesProposedBlockCountsInfo] GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEvonodesProposedEpochBlocksResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEvonodesProposedEpochBlocksResponseV0 metadata - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksResponseV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @classdesc Represents a GetEvonodesProposedEpochBlocksResponseV0. - * @implements IGetEvonodesProposedEpochBlocksResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo. - * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null|undefined} evonodesProposedBlockCountsInfo - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - */ - GetEvonodesProposedEpochBlocksResponseV0.prototype.evonodesProposedBlockCountsInfo = null; - - /** - * GetEvonodesProposedEpochBlocksResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - */ - GetEvonodesProposedEpochBlocksResponseV0.prototype.proof = null; - - /** - * GetEvonodesProposedEpochBlocksResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - */ - GetEvonodesProposedEpochBlocksResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksResponseV0 result. - * @member {"evonodesProposedBlockCountsInfo"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["evonodesProposedBlockCountsInfo", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 instance - */ - GetEvonodesProposedEpochBlocksResponseV0.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksResponseV0(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evonodesProposedBlockCountsInfo != null && Object.hasOwnProperty.call(message, "evonodesProposedBlockCountsInfo")) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.encode(message.evonodesProposedBlockCountsInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify(message.evonodesProposedBlockCountsInfo); - if (error) - return "evonodesProposedBlockCountsInfo." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 - */ - GetEvonodesProposedEpochBlocksResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); - if (object.evonodesProposedBlockCountsInfo != null) { - if (typeof object.evonodesProposedBlockCountsInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.evonodesProposedBlockCountsInfo: object expected"); - message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.fromObject(object.evonodesProposedBlockCountsInfo); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { - object.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.toObject(message.evonodesProposedBlockCountsInfo, options); - if (options.oneofs) - object.result = "evonodesProposedBlockCountsInfo"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks = (function() { - - /** - * Properties of an EvonodeProposedBlocks. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @interface IEvonodeProposedBlocks - * @property {Uint8Array|null} [proTxHash] EvonodeProposedBlocks proTxHash - * @property {number|Long|null} [count] EvonodeProposedBlocks count - */ - - /** - * Constructs a new EvonodeProposedBlocks. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @classdesc Represents an EvonodeProposedBlocks. - * @implements IEvonodeProposedBlocks - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set - */ - function EvonodeProposedBlocks(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvonodeProposedBlocks proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @instance - */ - EvonodeProposedBlocks.prototype.proTxHash = $util.newBuffer([]); - - /** - * EvonodeProposedBlocks count. - * @member {number|Long} count - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @instance - */ - EvonodeProposedBlocks.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new EvonodeProposedBlocks instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks instance - */ - EvonodeProposedBlocks.create = function create(properties) { - return new EvonodeProposedBlocks(properties); - }; - - /** - * Encodes the specified EvonodeProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvonodeProposedBlocks.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.count); - return writer; - }; - - /** - * Encodes the specified EvonodeProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvonodeProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvonodeProposedBlocks message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvonodeProposedBlocks.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proTxHash = reader.bytes(); - break; - case 2: - message.count = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvonodeProposedBlocks message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvonodeProposedBlocks.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvonodeProposedBlocks message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvonodeProposedBlocks.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; - - /** - * Creates an EvonodeProposedBlocks message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks - */ - EvonodeProposedBlocks.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = true; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an EvonodeProposedBlocks message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} message EvonodeProposedBlocks - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvonodeProposedBlocks.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - } - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber(true) : message.count; - return object; - }; - - /** - * Converts this EvonodeProposedBlocks to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @instance - * @returns {Object.} JSON object - */ - EvonodeProposedBlocks.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EvonodeProposedBlocks; - })(); - - GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks = (function() { - - /** - * Properties of an EvonodesProposedBlocks. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @interface IEvonodesProposedBlocks - * @property {Array.|null} [evonodesProposedBlockCounts] EvonodesProposedBlocks evonodesProposedBlockCounts - */ - - /** - * Constructs a new EvonodesProposedBlocks. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @classdesc Represents an EvonodesProposedBlocks. - * @implements IEvonodesProposedBlocks - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set - */ - function EvonodesProposedBlocks(properties) { - this.evonodesProposedBlockCounts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvonodesProposedBlocks evonodesProposedBlockCounts. - * @member {Array.} evonodesProposedBlockCounts - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @instance - */ - EvonodesProposedBlocks.prototype.evonodesProposedBlockCounts = $util.emptyArray; - - /** - * Creates a new EvonodesProposedBlocks instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks instance - */ - EvonodesProposedBlocks.create = function create(properties) { - return new EvonodesProposedBlocks(properties); - }; - - /** - * Encodes the specified EvonodesProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvonodesProposedBlocks.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evonodesProposedBlockCounts != null && message.evonodesProposedBlockCounts.length) - for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.encode(message.evonodesProposedBlockCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvonodesProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvonodesProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvonodesProposedBlocks message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvonodesProposedBlocks.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length)) - message.evonodesProposedBlockCounts = []; - message.evonodesProposedBlockCounts.push($root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvonodesProposedBlocks message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvonodesProposedBlocks.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvonodesProposedBlocks message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvonodesProposedBlocks.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evonodesProposedBlockCounts != null && message.hasOwnProperty("evonodesProposedBlockCounts")) { - if (!Array.isArray(message.evonodesProposedBlockCounts)) - return "evonodesProposedBlockCounts: array expected"; - for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify(message.evonodesProposedBlockCounts[i]); - if (error) - return "evonodesProposedBlockCounts." + error; - } - } - return null; - }; - - /** - * Creates an EvonodesProposedBlocks message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks - */ - EvonodesProposedBlocks.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); - if (object.evonodesProposedBlockCounts) { - if (!Array.isArray(object.evonodesProposedBlockCounts)) - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: array expected"); - message.evonodesProposedBlockCounts = []; - for (var i = 0; i < object.evonodesProposedBlockCounts.length; ++i) { - if (typeof object.evonodesProposedBlockCounts[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: object expected"); - message.evonodesProposedBlockCounts[i] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.fromObject(object.evonodesProposedBlockCounts[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EvonodesProposedBlocks message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} message EvonodesProposedBlocks - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvonodesProposedBlocks.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evonodesProposedBlockCounts = []; - if (message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length) { - object.evonodesProposedBlockCounts = []; - for (var j = 0; j < message.evonodesProposedBlockCounts.length; ++j) - object.evonodesProposedBlockCounts[j] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.toObject(message.evonodesProposedBlockCounts[j], options); - } - return object; - }; - - /** - * Converts this EvonodesProposedBlocks to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @instance - * @returns {Object.} JSON object - */ - EvonodesProposedBlocks.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EvonodesProposedBlocks; - })(); - - return GetEvonodesProposedEpochBlocksResponseV0; - })(); - - return GetEvonodesProposedEpochBlocksResponse; - })(); - - v0.GetEvonodesProposedEpochBlocksByRangeRequest = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksByRangeRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEvonodesProposedEpochBlocksByRangeRequest - * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByRangeRequest v0 - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequest. - * @implements IGetEvonodesProposedEpochBlocksByRangeRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksByRangeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksByRangeRequest v0. - * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksByRangeRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksByRangeRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest instance - */ - GetEvonodesProposedEpochBlocksByRangeRequest.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksByRangeRequest(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByRangeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByRangeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByRangeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksByRangeRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksByRangeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksByRangeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest - */ - GetEvonodesProposedEpochBlocksByRangeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksByRangeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksByRangeRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksByRangeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksByRangeRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @interface IGetEvonodesProposedEpochBlocksByRangeRequestV0 - * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch - * @property {number|null} [limit] GetEvonodesProposedEpochBlocksByRangeRequestV0 limit - * @property {Uint8Array|null} [startAfter] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter - * @property {Uint8Array|null} [startAt] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt - * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByRangeRequestV0 prove - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequestV0. - * @implements IGetEvonodesProposedEpochBlocksByRangeRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksByRangeRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch. - * @member {number} epoch - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.epoch = 0; - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.limit = 0; - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter. - * @member {Uint8Array} startAfter - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAfter = $util.newBuffer([]); - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt. - * @member {Uint8Array} startAt - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAt = $util.newBuffer([]); - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.prove = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 start. - * @member {"startAfter"|"startAt"|undefined} start - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype, "start", { - get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksByRangeRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksByRangeRequestV0(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.limit); - if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.startAfter); - if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startAt); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.epoch = reader.uint32(); - break; - case 2: - message.limit = reader.uint32(); - break; - case 3: - message.startAfter = reader.bytes(); - break; - case 4: - message.startAt = reader.bytes(); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - properties.start = 1; - if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) - return "startAfter: buffer expected"; - } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - if (properties.start === 1) - return "start: multiple values"; - properties.start = 1; - if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) - return "startAt: buffer expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); - if (object.epoch != null) - message.epoch = object.epoch >>> 0; - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.startAfter != null) - if (typeof object.startAfter === "string") - $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); - else if (object.startAfter.length >= 0) - message.startAfter = object.startAfter; - if (object.startAt != null) - if (typeof object.startAt === "string") - $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); - else if (object.startAt.length >= 0) - message.startAt = object.startAt; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.epoch = 0; - object.limit = 0; - object.prove = false; - } - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; - if (options.oneofs) - object.start = "startAfter"; - } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; - if (options.oneofs) - object.start = "startAt"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksByRangeRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetEvonodesProposedEpochBlocksByRangeRequestV0; - })(); - - return GetEvonodesProposedEpochBlocksByRangeRequest; - })(); - - v0.GetIdentitiesBalancesRequest = (function() { - - /** - * Properties of a GetIdentitiesBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesBalancesRequest - * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null} [v0] GetIdentitiesBalancesRequest v0 - */ - - /** - * Constructs a new GetIdentitiesBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesBalancesRequest. - * @implements IGetIdentitiesBalancesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set - */ - function GetIdentitiesBalancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @instance - */ - GetIdentitiesBalancesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesBalancesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @instance - */ - Object.defineProperty(GetIdentitiesBalancesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesBalancesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest instance - */ - GetIdentitiesBalancesRequest.create = function create(properties) { - return new GetIdentitiesBalancesRequest(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesBalancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest - */ - GetIdentitiesBalancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesBalancesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 = (function() { - - /** - * Properties of a GetIdentitiesBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @interface IGetIdentitiesBalancesRequestV0 - * @property {Array.|null} [ids] GetIdentitiesBalancesRequestV0 ids - * @property {boolean|null} [prove] GetIdentitiesBalancesRequestV0 prove - */ - - /** - * Constructs a new GetIdentitiesBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @classdesc Represents a GetIdentitiesBalancesRequestV0. - * @implements IGetIdentitiesBalancesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set - */ - function GetIdentitiesBalancesRequestV0(properties) { - this.ids = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesRequestV0 ids. - * @member {Array.} ids - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @instance - */ - GetIdentitiesBalancesRequestV0.prototype.ids = $util.emptyArray; - - /** - * GetIdentitiesBalancesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @instance - */ - GetIdentitiesBalancesRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentitiesBalancesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 instance - */ - GetIdentitiesBalancesRequestV0.create = function create(properties) { - return new GetIdentitiesBalancesRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ids != null && message.ids.length) - for (var i = 0; i < message.ids.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ids && message.ids.length)) - message.ids = []; - message.ids.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ids != null && message.hasOwnProperty("ids")) { - if (!Array.isArray(message.ids)) - return "ids: array expected"; - for (var i = 0; i < message.ids.length; ++i) - if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) - return "ids: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentitiesBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 - */ - GetIdentitiesBalancesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); - if (object.ids) { - if (!Array.isArray(object.ids)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids: array expected"); - message.ids = []; - for (var i = 0; i < object.ids.length; ++i) - if (typeof object.ids[i] === "string") - $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); - else if (object.ids[i].length >= 0) - message.ids[i] = object.ids[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ids = []; - if (options.defaults) - object.prove = false; - if (message.ids && message.ids.length) { - object.ids = []; - for (var j = 0; j < message.ids.length; ++j) - object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentitiesBalancesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesBalancesRequestV0; - })(); - - return GetIdentitiesBalancesRequest; - })(); - - v0.GetIdentitiesBalancesResponse = (function() { - - /** - * Properties of a GetIdentitiesBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesBalancesResponse - * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null} [v0] GetIdentitiesBalancesResponse v0 - */ - - /** - * Constructs a new GetIdentitiesBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesBalancesResponse. - * @implements IGetIdentitiesBalancesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set - */ - function GetIdentitiesBalancesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @instance - */ - GetIdentitiesBalancesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesBalancesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @instance - */ - Object.defineProperty(GetIdentitiesBalancesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesBalancesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse instance - */ - GetIdentitiesBalancesResponse.create = function create(properties) { - return new GetIdentitiesBalancesResponse(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesBalancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse - */ - GetIdentitiesBalancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesBalancesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 = (function() { - - /** - * Properties of a GetIdentitiesBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @interface IGetIdentitiesBalancesResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null} [identitiesBalances] GetIdentitiesBalancesResponseV0 identitiesBalances - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesBalancesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesBalancesResponseV0 metadata - */ - - /** - * Constructs a new GetIdentitiesBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @classdesc Represents a GetIdentitiesBalancesResponseV0. - * @implements IGetIdentitiesBalancesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set - */ - function GetIdentitiesBalancesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesResponseV0 identitiesBalances. - * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null|undefined} identitiesBalances - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - */ - GetIdentitiesBalancesResponseV0.prototype.identitiesBalances = null; - - /** - * GetIdentitiesBalancesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - */ - GetIdentitiesBalancesResponseV0.prototype.proof = null; - - /** - * GetIdentitiesBalancesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - */ - GetIdentitiesBalancesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesBalancesResponseV0 result. - * @member {"identitiesBalances"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - */ - Object.defineProperty(GetIdentitiesBalancesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identitiesBalances", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesBalancesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 instance - */ - GetIdentitiesBalancesResponseV0.create = function create(properties) { - return new GetIdentitiesBalancesResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identitiesBalances != null && Object.hasOwnProperty.call(message, "identitiesBalances")) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.encode(message.identitiesBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify(message.identitiesBalances); - if (error) - return "identitiesBalances." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentitiesBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 - */ - GetIdentitiesBalancesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); - if (object.identitiesBalances != null) { - if (typeof object.identitiesBalances !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.identitiesBalances: object expected"); - message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.fromObject(object.identitiesBalances); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { - object.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.toObject(message.identitiesBalances, options); - if (options.oneofs) - object.result = "identitiesBalances"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentitiesBalancesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesBalancesResponseV0.IdentityBalance = (function() { - - /** - * Properties of an IdentityBalance. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @interface IIdentityBalance - * @property {Uint8Array|null} [identityId] IdentityBalance identityId - * @property {number|Long|null} [balance] IdentityBalance balance - */ - - /** - * Constructs a new IdentityBalance. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @classdesc Represents an IdentityBalance. - * @implements IIdentityBalance - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set - */ - function IdentityBalance(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityBalance identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @instance - */ - IdentityBalance.prototype.identityId = $util.newBuffer([]); - - /** - * IdentityBalance balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @instance - */ - IdentityBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new IdentityBalance instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance instance - */ - IdentityBalance.create = function create(properties) { - return new IdentityBalance(properties); - }; - - /** - * Encodes the specified IdentityBalance message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityBalance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); - return writer; - }; - - /** - * Encodes the specified IdentityBalance message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityBalance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityBalance message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityBalance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.balance = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityBalance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityBalance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityBalance message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityBalance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.balance != null && message.hasOwnProperty("balance")) - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - return null; - }; - - /** - * Creates an IdentityBalance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance - */ - IdentityBalance.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an IdentityBalance message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} message IdentityBalance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityBalance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.balance = options.longs === String ? "0" : 0; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.balance != null && message.hasOwnProperty("balance")) - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - return object; - }; - - /** - * Converts this IdentityBalance to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @instance - * @returns {Object.} JSON object - */ - IdentityBalance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityBalance; - })(); - - GetIdentitiesBalancesResponseV0.IdentitiesBalances = (function() { - - /** - * Properties of an IdentitiesBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @interface IIdentitiesBalances - * @property {Array.|null} [entries] IdentitiesBalances entries - */ - - /** - * Constructs a new IdentitiesBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @classdesc Represents an IdentitiesBalances. - * @implements IIdentitiesBalances - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set - */ - function IdentitiesBalances(properties) { - this.entries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentitiesBalances entries. - * @member {Array.} entries - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @instance - */ - IdentitiesBalances.prototype.entries = $util.emptyArray; - - /** - * Creates a new IdentitiesBalances instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances instance - */ - IdentitiesBalances.create = function create(properties) { - return new IdentitiesBalances(properties); - }; - - /** - * Encodes the specified IdentitiesBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitiesBalances.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (var i = 0; i < message.entries.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentitiesBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitiesBalances.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentitiesBalances message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitiesBalances.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentitiesBalances message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitiesBalances.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentitiesBalances message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentitiesBalances.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (var i = 0; i < message.entries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify(message.entries[i]); - if (error) - return "entries." + error; - } - } - return null; - }; - - /** - * Creates an IdentitiesBalances message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances - */ - IdentitiesBalances.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: array expected"); - message.entries = []; - for (var i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: object expected"); - message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.fromObject(object.entries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentitiesBalances message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} message IdentitiesBalances - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentitiesBalances.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entries = []; - if (message.entries && message.entries.length) { - object.entries = []; - for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.toObject(message.entries[j], options); - } - return object; - }; - - /** - * Converts this IdentitiesBalances to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @instance - * @returns {Object.} JSON object - */ - IdentitiesBalances.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentitiesBalances; - })(); - - return GetIdentitiesBalancesResponseV0; - })(); - - return GetIdentitiesBalancesResponse; - })(); - - v0.GetDataContractRequest = (function() { - - /** - * Properties of a GetDataContractRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractRequest - * @property {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null} [v0] GetDataContractRequest v0 - */ - - /** - * Constructs a new GetDataContractRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractRequest. - * @implements IGetDataContractRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set - */ - function GetDataContractRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractRequest v0. - * @member {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @instance - */ - GetDataContractRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @instance - */ - Object.defineProperty(GetDataContractRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest instance - */ - GetDataContractRequest.create = function create(properties) { - return new GetDataContractRequest(properties); - }; - - /** - * Encodes the specified GetDataContractRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest - */ - GetDataContractRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest} message GetDataContractRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @instance - * @returns {Object.} JSON object - */ - GetDataContractRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractRequest.GetDataContractRequestV0 = (function() { - - /** - * Properties of a GetDataContractRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @interface IGetDataContractRequestV0 - * @property {Uint8Array|null} [id] GetDataContractRequestV0 id - * @property {boolean|null} [prove] GetDataContractRequestV0 prove - */ - - /** - * Constructs a new GetDataContractRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @classdesc Represents a GetDataContractRequestV0. - * @implements IGetDataContractRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set - */ - function GetDataContractRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @instance - */ - GetDataContractRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetDataContractRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @instance - */ - GetDataContractRequestV0.prototype.prove = false; - - /** - * Creates a new GetDataContractRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 instance - */ - GetDataContractRequestV0.create = function create(properties) { - return new GetDataContractRequestV0(properties); - }; - - /** - * Encodes the specified GetDataContractRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetDataContractRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetDataContractRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 - */ - GetDataContractRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetDataContractRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} message GetDataContractRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetDataContractRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractRequestV0; - })(); - - return GetDataContractRequest; - })(); - - v0.GetDataContractResponse = (function() { - - /** - * Properties of a GetDataContractResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractResponse - * @property {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null} [v0] GetDataContractResponse v0 - */ - - /** - * Constructs a new GetDataContractResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractResponse. - * @implements IGetDataContractResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set - */ - function GetDataContractResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractResponse v0. - * @member {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @instance - */ - GetDataContractResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @instance - */ - Object.defineProperty(GetDataContractResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse instance - */ - GetDataContractResponse.create = function create(properties) { - return new GetDataContractResponse(properties); - }; - - /** - * Encodes the specified GetDataContractResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse - */ - GetDataContractResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse} message GetDataContractResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @instance - * @returns {Object.} JSON object - */ - GetDataContractResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractResponse.GetDataContractResponseV0 = (function() { - - /** - * Properties of a GetDataContractResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @interface IGetDataContractResponseV0 - * @property {Uint8Array|null} [dataContract] GetDataContractResponseV0 dataContract - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractResponseV0 metadata - */ - - /** - * Constructs a new GetDataContractResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @classdesc Represents a GetDataContractResponseV0. - * @implements IGetDataContractResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set - */ - function GetDataContractResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractResponseV0 dataContract. - * @member {Uint8Array} dataContract - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - */ - GetDataContractResponseV0.prototype.dataContract = $util.newBuffer([]); - - /** - * GetDataContractResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - */ - GetDataContractResponseV0.prototype.proof = null; - - /** - * GetDataContractResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - */ - GetDataContractResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractResponseV0 result. - * @member {"dataContract"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - */ - Object.defineProperty(GetDataContractResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["dataContract", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 instance - */ - GetDataContractResponseV0.create = function create(properties) { - return new GetDataContractResponseV0(properties); - }; - - /** - * Encodes the specified GetDataContractResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContract); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataContract = reader.bytes(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) { - properties.result = 1; - if (!(message.dataContract && typeof message.dataContract.length === "number" || $util.isString(message.dataContract))) - return "dataContract: buffer expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetDataContractResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 - */ - GetDataContractResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); - if (object.dataContract != null) - if (typeof object.dataContract === "string") - $util.base64.decode(object.dataContract, message.dataContract = $util.newBuffer($util.base64.length(object.dataContract)), 0); - else if (object.dataContract.length >= 0) - message.dataContract = object.dataContract; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} message GetDataContractResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) { - object.dataContract = options.bytes === String ? $util.base64.encode(message.dataContract, 0, message.dataContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContract) : message.dataContract; - if (options.oneofs) - object.result = "dataContract"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetDataContractResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractResponseV0; - })(); - - return GetDataContractResponse; - })(); - - v0.GetDataContractsRequest = (function() { - - /** - * Properties of a GetDataContractsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractsRequest - * @property {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null} [v0] GetDataContractsRequest v0 - */ - - /** - * Constructs a new GetDataContractsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractsRequest. - * @implements IGetDataContractsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set - */ - function GetDataContractsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractsRequest v0. - * @member {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @instance - */ - GetDataContractsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @instance - */ - Object.defineProperty(GetDataContractsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest instance - */ - GetDataContractsRequest.create = function create(properties) { - return new GetDataContractsRequest(properties); - }; - - /** - * Encodes the specified GetDataContractsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest - */ - GetDataContractsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest} message GetDataContractsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @instance - * @returns {Object.} JSON object - */ - GetDataContractsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractsRequest.GetDataContractsRequestV0 = (function() { - - /** - * Properties of a GetDataContractsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @interface IGetDataContractsRequestV0 - * @property {Array.|null} [ids] GetDataContractsRequestV0 ids - * @property {boolean|null} [prove] GetDataContractsRequestV0 prove - */ - - /** - * Constructs a new GetDataContractsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @classdesc Represents a GetDataContractsRequestV0. - * @implements IGetDataContractsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set - */ - function GetDataContractsRequestV0(properties) { - this.ids = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractsRequestV0 ids. - * @member {Array.} ids - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @instance - */ - GetDataContractsRequestV0.prototype.ids = $util.emptyArray; - - /** - * GetDataContractsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @instance - */ - GetDataContractsRequestV0.prototype.prove = false; - - /** - * Creates a new GetDataContractsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 instance - */ - GetDataContractsRequestV0.create = function create(properties) { - return new GetDataContractsRequestV0(properties); - }; - - /** - * Encodes the specified GetDataContractsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ids != null && message.ids.length) - for (var i = 0; i < message.ids.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetDataContractsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ids && message.ids.length)) - message.ids = []; - message.ids.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ids != null && message.hasOwnProperty("ids")) { - if (!Array.isArray(message.ids)) - return "ids: array expected"; - for (var i = 0; i < message.ids.length; ++i) - if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) - return "ids: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetDataContractsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 - */ - GetDataContractsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); - if (object.ids) { - if (!Array.isArray(object.ids)) - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.ids: array expected"); - message.ids = []; - for (var i = 0; i < object.ids.length; ++i) - if (typeof object.ids[i] === "string") - $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); - else if (object.ids[i].length >= 0) - message.ids[i] = object.ids[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetDataContractsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} message GetDataContractsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ids = []; - if (options.defaults) - object.prove = false; - if (message.ids && message.ids.length) { - object.ids = []; - for (var j = 0; j < message.ids.length; ++j) - object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetDataContractsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractsRequestV0; - })(); - - return GetDataContractsRequest; - })(); - - v0.GetDataContractsResponse = (function() { - - /** - * Properties of a GetDataContractsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractsResponse - * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null} [v0] GetDataContractsResponse v0 - */ - - /** - * Constructs a new GetDataContractsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractsResponse. - * @implements IGetDataContractsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set - */ - function GetDataContractsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractsResponse v0. - * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @instance - */ - GetDataContractsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @instance - */ - Object.defineProperty(GetDataContractsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse instance - */ - GetDataContractsResponse.create = function create(properties) { - return new GetDataContractsResponse(properties); - }; - - /** - * Encodes the specified GetDataContractsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse - */ - GetDataContractsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} message GetDataContractsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @instance - * @returns {Object.} JSON object - */ - GetDataContractsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractsResponse.DataContractEntry = (function() { - - /** - * Properties of a DataContractEntry. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @interface IDataContractEntry - * @property {Uint8Array|null} [identifier] DataContractEntry identifier - * @property {google.protobuf.IBytesValue|null} [dataContract] DataContractEntry dataContract - */ - - /** - * Constructs a new DataContractEntry. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @classdesc Represents a DataContractEntry. - * @implements IDataContractEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set - */ - function DataContractEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataContractEntry identifier. - * @member {Uint8Array} identifier - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @instance - */ - DataContractEntry.prototype.identifier = $util.newBuffer([]); - - /** - * DataContractEntry dataContract. - * @member {google.protobuf.IBytesValue|null|undefined} dataContract - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @instance - */ - DataContractEntry.prototype.dataContract = null; - - /** - * Creates a new DataContractEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry instance - */ - DataContractEntry.create = function create(properties) { - return new DataContractEntry(properties); - }; - - /** - * Encodes the specified DataContractEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); - if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) - $root.google.protobuf.BytesValue.encode(message.dataContract, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataContractEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataContractEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identifier = reader.bytes(); - break; - case 2: - message.dataContract = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataContractEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataContractEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataContractEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identifier != null && message.hasOwnProperty("identifier")) - if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) - return "identifier: buffer expected"; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) { - var error = $root.google.protobuf.BytesValue.verify(message.dataContract); - if (error) - return "dataContract." + error; - } - return null; - }; - - /** - * Creates a DataContractEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry - */ - DataContractEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); - if (object.identifier != null) - if (typeof object.identifier === "string") - $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); - else if (object.identifier.length >= 0) - message.identifier = object.identifier; - if (object.dataContract != null) { - if (typeof object.dataContract !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.dataContract: object expected"); - message.dataContract = $root.google.protobuf.BytesValue.fromObject(object.dataContract); - } - return message; - }; - - /** - * Creates a plain object from a DataContractEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} message DataContractEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataContractEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identifier = ""; - else { - object.identifier = []; - if (options.bytes !== Array) - object.identifier = $util.newBuffer(object.identifier); - } - object.dataContract = null; - } - if (message.identifier != null && message.hasOwnProperty("identifier")) - object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) - object.dataContract = $root.google.protobuf.BytesValue.toObject(message.dataContract, options); - return object; - }; - - /** - * Converts this DataContractEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @instance - * @returns {Object.} JSON object - */ - DataContractEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DataContractEntry; - })(); - - GetDataContractsResponse.DataContracts = (function() { - - /** - * Properties of a DataContracts. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @interface IDataContracts - * @property {Array.|null} [dataContractEntries] DataContracts dataContractEntries - */ - - /** - * Constructs a new DataContracts. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @classdesc Represents a DataContracts. - * @implements IDataContracts - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set - */ - function DataContracts(properties) { - this.dataContractEntries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataContracts dataContractEntries. - * @member {Array.} dataContractEntries - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @instance - */ - DataContracts.prototype.dataContractEntries = $util.emptyArray; - - /** - * Creates a new DataContracts instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts instance - */ - DataContracts.create = function create(properties) { - return new DataContracts(properties); - }; - - /** - * Encodes the specified DataContracts message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContracts.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContractEntries != null && message.dataContractEntries.length) - for (var i = 0; i < message.dataContractEntries.length; ++i) - $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataContracts message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContracts.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataContracts message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContracts.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.dataContractEntries && message.dataContractEntries.length)) - message.dataContractEntries = []; - message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataContracts message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContracts.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataContracts message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataContracts.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { - if (!Array.isArray(message.dataContractEntries)) - return "dataContractEntries: array expected"; - for (var i = 0; i < message.dataContractEntries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify(message.dataContractEntries[i]); - if (error) - return "dataContractEntries." + error; - } - } - return null; - }; - - /** - * Creates a DataContracts message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts - */ - DataContracts.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); - if (object.dataContractEntries) { - if (!Array.isArray(object.dataContractEntries)) - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: array expected"); - message.dataContractEntries = []; - for (var i = 0; i < object.dataContractEntries.length; ++i) { - if (typeof object.dataContractEntries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: object expected"); - message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.fromObject(object.dataContractEntries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DataContracts message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} message DataContracts - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataContracts.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dataContractEntries = []; - if (message.dataContractEntries && message.dataContractEntries.length) { - object.dataContractEntries = []; - for (var j = 0; j < message.dataContractEntries.length; ++j) - object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject(message.dataContractEntries[j], options); - } - return object; - }; - - /** - * Converts this DataContracts to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @instance - * @returns {Object.} JSON object - */ - DataContracts.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DataContracts; - })(); - - GetDataContractsResponse.GetDataContractsResponseV0 = (function() { - - /** - * Properties of a GetDataContractsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @interface IGetDataContractsResponseV0 - * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null} [dataContracts] GetDataContractsResponseV0 dataContracts - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractsResponseV0 metadata - */ - - /** - * Constructs a new GetDataContractsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @classdesc Represents a GetDataContractsResponseV0. - * @implements IGetDataContractsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set - */ - function GetDataContractsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractsResponseV0 dataContracts. - * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null|undefined} dataContracts - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - */ - GetDataContractsResponseV0.prototype.dataContracts = null; - - /** - * GetDataContractsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - */ - GetDataContractsResponseV0.prototype.proof = null; - - /** - * GetDataContractsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - */ - GetDataContractsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractsResponseV0 result. - * @member {"dataContracts"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - */ - Object.defineProperty(GetDataContractsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["dataContracts", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 instance - */ - GetDataContractsResponseV0.create = function create(properties) { - return new GetDataContractsResponseV0(properties); - }; - - /** - * Encodes the specified GetDataContractsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContracts != null && Object.hasOwnProperty.call(message, "dataContracts")) - $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.encode(message.dataContracts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify(message.dataContracts); - if (error) - return "dataContracts." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetDataContractsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 - */ - GetDataContractsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); - if (object.dataContracts != null) { - if (typeof object.dataContracts !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.dataContracts: object expected"); - message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.fromObject(object.dataContracts); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} message GetDataContractsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { - object.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(message.dataContracts, options); - if (options.oneofs) - object.result = "dataContracts"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetDataContractsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractsResponseV0; - })(); - - return GetDataContractsResponse; - })(); - - v0.GetDataContractHistoryRequest = (function() { - - /** - * Properties of a GetDataContractHistoryRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractHistoryRequest - * @property {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null} [v0] GetDataContractHistoryRequest v0 - */ - - /** - * Constructs a new GetDataContractHistoryRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractHistoryRequest. - * @implements IGetDataContractHistoryRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set - */ - function GetDataContractHistoryRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractHistoryRequest v0. - * @member {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @instance - */ - GetDataContractHistoryRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractHistoryRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @instance - */ - Object.defineProperty(GetDataContractHistoryRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractHistoryRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest instance - */ - GetDataContractHistoryRequest.create = function create(properties) { - return new GetDataContractHistoryRequest(properties); - }; - - /** - * Encodes the specified GetDataContractHistoryRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractHistoryRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractHistoryRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractHistoryRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractHistoryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest - */ - GetDataContractHistoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractHistoryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} message GetDataContractHistoryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractHistoryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractHistoryRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @instance - * @returns {Object.} JSON object - */ - GetDataContractHistoryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 = (function() { - - /** - * Properties of a GetDataContractHistoryRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @interface IGetDataContractHistoryRequestV0 - * @property {Uint8Array|null} [id] GetDataContractHistoryRequestV0 id - * @property {google.protobuf.IUInt32Value|null} [limit] GetDataContractHistoryRequestV0 limit - * @property {google.protobuf.IUInt32Value|null} [offset] GetDataContractHistoryRequestV0 offset - * @property {number|Long|null} [startAtMs] GetDataContractHistoryRequestV0 startAtMs - * @property {boolean|null} [prove] GetDataContractHistoryRequestV0 prove - */ - - /** - * Constructs a new GetDataContractHistoryRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @classdesc Represents a GetDataContractHistoryRequestV0. - * @implements IGetDataContractHistoryRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set - */ - function GetDataContractHistoryRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractHistoryRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetDataContractHistoryRequestV0 limit. - * @member {google.protobuf.IUInt32Value|null|undefined} limit - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.limit = null; - - /** - * GetDataContractHistoryRequestV0 offset. - * @member {google.protobuf.IUInt32Value|null|undefined} offset - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.offset = null; - - /** - * GetDataContractHistoryRequestV0 startAtMs. - * @member {number|Long} startAtMs - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.startAtMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetDataContractHistoryRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.prove = false; - - /** - * Creates a new GetDataContractHistoryRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 instance - */ - GetDataContractHistoryRequestV0.create = function create(properties) { - return new GetDataContractHistoryRequestV0(properties); - }; - - /** - * Encodes the specified GetDataContractHistoryRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.startAtMs != null && Object.hasOwnProperty.call(message, "startAtMs")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startAtMs); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetDataContractHistoryRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 3: - message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 4: - message.startAtMs = reader.uint64(); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractHistoryRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractHistoryRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.UInt32Value.verify(message.limit); - if (error) - return "limit." + error; - } - if (message.offset != null && message.hasOwnProperty("offset")) { - var error = $root.google.protobuf.UInt32Value.verify(message.offset); - if (error) - return "offset." + error; - } - if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) - if (!$util.isInteger(message.startAtMs) && !(message.startAtMs && $util.isInteger(message.startAtMs.low) && $util.isInteger(message.startAtMs.high))) - return "startAtMs: integer|Long expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetDataContractHistoryRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 - */ - GetDataContractHistoryRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.limit: object expected"); - message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); - } - if (object.offset != null) { - if (typeof object.offset !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.offset: object expected"); - message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); - } - if (object.startAtMs != null) - if ($util.Long) - (message.startAtMs = $util.Long.fromValue(object.startAtMs)).unsigned = true; - else if (typeof object.startAtMs === "string") - message.startAtMs = parseInt(object.startAtMs, 10); - else if (typeof object.startAtMs === "number") - message.startAtMs = object.startAtMs; - else if (typeof object.startAtMs === "object") - message.startAtMs = new $util.LongBits(object.startAtMs.low >>> 0, object.startAtMs.high >>> 0).toNumber(true); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetDataContractHistoryRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractHistoryRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.limit = null; - object.offset = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.startAtMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startAtMs = options.longs === String ? "0" : 0; - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); - if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) - if (typeof message.startAtMs === "number") - object.startAtMs = options.longs === String ? String(message.startAtMs) : message.startAtMs; - else - object.startAtMs = options.longs === String ? $util.Long.prototype.toString.call(message.startAtMs) : options.longs === Number ? new $util.LongBits(message.startAtMs.low >>> 0, message.startAtMs.high >>> 0).toNumber(true) : message.startAtMs; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetDataContractHistoryRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractHistoryRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractHistoryRequestV0; - })(); - - return GetDataContractHistoryRequest; - })(); - - v0.GetDataContractHistoryResponse = (function() { - - /** - * Properties of a GetDataContractHistoryResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractHistoryResponse - * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null} [v0] GetDataContractHistoryResponse v0 - */ - - /** - * Constructs a new GetDataContractHistoryResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractHistoryResponse. - * @implements IGetDataContractHistoryResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set - */ - function GetDataContractHistoryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractHistoryResponse v0. - * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @instance - */ - GetDataContractHistoryResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractHistoryResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @instance - */ - Object.defineProperty(GetDataContractHistoryResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractHistoryResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse instance - */ - GetDataContractHistoryResponse.create = function create(properties) { - return new GetDataContractHistoryResponse(properties); - }; - - /** - * Encodes the specified GetDataContractHistoryResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractHistoryResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractHistoryResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractHistoryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractHistoryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse - */ - GetDataContractHistoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractHistoryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} message GetDataContractHistoryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractHistoryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractHistoryResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @instance - * @returns {Object.} JSON object - */ - GetDataContractHistoryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 = (function() { - - /** - * Properties of a GetDataContractHistoryResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @interface IGetDataContractHistoryResponseV0 - * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null} [dataContractHistory] GetDataContractHistoryResponseV0 dataContractHistory - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractHistoryResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractHistoryResponseV0 metadata - */ - - /** - * Constructs a new GetDataContractHistoryResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @classdesc Represents a GetDataContractHistoryResponseV0. - * @implements IGetDataContractHistoryResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set - */ - function GetDataContractHistoryResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractHistoryResponseV0 dataContractHistory. - * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null|undefined} dataContractHistory - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - */ - GetDataContractHistoryResponseV0.prototype.dataContractHistory = null; - - /** - * GetDataContractHistoryResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - */ - GetDataContractHistoryResponseV0.prototype.proof = null; - - /** - * GetDataContractHistoryResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - */ - GetDataContractHistoryResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractHistoryResponseV0 result. - * @member {"dataContractHistory"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - */ - Object.defineProperty(GetDataContractHistoryResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["dataContractHistory", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractHistoryResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 instance - */ - GetDataContractHistoryResponseV0.create = function create(properties) { - return new GetDataContractHistoryResponseV0(properties); - }; - - /** - * Encodes the specified GetDataContractHistoryResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContractHistory != null && Object.hasOwnProperty.call(message, "dataContractHistory")) - $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.encode(message.dataContractHistory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractHistoryResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractHistoryResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractHistoryResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify(message.dataContractHistory); - if (error) - return "dataContractHistory." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetDataContractHistoryResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 - */ - GetDataContractHistoryResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); - if (object.dataContractHistory != null) { - if (typeof object.dataContractHistory !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.dataContractHistory: object expected"); - message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.fromObject(object.dataContractHistory); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractHistoryResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractHistoryResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { - object.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.toObject(message.dataContractHistory, options); - if (options.oneofs) - object.result = "dataContractHistory"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetDataContractHistoryResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractHistoryResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractHistoryResponseV0.DataContractHistoryEntry = (function() { - - /** - * Properties of a DataContractHistoryEntry. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @interface IDataContractHistoryEntry - * @property {number|Long|null} [date] DataContractHistoryEntry date - * @property {Uint8Array|null} [value] DataContractHistoryEntry value - */ - - /** - * Constructs a new DataContractHistoryEntry. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @classdesc Represents a DataContractHistoryEntry. - * @implements IDataContractHistoryEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set - */ - function DataContractHistoryEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataContractHistoryEntry date. - * @member {number|Long} date - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @instance - */ - DataContractHistoryEntry.prototype.date = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DataContractHistoryEntry value. - * @member {Uint8Array} value - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @instance - */ - DataContractHistoryEntry.prototype.value = $util.newBuffer([]); - - /** - * Creates a new DataContractHistoryEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry instance - */ - DataContractHistoryEntry.create = function create(properties) { - return new DataContractHistoryEntry(properties); - }; - - /** - * Encodes the specified DataContractHistoryEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractHistoryEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.date != null && Object.hasOwnProperty.call(message, "date")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.date); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified DataContractHistoryEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractHistoryEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataContractHistoryEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractHistoryEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.date = reader.uint64(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataContractHistoryEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractHistoryEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataContractHistoryEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataContractHistoryEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.date != null && message.hasOwnProperty("date")) - if (!$util.isInteger(message.date) && !(message.date && $util.isInteger(message.date.low) && $util.isInteger(message.date.high))) - return "date: integer|Long expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a DataContractHistoryEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry - */ - DataContractHistoryEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); - if (object.date != null) - if ($util.Long) - (message.date = $util.Long.fromValue(object.date)).unsigned = true; - else if (typeof object.date === "string") - message.date = parseInt(object.date, 10); - else if (typeof object.date === "number") - message.date = object.date; - else if (typeof object.date === "object") - message.date = new $util.LongBits(object.date.low >>> 0, object.date.high >>> 0).toNumber(true); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a DataContractHistoryEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} message DataContractHistoryEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataContractHistoryEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.date = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.date != null && message.hasOwnProperty("date")) - if (typeof message.date === "number") - object.date = options.longs === String ? String(message.date) : message.date; - else - object.date = options.longs === String ? $util.Long.prototype.toString.call(message.date) : options.longs === Number ? new $util.LongBits(message.date.low >>> 0, message.date.high >>> 0).toNumber(true) : message.date; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this DataContractHistoryEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @instance - * @returns {Object.} JSON object - */ - DataContractHistoryEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DataContractHistoryEntry; - })(); - - GetDataContractHistoryResponseV0.DataContractHistory = (function() { - - /** - * Properties of a DataContractHistory. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @interface IDataContractHistory - * @property {Array.|null} [dataContractEntries] DataContractHistory dataContractEntries - */ - - /** - * Constructs a new DataContractHistory. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @classdesc Represents a DataContractHistory. - * @implements IDataContractHistory - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set - */ - function DataContractHistory(properties) { - this.dataContractEntries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataContractHistory dataContractEntries. - * @member {Array.} dataContractEntries - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @instance - */ - DataContractHistory.prototype.dataContractEntries = $util.emptyArray; - - /** - * Creates a new DataContractHistory instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory instance - */ - DataContractHistory.create = function create(properties) { - return new DataContractHistory(properties); - }; - - /** - * Encodes the specified DataContractHistory message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractHistory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContractEntries != null && message.dataContractEntries.length) - for (var i = 0; i < message.dataContractEntries.length; ++i) - $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataContractHistory message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractHistory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataContractHistory message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractHistory.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.dataContractEntries && message.dataContractEntries.length)) - message.dataContractEntries = []; - message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataContractHistory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractHistory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataContractHistory message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataContractHistory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { - if (!Array.isArray(message.dataContractEntries)) - return "dataContractEntries: array expected"; - for (var i = 0; i < message.dataContractEntries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify(message.dataContractEntries[i]); - if (error) - return "dataContractEntries." + error; - } - } - return null; - }; - - /** - * Creates a DataContractHistory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory - */ - DataContractHistory.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); - if (object.dataContractEntries) { - if (!Array.isArray(object.dataContractEntries)) - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: array expected"); - message.dataContractEntries = []; - for (var i = 0; i < object.dataContractEntries.length; ++i) { - if (typeof object.dataContractEntries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: object expected"); - message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.fromObject(object.dataContractEntries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DataContractHistory message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} message DataContractHistory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataContractHistory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dataContractEntries = []; - if (message.dataContractEntries && message.dataContractEntries.length) { - object.dataContractEntries = []; - for (var j = 0; j < message.dataContractEntries.length; ++j) - object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.toObject(message.dataContractEntries[j], options); - } - return object; - }; - - /** - * Converts this DataContractHistory to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @instance - * @returns {Object.} JSON object - */ - DataContractHistory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DataContractHistory; - })(); - - return GetDataContractHistoryResponseV0; - })(); - - return GetDataContractHistoryResponse; - })(); - - v0.GetDocumentsRequest = (function() { - - /** - * Properties of a GetDocumentsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsRequest - * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null} [v0] GetDocumentsRequest v0 - */ - - /** - * Constructs a new GetDocumentsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsRequest. - * @implements IGetDocumentsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set - */ - function GetDocumentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsRequest v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - GetDocumentsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - Object.defineProperty(GetDocumentsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDocumentsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest instance - */ - GetDocumentsRequest.create = function create(properties) { - return new GetDocumentsRequest(properties); - }; - - /** - * Encodes the specified GetDocumentsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest - */ - GetDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest} message GetDocumentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDocumentsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDocumentsRequest.GetDocumentsRequestV0 = (function() { - - /** - * Properties of a GetDocumentsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @interface IGetDocumentsRequestV0 - * @property {Uint8Array|null} [dataContractId] GetDocumentsRequestV0 dataContractId - * @property {string|null} [documentType] GetDocumentsRequestV0 documentType - * @property {Uint8Array|null} [where] GetDocumentsRequestV0 where - * @property {Uint8Array|null} [orderBy] GetDocumentsRequestV0 orderBy - * @property {number|null} [limit] GetDocumentsRequestV0 limit - * @property {Uint8Array|null} [startAfter] GetDocumentsRequestV0 startAfter - * @property {Uint8Array|null} [startAt] GetDocumentsRequestV0 startAt - * @property {boolean|null} [prove] GetDocumentsRequestV0 prove - */ - - /** - * Constructs a new GetDocumentsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @classdesc Represents a GetDocumentsRequestV0. - * @implements IGetDocumentsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set - */ - function GetDocumentsRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsRequestV0 dataContractId. - * @member {Uint8Array} dataContractId - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.dataContractId = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 documentType. - * @member {string} documentType - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.documentType = ""; - - /** - * GetDocumentsRequestV0 where. - * @member {Uint8Array} where - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.where = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 orderBy. - * @member {Uint8Array} orderBy - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.orderBy = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.limit = 0; - - /** - * GetDocumentsRequestV0 startAfter. - * @member {Uint8Array} startAfter - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.startAfter = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 startAt. - * @member {Uint8Array} startAt - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.startAt = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.prove = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsRequestV0 start. - * @member {"startAfter"|"startAt"|undefined} start - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - Object.defineProperty(GetDocumentsRequestV0.prototype, "start", { - get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDocumentsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 instance - */ - GetDocumentsRequestV0.create = function create(properties) { - return new GetDocumentsRequestV0(properties); - }; - - /** - * Encodes the specified GetDocumentsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); - if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); - if (message.where != null && Object.hasOwnProperty.call(message, "where")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); - if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); - if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetDocumentsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataContractId = reader.bytes(); - break; - case 2: - message.documentType = reader.string(); - break; - case 3: - message.where = reader.bytes(); - break; - case 4: - message.orderBy = reader.bytes(); - break; - case 5: - message.limit = reader.uint32(); - break; - case 6: - message.startAfter = reader.bytes(); - break; - case 7: - message.startAt = reader.bytes(); - break; - case 8: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) - return "dataContractId: buffer expected"; - if (message.documentType != null && message.hasOwnProperty("documentType")) - if (!$util.isString(message.documentType)) - return "documentType: string expected"; - if (message.where != null && message.hasOwnProperty("where")) - if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) - return "where: buffer expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) - return "orderBy: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - properties.start = 1; - if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) - return "startAfter: buffer expected"; - } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - if (properties.start === 1) - return "start: multiple values"; - properties.start = 1; - if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) - return "startAt: buffer expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetDocumentsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 - */ - GetDocumentsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); - if (object.dataContractId != null) - if (typeof object.dataContractId === "string") - $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); - else if (object.dataContractId.length >= 0) - message.dataContractId = object.dataContractId; - if (object.documentType != null) - message.documentType = String(object.documentType); - if (object.where != null) - if (typeof object.where === "string") - $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); - else if (object.where.length >= 0) - message.where = object.where; - if (object.orderBy != null) - if (typeof object.orderBy === "string") - $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); - else if (object.orderBy.length >= 0) - message.orderBy = object.orderBy; - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.startAfter != null) - if (typeof object.startAfter === "string") - $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); - else if (object.startAfter.length >= 0) - message.startAfter = object.startAfter; - if (object.startAt != null) - if (typeof object.startAt === "string") - $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); - else if (object.startAt.length >= 0) - message.startAt = object.startAt; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetDocumentsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} message GetDocumentsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.dataContractId = ""; - else { - object.dataContractId = []; - if (options.bytes !== Array) - object.dataContractId = $util.newBuffer(object.dataContractId); - } - object.documentType = ""; - if (options.bytes === String) - object.where = ""; - else { - object.where = []; - if (options.bytes !== Array) - object.where = $util.newBuffer(object.where); - } - if (options.bytes === String) - object.orderBy = ""; - else { - object.orderBy = []; - if (options.bytes !== Array) - object.orderBy = $util.newBuffer(object.orderBy); - } - object.limit = 0; - object.prove = false; - } - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; - if (message.documentType != null && message.hasOwnProperty("documentType")) - object.documentType = message.documentType; - if (message.where != null && message.hasOwnProperty("where")) - object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; - if (options.oneofs) - object.start = "startAfter"; - } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; - if (options.oneofs) - object.start = "startAt"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetDocumentsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDocumentsRequestV0; - })(); - - return GetDocumentsRequest; - })(); - - v0.GetDocumentsResponse = (function() { - - /** - * Properties of a GetDocumentsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsResponse - * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 - */ - - /** - * Constructs a new GetDocumentsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsResponse. - * @implements IGetDocumentsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - */ - function GetDocumentsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsResponse v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - GetDocumentsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - Object.defineProperty(GetDocumentsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDocumentsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance - */ - GetDocumentsResponse.create = function create(properties) { - return new GetDocumentsResponse(properties); - }; - - /** - * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - */ - GetDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDocumentsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDocumentsResponse.GetDocumentsResponseV0 = (function() { - - /** - * Properties of a GetDocumentsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @interface IGetDocumentsResponseV0 - * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata - */ - - /** - * Constructs a new GetDocumentsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @classdesc Represents a GetDocumentsResponseV0. - * @implements IGetDocumentsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set - */ - function GetDocumentsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsResponseV0 documents. - * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.documents = null; - - /** - * GetDocumentsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.proof = null; - - /** - * GetDocumentsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsResponseV0 result. - * @member {"documents"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDocumentsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance - */ - GetDocumentsResponseV0.create = function create(properties) { - return new GetDocumentsResponseV0(properties); - }; - - /** - * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) - $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.documents != null && message.hasOwnProperty("documents")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); - if (error) - return "documents." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 - */ - GetDocumentsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); - if (object.documents != null) { - if (typeof object.documents !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); - message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.documents != null && message.hasOwnProperty("documents")) { - object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); - if (options.oneofs) - object.result = "documents"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetDocumentsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDocumentsResponseV0.Documents = (function() { - - /** - * Properties of a Documents. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @interface IDocuments - * @property {Array.|null} [documents] Documents documents - */ - - /** - * Constructs a new Documents. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @classdesc Represents a Documents. - * @implements IDocuments - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set - */ - function Documents(properties) { - this.documents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Documents documents. - * @member {Array.} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @instance - */ - Documents.prototype.documents = $util.emptyArray; - - /** - * Creates a new Documents instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance - */ - Documents.create = function create(properties) { - return new Documents(properties); - }; - - /** - * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); - return writer; - }; - - /** - * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Documents message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Documents message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Documents message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Documents.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) - return "documents: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Documents message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - */ - Documents.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - if (typeof object.documents[i] === "string") - $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); - else if (object.documents[i].length >= 0) - message.documents[i] = object.documents[i]; - } - return message; - }; - - /** - * Creates a plain object from a Documents message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Documents.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; - } - return object; - }; - - /** - * Converts this Documents to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @instance - * @returns {Object.} JSON object - */ - Documents.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Documents; - })(); - - return GetDocumentsResponseV0; - })(); - - return GetDocumentsResponse; - })(); - - v0.GetIdentityByPublicKeyHashRequest = (function() { - - /** - * Properties of a GetIdentityByPublicKeyHashRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityByPublicKeyHashRequest - * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null} [v0] GetIdentityByPublicKeyHashRequest v0 - */ - - /** - * Constructs a new GetIdentityByPublicKeyHashRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityByPublicKeyHashRequest. - * @implements IGetIdentityByPublicKeyHashRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set - */ - function GetIdentityByPublicKeyHashRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityByPublicKeyHashRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @instance - */ - GetIdentityByPublicKeyHashRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityByPublicKeyHashRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @instance - */ - Object.defineProperty(GetIdentityByPublicKeyHashRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityByPublicKeyHashRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest instance - */ - GetIdentityByPublicKeyHashRequest.create = function create(properties) { - return new GetIdentityByPublicKeyHashRequest(properties); - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityByPublicKeyHashRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityByPublicKeyHashRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityByPublicKeyHashRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest - */ - GetIdentityByPublicKeyHashRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityByPublicKeyHashRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityByPublicKeyHashRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityByPublicKeyHashRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityByPublicKeyHashRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 = (function() { - - /** - * Properties of a GetIdentityByPublicKeyHashRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @interface IGetIdentityByPublicKeyHashRequestV0 - * @property {Uint8Array|null} [publicKeyHash] GetIdentityByPublicKeyHashRequestV0 publicKeyHash - * @property {boolean|null} [prove] GetIdentityByPublicKeyHashRequestV0 prove - */ - - /** - * Constructs a new GetIdentityByPublicKeyHashRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @classdesc Represents a GetIdentityByPublicKeyHashRequestV0. - * @implements IGetIdentityByPublicKeyHashRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set - */ - function GetIdentityByPublicKeyHashRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityByPublicKeyHashRequestV0 publicKeyHash. - * @member {Uint8Array} publicKeyHash - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @instance - */ - GetIdentityByPublicKeyHashRequestV0.prototype.publicKeyHash = $util.newBuffer([]); - - /** - * GetIdentityByPublicKeyHashRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @instance - */ - GetIdentityByPublicKeyHashRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityByPublicKeyHashRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 instance - */ - GetIdentityByPublicKeyHashRequestV0.create = function create(properties) { - return new GetIdentityByPublicKeyHashRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.publicKeyHash != null && Object.hasOwnProperty.call(message, "publicKeyHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKeyHash); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.publicKeyHash = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityByPublicKeyHashRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityByPublicKeyHashRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) - if (!(message.publicKeyHash && typeof message.publicKeyHash.length === "number" || $util.isString(message.publicKeyHash))) - return "publicKeyHash: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityByPublicKeyHashRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 - */ - GetIdentityByPublicKeyHashRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); - if (object.publicKeyHash != null) - if (typeof object.publicKeyHash === "string") - $util.base64.decode(object.publicKeyHash, message.publicKeyHash = $util.newBuffer($util.base64.length(object.publicKeyHash)), 0); - else if (object.publicKeyHash.length >= 0) - message.publicKeyHash = object.publicKeyHash; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityByPublicKeyHashRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityByPublicKeyHashRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.publicKeyHash = ""; - else { - object.publicKeyHash = []; - if (options.bytes !== Array) - object.publicKeyHash = $util.newBuffer(object.publicKeyHash); - } - object.prove = false; - } - if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) - object.publicKeyHash = options.bytes === String ? $util.base64.encode(message.publicKeyHash, 0, message.publicKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeyHash) : message.publicKeyHash; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityByPublicKeyHashRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityByPublicKeyHashRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityByPublicKeyHashRequestV0; - })(); - - return GetIdentityByPublicKeyHashRequest; - })(); - - v0.GetIdentityByPublicKeyHashResponse = (function() { - - /** - * Properties of a GetIdentityByPublicKeyHashResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityByPublicKeyHashResponse - * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null} [v0] GetIdentityByPublicKeyHashResponse v0 - */ - - /** - * Constructs a new GetIdentityByPublicKeyHashResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityByPublicKeyHashResponse. - * @implements IGetIdentityByPublicKeyHashResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set - */ - function GetIdentityByPublicKeyHashResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityByPublicKeyHashResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @instance - */ - GetIdentityByPublicKeyHashResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityByPublicKeyHashResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @instance - */ - Object.defineProperty(GetIdentityByPublicKeyHashResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityByPublicKeyHashResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse instance - */ - GetIdentityByPublicKeyHashResponse.create = function create(properties) { - return new GetIdentityByPublicKeyHashResponse(properties); - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityByPublicKeyHashResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityByPublicKeyHashResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityByPublicKeyHashResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse - */ - GetIdentityByPublicKeyHashResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityByPublicKeyHashResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityByPublicKeyHashResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityByPublicKeyHashResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityByPublicKeyHashResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 = (function() { - - /** - * Properties of a GetIdentityByPublicKeyHashResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @interface IGetIdentityByPublicKeyHashResponseV0 - * @property {Uint8Array|null} [identity] GetIdentityByPublicKeyHashResponseV0 identity - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityByPublicKeyHashResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityByPublicKeyHashResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityByPublicKeyHashResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @classdesc Represents a GetIdentityByPublicKeyHashResponseV0. - * @implements IGetIdentityByPublicKeyHashResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set - */ - function GetIdentityByPublicKeyHashResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityByPublicKeyHashResponseV0 identity. - * @member {Uint8Array} identity - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - */ - GetIdentityByPublicKeyHashResponseV0.prototype.identity = $util.newBuffer([]); - - /** - * GetIdentityByPublicKeyHashResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - */ - GetIdentityByPublicKeyHashResponseV0.prototype.proof = null; - - /** - * GetIdentityByPublicKeyHashResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - */ - GetIdentityByPublicKeyHashResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityByPublicKeyHashResponseV0 result. - * @member {"identity"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityByPublicKeyHashResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityByPublicKeyHashResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 instance - */ - GetIdentityByPublicKeyHashResponseV0.create = function create(properties) { - return new GetIdentityByPublicKeyHashResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identity = reader.bytes(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityByPublicKeyHashResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityByPublicKeyHashResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identity != null && message.hasOwnProperty("identity")) { - properties.result = 1; - if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) - return "identity: buffer expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityByPublicKeyHashResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 - */ - GetIdentityByPublicKeyHashResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); - if (object.identity != null) - if (typeof object.identity === "string") - $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); - else if (object.identity.length >= 0) - message.identity = object.identity; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityByPublicKeyHashResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityByPublicKeyHashResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identity != null && message.hasOwnProperty("identity")) { - object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; - if (options.oneofs) - object.result = "identity"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityByPublicKeyHashResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityByPublicKeyHashResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityByPublicKeyHashResponseV0; - })(); - - return GetIdentityByPublicKeyHashResponse; - })(); - - v0.WaitForStateTransitionResultRequest = (function() { - - /** - * Properties of a WaitForStateTransitionResultRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IWaitForStateTransitionResultRequest - * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null} [v0] WaitForStateTransitionResultRequest v0 - */ - - /** - * Constructs a new WaitForStateTransitionResultRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a WaitForStateTransitionResultRequest. - * @implements IWaitForStateTransitionResultRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set - */ - function WaitForStateTransitionResultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitForStateTransitionResultRequest v0. - * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @instance - */ - WaitForStateTransitionResultRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WaitForStateTransitionResultRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @instance - */ - Object.defineProperty(WaitForStateTransitionResultRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WaitForStateTransitionResultRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest instance - */ - WaitForStateTransitionResultRequest.create = function create(properties) { - return new WaitForStateTransitionResultRequest(properties); - }; - - /** - * Encodes the specified WaitForStateTransitionResultRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitForStateTransitionResultRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitForStateTransitionResultRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitForStateTransitionResultRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a WaitForStateTransitionResultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest - */ - WaitForStateTransitionResultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a WaitForStateTransitionResultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitForStateTransitionResultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this WaitForStateTransitionResultRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @instance - * @returns {Object.} JSON object - */ - WaitForStateTransitionResultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 = (function() { - - /** - * Properties of a WaitForStateTransitionResultRequestV0. - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @interface IWaitForStateTransitionResultRequestV0 - * @property {Uint8Array|null} [stateTransitionHash] WaitForStateTransitionResultRequestV0 stateTransitionHash - * @property {boolean|null} [prove] WaitForStateTransitionResultRequestV0 prove - */ - - /** - * Constructs a new WaitForStateTransitionResultRequestV0. - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @classdesc Represents a WaitForStateTransitionResultRequestV0. - * @implements IWaitForStateTransitionResultRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set - */ - function WaitForStateTransitionResultRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitForStateTransitionResultRequestV0 stateTransitionHash. - * @member {Uint8Array} stateTransitionHash - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @instance - */ - WaitForStateTransitionResultRequestV0.prototype.stateTransitionHash = $util.newBuffer([]); - - /** - * WaitForStateTransitionResultRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @instance - */ - WaitForStateTransitionResultRequestV0.prototype.prove = false; - - /** - * Creates a new WaitForStateTransitionResultRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 instance - */ - WaitForStateTransitionResultRequestV0.create = function create(properties) { - return new WaitForStateTransitionResultRequestV0(properties); - }; - - /** - * Encodes the specified WaitForStateTransitionResultRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransitionHash); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified WaitForStateTransitionResultRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.stateTransitionHash = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitForStateTransitionResultRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitForStateTransitionResultRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) - if (!(message.stateTransitionHash && typeof message.stateTransitionHash.length === "number" || $util.isString(message.stateTransitionHash))) - return "stateTransitionHash: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a WaitForStateTransitionResultRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 - */ - WaitForStateTransitionResultRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); - if (object.stateTransitionHash != null) - if (typeof object.stateTransitionHash === "string") - $util.base64.decode(object.stateTransitionHash, message.stateTransitionHash = $util.newBuffer($util.base64.length(object.stateTransitionHash)), 0); - else if (object.stateTransitionHash.length >= 0) - message.stateTransitionHash = object.stateTransitionHash; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a WaitForStateTransitionResultRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitForStateTransitionResultRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.stateTransitionHash = ""; - else { - object.stateTransitionHash = []; - if (options.bytes !== Array) - object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); - } - object.prove = false; - } - if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) - object.stateTransitionHash = options.bytes === String ? $util.base64.encode(message.stateTransitionHash, 0, message.stateTransitionHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransitionHash) : message.stateTransitionHash; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this WaitForStateTransitionResultRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @instance - * @returns {Object.} JSON object - */ - WaitForStateTransitionResultRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WaitForStateTransitionResultRequestV0; - })(); - - return WaitForStateTransitionResultRequest; - })(); - - v0.WaitForStateTransitionResultResponse = (function() { - - /** - * Properties of a WaitForStateTransitionResultResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IWaitForStateTransitionResultResponse - * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null} [v0] WaitForStateTransitionResultResponse v0 - */ - - /** - * Constructs a new WaitForStateTransitionResultResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a WaitForStateTransitionResultResponse. - * @implements IWaitForStateTransitionResultResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set - */ - function WaitForStateTransitionResultResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitForStateTransitionResultResponse v0. - * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @instance - */ - WaitForStateTransitionResultResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WaitForStateTransitionResultResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @instance - */ - Object.defineProperty(WaitForStateTransitionResultResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WaitForStateTransitionResultResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse instance - */ - WaitForStateTransitionResultResponse.create = function create(properties) { - return new WaitForStateTransitionResultResponse(properties); - }; - - /** - * Encodes the specified WaitForStateTransitionResultResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitForStateTransitionResultResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitForStateTransitionResultResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitForStateTransitionResultResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a WaitForStateTransitionResultResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse - */ - WaitForStateTransitionResultResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a WaitForStateTransitionResultResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitForStateTransitionResultResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this WaitForStateTransitionResultResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @instance - * @returns {Object.} JSON object - */ - WaitForStateTransitionResultResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 = (function() { - - /** - * Properties of a WaitForStateTransitionResultResponseV0. - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @interface IWaitForStateTransitionResultResponseV0 - * @property {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null} [error] WaitForStateTransitionResultResponseV0 error - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] WaitForStateTransitionResultResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] WaitForStateTransitionResultResponseV0 metadata - */ - - /** - * Constructs a new WaitForStateTransitionResultResponseV0. - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @classdesc Represents a WaitForStateTransitionResultResponseV0. - * @implements IWaitForStateTransitionResultResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set - */ - function WaitForStateTransitionResultResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitForStateTransitionResultResponseV0 error. - * @member {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null|undefined} error - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - */ - WaitForStateTransitionResultResponseV0.prototype.error = null; - - /** - * WaitForStateTransitionResultResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - */ - WaitForStateTransitionResultResponseV0.prototype.proof = null; - - /** - * WaitForStateTransitionResultResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - */ - WaitForStateTransitionResultResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WaitForStateTransitionResultResponseV0 result. - * @member {"error"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - */ - Object.defineProperty(WaitForStateTransitionResultResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WaitForStateTransitionResultResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 instance - */ - WaitForStateTransitionResultResponseV0.create = function create(properties) { - return new WaitForStateTransitionResultResponseV0(properties); - }; - - /** - * Encodes the specified WaitForStateTransitionResultResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitForStateTransitionResultResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitForStateTransitionResultResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitForStateTransitionResultResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a WaitForStateTransitionResultResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 - */ - WaitForStateTransitionResultResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.error: object expected"); - message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.fromObject(object.error); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a WaitForStateTransitionResultResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitForStateTransitionResultResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this WaitForStateTransitionResultResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - * @returns {Object.} JSON object - */ - WaitForStateTransitionResultResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WaitForStateTransitionResultResponseV0; - })(); - - return WaitForStateTransitionResultResponse; - })(); - - v0.GetConsensusParamsRequest = (function() { - - /** - * Properties of a GetConsensusParamsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetConsensusParamsRequest - * @property {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null} [v0] GetConsensusParamsRequest v0 - */ - - /** - * Constructs a new GetConsensusParamsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetConsensusParamsRequest. - * @implements IGetConsensusParamsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set - */ - function GetConsensusParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConsensusParamsRequest v0. - * @member {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @instance - */ - GetConsensusParamsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetConsensusParamsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @instance - */ - Object.defineProperty(GetConsensusParamsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetConsensusParamsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest instance - */ - GetConsensusParamsRequest.create = function create(properties) { - return new GetConsensusParamsRequest(properties); - }; - - /** - * Encodes the specified GetConsensusParamsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetConsensusParamsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConsensusParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConsensusParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConsensusParamsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConsensusParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetConsensusParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest - */ - GetConsensusParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetConsensusParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest} message GetConsensusParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConsensusParamsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetConsensusParamsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @instance - * @returns {Object.} JSON object - */ - GetConsensusParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetConsensusParamsRequest.GetConsensusParamsRequestV0 = (function() { - - /** - * Properties of a GetConsensusParamsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @interface IGetConsensusParamsRequestV0 - * @property {number|null} [height] GetConsensusParamsRequestV0 height - * @property {boolean|null} [prove] GetConsensusParamsRequestV0 prove - */ - - /** - * Constructs a new GetConsensusParamsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @classdesc Represents a GetConsensusParamsRequestV0. - * @implements IGetConsensusParamsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set - */ - function GetConsensusParamsRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConsensusParamsRequestV0 height. - * @member {number} height - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @instance - */ - GetConsensusParamsRequestV0.prototype.height = 0; - - /** - * GetConsensusParamsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @instance - */ - GetConsensusParamsRequestV0.prototype.prove = false; - - /** - * Creates a new GetConsensusParamsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 instance - */ - GetConsensusParamsRequestV0.create = function create(properties) { - return new GetConsensusParamsRequestV0(properties); - }; - - /** - * Encodes the specified GetConsensusParamsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.height); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetConsensusParamsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int32(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConsensusParamsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConsensusParamsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetConsensusParamsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 - */ - GetConsensusParamsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); - if (object.height != null) - message.height = object.height | 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetConsensusParamsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConsensusParamsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.height = 0; - object.prove = false; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetConsensusParamsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetConsensusParamsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetConsensusParamsRequestV0; - })(); - - return GetConsensusParamsRequest; - })(); - - v0.GetConsensusParamsResponse = (function() { - - /** - * Properties of a GetConsensusParamsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetConsensusParamsResponse - * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null} [v0] GetConsensusParamsResponse v0 - */ - - /** - * Constructs a new GetConsensusParamsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetConsensusParamsResponse. - * @implements IGetConsensusParamsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set - */ - function GetConsensusParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConsensusParamsResponse v0. - * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @instance - */ - GetConsensusParamsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetConsensusParamsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @instance - */ - Object.defineProperty(GetConsensusParamsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetConsensusParamsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse instance - */ - GetConsensusParamsResponse.create = function create(properties) { - return new GetConsensusParamsResponse(properties); - }; - - /** - * Encodes the specified GetConsensusParamsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetConsensusParamsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConsensusParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConsensusParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConsensusParamsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConsensusParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetConsensusParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse - */ - GetConsensusParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetConsensusParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} message GetConsensusParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConsensusParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetConsensusParamsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @instance - * @returns {Object.} JSON object - */ - GetConsensusParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetConsensusParamsResponse.ConsensusParamsBlock = (function() { - - /** - * Properties of a ConsensusParamsBlock. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @interface IConsensusParamsBlock - * @property {string|null} [maxBytes] ConsensusParamsBlock maxBytes - * @property {string|null} [maxGas] ConsensusParamsBlock maxGas - * @property {string|null} [timeIotaMs] ConsensusParamsBlock timeIotaMs - */ - - /** - * Constructs a new ConsensusParamsBlock. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @classdesc Represents a ConsensusParamsBlock. - * @implements IConsensusParamsBlock - * @constructor - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set - */ - function ConsensusParamsBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusParamsBlock maxBytes. - * @member {string} maxBytes - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @instance - */ - ConsensusParamsBlock.prototype.maxBytes = ""; - - /** - * ConsensusParamsBlock maxGas. - * @member {string} maxGas - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @instance - */ - ConsensusParamsBlock.prototype.maxGas = ""; - - /** - * ConsensusParamsBlock timeIotaMs. - * @member {string} timeIotaMs - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @instance - */ - ConsensusParamsBlock.prototype.timeIotaMs = ""; - - /** - * Creates a new ConsensusParamsBlock instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock instance - */ - ConsensusParamsBlock.create = function create(properties) { - return new ConsensusParamsBlock(properties); - }; - - /** - * Encodes the specified ConsensusParamsBlock message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParamsBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxBytes); - if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxGas); - if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeIotaMs); - return writer; - }; - - /** - * Encodes the specified ConsensusParamsBlock message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParamsBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusParamsBlock message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParamsBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.maxBytes = reader.string(); - break; - case 2: - message.maxGas = reader.string(); - break; - case 3: - message.timeIotaMs = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusParamsBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParamsBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusParamsBlock message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusParamsBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - if (!$util.isString(message.maxBytes)) - return "maxBytes: string expected"; - if (message.maxGas != null && message.hasOwnProperty("maxGas")) - if (!$util.isString(message.maxGas)) - return "maxGas: string expected"; - if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) - if (!$util.isString(message.timeIotaMs)) - return "timeIotaMs: string expected"; - return null; - }; - - /** - * Creates a ConsensusParamsBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock - */ - ConsensusParamsBlock.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); - if (object.maxBytes != null) - message.maxBytes = String(object.maxBytes); - if (object.maxGas != null) - message.maxGas = String(object.maxGas); - if (object.timeIotaMs != null) - message.timeIotaMs = String(object.timeIotaMs); - return message; - }; - - /** - * Creates a plain object from a ConsensusParamsBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} message ConsensusParamsBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusParamsBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxBytes = ""; - object.maxGas = ""; - object.timeIotaMs = ""; - } - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - object.maxBytes = message.maxBytes; - if (message.maxGas != null && message.hasOwnProperty("maxGas")) - object.maxGas = message.maxGas; - if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) - object.timeIotaMs = message.timeIotaMs; - return object; - }; - - /** - * Converts this ConsensusParamsBlock to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @instance - * @returns {Object.} JSON object - */ - ConsensusParamsBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusParamsBlock; - })(); - - GetConsensusParamsResponse.ConsensusParamsEvidence = (function() { - - /** - * Properties of a ConsensusParamsEvidence. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @interface IConsensusParamsEvidence - * @property {string|null} [maxAgeNumBlocks] ConsensusParamsEvidence maxAgeNumBlocks - * @property {string|null} [maxAgeDuration] ConsensusParamsEvidence maxAgeDuration - * @property {string|null} [maxBytes] ConsensusParamsEvidence maxBytes - */ - - /** - * Constructs a new ConsensusParamsEvidence. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @classdesc Represents a ConsensusParamsEvidence. - * @implements IConsensusParamsEvidence - * @constructor - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set - */ - function ConsensusParamsEvidence(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusParamsEvidence maxAgeNumBlocks. - * @member {string} maxAgeNumBlocks - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @instance - */ - ConsensusParamsEvidence.prototype.maxAgeNumBlocks = ""; - - /** - * ConsensusParamsEvidence maxAgeDuration. - * @member {string} maxAgeDuration - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @instance - */ - ConsensusParamsEvidence.prototype.maxAgeDuration = ""; - - /** - * ConsensusParamsEvidence maxBytes. - * @member {string} maxBytes - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @instance - */ - ConsensusParamsEvidence.prototype.maxBytes = ""; - - /** - * Creates a new ConsensusParamsEvidence instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence instance - */ - ConsensusParamsEvidence.create = function create(properties) { - return new ConsensusParamsEvidence(properties); - }; - - /** - * Encodes the specified ConsensusParamsEvidence message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParamsEvidence.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxAgeNumBlocks); - if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxAgeDuration); - if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxBytes); - return writer; - }; - - /** - * Encodes the specified ConsensusParamsEvidence message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParamsEvidence.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusParamsEvidence message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParamsEvidence.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.maxAgeNumBlocks = reader.string(); - break; - case 2: - message.maxAgeDuration = reader.string(); - break; - case 3: - message.maxBytes = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusParamsEvidence message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParamsEvidence.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusParamsEvidence message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusParamsEvidence.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) - if (!$util.isString(message.maxAgeNumBlocks)) - return "maxAgeNumBlocks: string expected"; - if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) - if (!$util.isString(message.maxAgeDuration)) - return "maxAgeDuration: string expected"; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - if (!$util.isString(message.maxBytes)) - return "maxBytes: string expected"; - return null; - }; - - /** - * Creates a ConsensusParamsEvidence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence - */ - ConsensusParamsEvidence.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); - if (object.maxAgeNumBlocks != null) - message.maxAgeNumBlocks = String(object.maxAgeNumBlocks); - if (object.maxAgeDuration != null) - message.maxAgeDuration = String(object.maxAgeDuration); - if (object.maxBytes != null) - message.maxBytes = String(object.maxBytes); - return message; - }; - - /** - * Creates a plain object from a ConsensusParamsEvidence message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} message ConsensusParamsEvidence - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusParamsEvidence.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxAgeNumBlocks = ""; - object.maxAgeDuration = ""; - object.maxBytes = ""; - } - if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) - object.maxAgeNumBlocks = message.maxAgeNumBlocks; - if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) - object.maxAgeDuration = message.maxAgeDuration; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - object.maxBytes = message.maxBytes; - return object; - }; - - /** - * Converts this ConsensusParamsEvidence to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @instance - * @returns {Object.} JSON object - */ - ConsensusParamsEvidence.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusParamsEvidence; - })(); - - GetConsensusParamsResponse.GetConsensusParamsResponseV0 = (function() { - - /** - * Properties of a GetConsensusParamsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @interface IGetConsensusParamsResponseV0 - * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null} [block] GetConsensusParamsResponseV0 block - * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null} [evidence] GetConsensusParamsResponseV0 evidence - */ - - /** - * Constructs a new GetConsensusParamsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @classdesc Represents a GetConsensusParamsResponseV0. - * @implements IGetConsensusParamsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set - */ - function GetConsensusParamsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConsensusParamsResponseV0 block. - * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null|undefined} block - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @instance - */ - GetConsensusParamsResponseV0.prototype.block = null; - - /** - * GetConsensusParamsResponseV0 evidence. - * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null|undefined} evidence - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @instance - */ - GetConsensusParamsResponseV0.prototype.evidence = null; - - /** - * Creates a new GetConsensusParamsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 instance - */ - GetConsensusParamsResponseV0.create = function create(properties) { - return new GetConsensusParamsResponseV0(properties); - }; - - /** - * Encodes the specified GetConsensusParamsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) - $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetConsensusParamsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConsensusParamsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConsensusParamsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) { - var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify(message.block); - if (error) - return "block." + error; - } - if (message.evidence != null && message.hasOwnProperty("evidence")) { - var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify(message.evidence); - if (error) - return "evidence." + error; - } - return null; - }; - - /** - * Creates a GetConsensusParamsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 - */ - GetConsensusParamsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); - if (object.block != null) { - if (typeof object.block !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.block: object expected"); - message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.fromObject(object.block); - } - if (object.evidence != null) { - if (typeof object.evidence !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.evidence: object expected"); - message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.fromObject(object.evidence); - } - return message; - }; - - /** - * Creates a plain object from a GetConsensusParamsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConsensusParamsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.block = null; - object.evidence = null; - } - if (message.block != null && message.hasOwnProperty("block")) - object.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.toObject(message.block, options); - if (message.evidence != null && message.hasOwnProperty("evidence")) - object.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.toObject(message.evidence, options); - return object; - }; - - /** - * Converts this GetConsensusParamsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetConsensusParamsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetConsensusParamsResponseV0; - })(); - - return GetConsensusParamsResponse; - })(); - - v0.GetProtocolVersionUpgradeStateRequest = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeStateRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProtocolVersionUpgradeStateRequest - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null} [v0] GetProtocolVersionUpgradeStateRequest v0 - */ - - /** - * Constructs a new GetProtocolVersionUpgradeStateRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProtocolVersionUpgradeStateRequest. - * @implements IGetProtocolVersionUpgradeStateRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeStateRequest v0. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @instance - */ - GetProtocolVersionUpgradeStateRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeStateRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeStateRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeStateRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest instance - */ - GetProtocolVersionUpgradeStateRequest.create = function create(properties) { - return new GetProtocolVersionUpgradeStateRequest(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeStateRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest - */ - GetProtocolVersionUpgradeStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeStateRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeStateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @interface IGetProtocolVersionUpgradeStateRequestV0 - * @property {boolean|null} [prove] GetProtocolVersionUpgradeStateRequestV0 prove - */ - - /** - * Constructs a new GetProtocolVersionUpgradeStateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @classdesc Represents a GetProtocolVersionUpgradeStateRequestV0. - * @implements IGetProtocolVersionUpgradeStateRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeStateRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeStateRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @instance - */ - GetProtocolVersionUpgradeStateRequestV0.prototype.prove = false; - - /** - * Creates a new GetProtocolVersionUpgradeStateRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 instance - */ - GetProtocolVersionUpgradeStateRequestV0.create = function create(properties) { - return new GetProtocolVersionUpgradeStateRequestV0(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeStateRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeStateRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeStateRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 - */ - GetProtocolVersionUpgradeStateRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeStateRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeStateRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.prove = false; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeStateRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeStateRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetProtocolVersionUpgradeStateRequestV0; - })(); - - return GetProtocolVersionUpgradeStateRequest; - })(); - - v0.GetProtocolVersionUpgradeStateResponse = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeStateResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProtocolVersionUpgradeStateResponse - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null} [v0] GetProtocolVersionUpgradeStateResponse v0 - */ - - /** - * Constructs a new GetProtocolVersionUpgradeStateResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProtocolVersionUpgradeStateResponse. - * @implements IGetProtocolVersionUpgradeStateResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeStateResponse v0. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @instance - */ - GetProtocolVersionUpgradeStateResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeStateResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeStateResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeStateResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse instance - */ - GetProtocolVersionUpgradeStateResponse.create = function create(properties) { - return new GetProtocolVersionUpgradeStateResponse(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeStateResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse - */ - GetProtocolVersionUpgradeStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeStateResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeStateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @interface IGetProtocolVersionUpgradeStateResponseV0 - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null} [versions] GetProtocolVersionUpgradeStateResponseV0 versions - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeStateResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeStateResponseV0 metadata - */ - - /** - * Constructs a new GetProtocolVersionUpgradeStateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @classdesc Represents a GetProtocolVersionUpgradeStateResponseV0. - * @implements IGetProtocolVersionUpgradeStateResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeStateResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeStateResponseV0 versions. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null|undefined} versions - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - */ - GetProtocolVersionUpgradeStateResponseV0.prototype.versions = null; - - /** - * GetProtocolVersionUpgradeStateResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - */ - GetProtocolVersionUpgradeStateResponseV0.prototype.proof = null; - - /** - * GetProtocolVersionUpgradeStateResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - */ - GetProtocolVersionUpgradeStateResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeStateResponseV0 result. - * @member {"versions"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeStateResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeStateResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 instance - */ - GetProtocolVersionUpgradeStateResponseV0.create = function create(properties) { - return new GetProtocolVersionUpgradeStateResponseV0(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeStateResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeStateResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.versions != null && message.hasOwnProperty("versions")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify(message.versions); - if (error) - return "versions." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeStateResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 - */ - GetProtocolVersionUpgradeStateResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); - if (object.versions != null) { - if (typeof object.versions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.versions: object expected"); - message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.fromObject(object.versions); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeStateResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeStateResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.versions != null && message.hasOwnProperty("versions")) { - object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.toObject(message.versions, options); - if (options.oneofs) - object.result = "versions"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeStateResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeStateResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeStateResponseV0.Versions = (function() { - - /** - * Properties of a Versions. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @interface IVersions - * @property {Array.|null} [versions] Versions versions - */ - - /** - * Constructs a new Versions. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @classdesc Represents a Versions. - * @implements IVersions - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set - */ - function Versions(properties) { - this.versions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Versions versions. - * @member {Array.} versions - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @instance - */ - Versions.prototype.versions = $util.emptyArray; - - /** - * Creates a new Versions instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions instance - */ - Versions.create = function create(properties) { - return new Versions(properties); - }; - - /** - * Encodes the specified Versions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Versions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versions != null && message.versions.length) - for (var i = 0; i < message.versions.length; ++i) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.encode(message.versions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Versions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Versions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Versions message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Versions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Versions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Versions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Versions message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Versions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (var i = 0; i < message.versions.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify(message.versions[i]); - if (error) - return "versions." + error; - } - } - return null; - }; - - /** - * Creates a Versions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions - */ - Versions.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: array expected"); - message.versions = []; - for (var i = 0; i < object.versions.length; ++i) { - if (typeof object.versions[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: object expected"); - message.versions[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.fromObject(object.versions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Versions message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} message Versions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Versions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (message.versions && message.versions.length) { - object.versions = []; - for (var j = 0; j < message.versions.length; ++j) - object.versions[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.toObject(message.versions[j], options); - } - return object; - }; - - /** - * Converts this Versions to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @instance - * @returns {Object.} JSON object - */ - Versions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Versions; - })(); - - GetProtocolVersionUpgradeStateResponseV0.VersionEntry = (function() { - - /** - * Properties of a VersionEntry. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @interface IVersionEntry - * @property {number|null} [versionNumber] VersionEntry versionNumber - * @property {number|null} [voteCount] VersionEntry voteCount - */ - - /** - * Constructs a new VersionEntry. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @classdesc Represents a VersionEntry. - * @implements IVersionEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set - */ - function VersionEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionEntry versionNumber. - * @member {number} versionNumber - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @instance - */ - VersionEntry.prototype.versionNumber = 0; - - /** - * VersionEntry voteCount. - * @member {number} voteCount - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @instance - */ - VersionEntry.prototype.voteCount = 0; - - /** - * Creates a new VersionEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry instance - */ - VersionEntry.create = function create(properties) { - return new VersionEntry(properties); - }; - - /** - * Encodes the specified VersionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.versionNumber); - if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); - return writer; - }; - - /** - * Encodes the specified VersionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.versionNumber = reader.uint32(); - break; - case 2: - message.voteCount = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) - if (!$util.isInteger(message.versionNumber)) - return "versionNumber: integer expected"; - if (message.voteCount != null && message.hasOwnProperty("voteCount")) - if (!$util.isInteger(message.voteCount)) - return "voteCount: integer expected"; - return null; - }; - - /** - * Creates a VersionEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry - */ - VersionEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); - if (object.versionNumber != null) - message.versionNumber = object.versionNumber >>> 0; - if (object.voteCount != null) - message.voteCount = object.voteCount >>> 0; - return message; - }; - - /** - * Creates a plain object from a VersionEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} message VersionEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.versionNumber = 0; - object.voteCount = 0; - } - if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) - object.versionNumber = message.versionNumber; - if (message.voteCount != null && message.hasOwnProperty("voteCount")) - object.voteCount = message.voteCount; - return object; - }; - - /** - * Converts this VersionEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @instance - * @returns {Object.} JSON object - */ - VersionEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VersionEntry; - })(); - - return GetProtocolVersionUpgradeStateResponseV0; - })(); - - return GetProtocolVersionUpgradeStateResponse; - })(); - - v0.GetProtocolVersionUpgradeVoteStatusRequest = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeVoteStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProtocolVersionUpgradeVoteStatusRequest - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null} [v0] GetProtocolVersionUpgradeVoteStatusRequest v0 - */ - - /** - * Constructs a new GetProtocolVersionUpgradeVoteStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequest. - * @implements IGetProtocolVersionUpgradeVoteStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeVoteStatusRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeVoteStatusRequest v0. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @instance - */ - GetProtocolVersionUpgradeVoteStatusRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeVoteStatusRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeVoteStatusRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeVoteStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest instance - */ - GetProtocolVersionUpgradeVoteStatusRequest.create = function create(properties) { - return new GetProtocolVersionUpgradeVoteStatusRequest(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeVoteStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeVoteStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeVoteStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest - */ - GetProtocolVersionUpgradeVoteStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeVoteStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeVoteStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeVoteStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeVoteStatusRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @interface IGetProtocolVersionUpgradeVoteStatusRequestV0 - * @property {Uint8Array|null} [startProTxHash] GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash - * @property {number|null} [count] GetProtocolVersionUpgradeVoteStatusRequestV0 count - * @property {boolean|null} [prove] GetProtocolVersionUpgradeVoteStatusRequestV0 prove - */ - - /** - * Constructs a new GetProtocolVersionUpgradeVoteStatusRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequestV0. - * @implements IGetProtocolVersionUpgradeVoteStatusRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeVoteStatusRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash. - * @member {Uint8Array} startProTxHash - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.startProTxHash = $util.newBuffer([]); - - /** - * GetProtocolVersionUpgradeVoteStatusRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.count = 0; - - /** - * GetProtocolVersionUpgradeVoteStatusRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.prove = false; - - /** - * Creates a new GetProtocolVersionUpgradeVoteStatusRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 instance - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.create = function create(properties) { - return new GetProtocolVersionUpgradeVoteStatusRequestV0(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startProTxHash != null && Object.hasOwnProperty.call(message, "startProTxHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startProTxHash); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startProTxHash = reader.bytes(); - break; - case 2: - message.count = reader.uint32(); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeVoteStatusRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) - if (!(message.startProTxHash && typeof message.startProTxHash.length === "number" || $util.isString(message.startProTxHash))) - return "startProTxHash: buffer expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeVoteStatusRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); - if (object.startProTxHash != null) - if (typeof object.startProTxHash === "string") - $util.base64.decode(object.startProTxHash, message.startProTxHash = $util.newBuffer($util.base64.length(object.startProTxHash)), 0); - else if (object.startProTxHash.length >= 0) - message.startProTxHash = object.startProTxHash; - if (object.count != null) - message.count = object.count >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startProTxHash = ""; - else { - object.startProTxHash = []; - if (options.bytes !== Array) - object.startProTxHash = $util.newBuffer(object.startProTxHash); - } - object.count = 0; - object.prove = false; - } - if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) - object.startProTxHash = options.bytes === String ? $util.base64.encode(message.startProTxHash, 0, message.startProTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.startProTxHash) : message.startProTxHash; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeVoteStatusRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetProtocolVersionUpgradeVoteStatusRequestV0; - })(); - - return GetProtocolVersionUpgradeVoteStatusRequest; - })(); - - v0.GetProtocolVersionUpgradeVoteStatusResponse = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeVoteStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProtocolVersionUpgradeVoteStatusResponse - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null} [v0] GetProtocolVersionUpgradeVoteStatusResponse v0 - */ - - /** - * Constructs a new GetProtocolVersionUpgradeVoteStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponse. - * @implements IGetProtocolVersionUpgradeVoteStatusResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeVoteStatusResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeVoteStatusResponse v0. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @instance - */ - GetProtocolVersionUpgradeVoteStatusResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeVoteStatusResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeVoteStatusResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse instance - */ - GetProtocolVersionUpgradeVoteStatusResponse.create = function create(properties) { - return new GetProtocolVersionUpgradeVoteStatusResponse(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeVoteStatusResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeVoteStatusResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeVoteStatusResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse - */ - GetProtocolVersionUpgradeVoteStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeVoteStatusResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeVoteStatusResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeVoteStatusResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeVoteStatusResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @interface IGetProtocolVersionUpgradeVoteStatusResponseV0 - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null} [versions] GetProtocolVersionUpgradeVoteStatusResponseV0 versions - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeVoteStatusResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeVoteStatusResponseV0 metadata - */ - - /** - * Constructs a new GetProtocolVersionUpgradeVoteStatusResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponseV0. - * @implements IGetProtocolVersionUpgradeVoteStatusResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeVoteStatusResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeVoteStatusResponseV0 versions. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null|undefined} versions - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.versions = null; - - /** - * GetProtocolVersionUpgradeVoteStatusResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.proof = null; - - /** - * GetProtocolVersionUpgradeVoteStatusResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeVoteStatusResponseV0 result. - * @member {"versions"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeVoteStatusResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 instance - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.create = function create(properties) { - return new GetProtocolVersionUpgradeVoteStatusResponseV0(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeVoteStatusResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.versions != null && message.hasOwnProperty("versions")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify(message.versions); - if (error) - return "versions." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeVoteStatusResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); - if (object.versions != null) { - if (typeof object.versions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.versions: object expected"); - message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.fromObject(object.versions); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.versions != null && message.hasOwnProperty("versions")) { - object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.toObject(message.versions, options); - if (options.oneofs) - object.result = "versions"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeVoteStatusResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals = (function() { - - /** - * Properties of a VersionSignals. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @interface IVersionSignals - * @property {Array.|null} [versionSignals] VersionSignals versionSignals - */ - - /** - * Constructs a new VersionSignals. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @classdesc Represents a VersionSignals. - * @implements IVersionSignals - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set - */ - function VersionSignals(properties) { - this.versionSignals = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionSignals versionSignals. - * @member {Array.} versionSignals - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @instance - */ - VersionSignals.prototype.versionSignals = $util.emptyArray; - - /** - * Creates a new VersionSignals instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals instance - */ - VersionSignals.create = function create(properties) { - return new VersionSignals(properties); - }; - - /** - * Encodes the specified VersionSignals message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionSignals.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versionSignals != null && message.versionSignals.length) - for (var i = 0; i < message.versionSignals.length; ++i) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.encode(message.versionSignals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VersionSignals message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionSignals.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionSignals message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionSignals.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.versionSignals && message.versionSignals.length)) - message.versionSignals = []; - message.versionSignals.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionSignals message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionSignals.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionSignals message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionSignals.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.versionSignals != null && message.hasOwnProperty("versionSignals")) { - if (!Array.isArray(message.versionSignals)) - return "versionSignals: array expected"; - for (var i = 0; i < message.versionSignals.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify(message.versionSignals[i]); - if (error) - return "versionSignals." + error; - } - } - return null; - }; - - /** - * Creates a VersionSignals message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals - */ - VersionSignals.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); - if (object.versionSignals) { - if (!Array.isArray(object.versionSignals)) - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: array expected"); - message.versionSignals = []; - for (var i = 0; i < object.versionSignals.length; ++i) { - if (typeof object.versionSignals[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: object expected"); - message.versionSignals[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.fromObject(object.versionSignals[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a VersionSignals message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} message VersionSignals - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionSignals.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versionSignals = []; - if (message.versionSignals && message.versionSignals.length) { - object.versionSignals = []; - for (var j = 0; j < message.versionSignals.length; ++j) - object.versionSignals[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.toObject(message.versionSignals[j], options); - } - return object; - }; - - /** - * Converts this VersionSignals to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @instance - * @returns {Object.} JSON object - */ - VersionSignals.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VersionSignals; - })(); - - GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal = (function() { - - /** - * Properties of a VersionSignal. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @interface IVersionSignal - * @property {Uint8Array|null} [proTxHash] VersionSignal proTxHash - * @property {number|null} [version] VersionSignal version - */ - - /** - * Constructs a new VersionSignal. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @classdesc Represents a VersionSignal. - * @implements IVersionSignal - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set - */ - function VersionSignal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionSignal proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @instance - */ - VersionSignal.prototype.proTxHash = $util.newBuffer([]); - - /** - * VersionSignal version. - * @member {number} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @instance - */ - VersionSignal.prototype.version = 0; - - /** - * Creates a new VersionSignal instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal instance - */ - VersionSignal.create = function create(properties) { - return new VersionSignal(properties); - }; - - /** - * Encodes the specified VersionSignal message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionSignal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.version); - return writer; - }; - - /** - * Encodes the specified VersionSignal message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionSignal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionSignal message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionSignal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proTxHash = reader.bytes(); - break; - case 2: - message.version = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionSignal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionSignal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionSignal message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionSignal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - return null; - }; - - /** - * Creates a VersionSignal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal - */ - VersionSignal.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - if (object.version != null) - message.version = object.version >>> 0; - return message; - }; - - /** - * Creates a plain object from a VersionSignal message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} message VersionSignal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionSignal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - object.version = 0; - } - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this VersionSignal to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @instance - * @returns {Object.} JSON object - */ - VersionSignal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VersionSignal; - })(); - - return GetProtocolVersionUpgradeVoteStatusResponseV0; - })(); - - return GetProtocolVersionUpgradeVoteStatusResponse; - })(); - - v0.GetEpochsInfoRequest = (function() { - - /** - * Properties of a GetEpochsInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEpochsInfoRequest - * @property {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null} [v0] GetEpochsInfoRequest v0 - */ - - /** - * Constructs a new GetEpochsInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEpochsInfoRequest. - * @implements IGetEpochsInfoRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set - */ - function GetEpochsInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEpochsInfoRequest v0. - * @member {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @instance - */ - GetEpochsInfoRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEpochsInfoRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @instance - */ - Object.defineProperty(GetEpochsInfoRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEpochsInfoRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest instance - */ - GetEpochsInfoRequest.create = function create(properties) { - return new GetEpochsInfoRequest(properties); - }; - - /** - * Encodes the specified GetEpochsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEpochsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEpochsInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEpochsInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEpochsInfoRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEpochsInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEpochsInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest - */ - GetEpochsInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEpochsInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest} message GetEpochsInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEpochsInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEpochsInfoRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetEpochsInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEpochsInfoRequest.GetEpochsInfoRequestV0 = (function() { - - /** - * Properties of a GetEpochsInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @interface IGetEpochsInfoRequestV0 - * @property {google.protobuf.IUInt32Value|null} [startEpoch] GetEpochsInfoRequestV0 startEpoch - * @property {number|null} [count] GetEpochsInfoRequestV0 count - * @property {boolean|null} [ascending] GetEpochsInfoRequestV0 ascending - * @property {boolean|null} [prove] GetEpochsInfoRequestV0 prove - */ - - /** - * Constructs a new GetEpochsInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @classdesc Represents a GetEpochsInfoRequestV0. - * @implements IGetEpochsInfoRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set - */ - function GetEpochsInfoRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEpochsInfoRequestV0 startEpoch. - * @member {google.protobuf.IUInt32Value|null|undefined} startEpoch - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - */ - GetEpochsInfoRequestV0.prototype.startEpoch = null; - - /** - * GetEpochsInfoRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - */ - GetEpochsInfoRequestV0.prototype.count = 0; - - /** - * GetEpochsInfoRequestV0 ascending. - * @member {boolean} ascending - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - */ - GetEpochsInfoRequestV0.prototype.ascending = false; - - /** - * GetEpochsInfoRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - */ - GetEpochsInfoRequestV0.prototype.prove = false; - - /** - * Creates a new GetEpochsInfoRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 instance - */ - GetEpochsInfoRequestV0.create = function create(properties) { - return new GetEpochsInfoRequestV0(properties); - }; - - /** - * Encodes the specified GetEpochsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startEpoch != null && Object.hasOwnProperty.call(message, "startEpoch")) - $root.google.protobuf.UInt32Value.encode(message.startEpoch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); - if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ascending); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetEpochsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startEpoch = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.uint32(); - break; - case 3: - message.ascending = reader.bool(); - break; - case 4: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEpochsInfoRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEpochsInfoRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) { - var error = $root.google.protobuf.UInt32Value.verify(message.startEpoch); - if (error) - return "startEpoch." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.ascending != null && message.hasOwnProperty("ascending")) - if (typeof message.ascending !== "boolean") - return "ascending: boolean expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetEpochsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 - */ - GetEpochsInfoRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); - if (object.startEpoch != null) { - if (typeof object.startEpoch !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.startEpoch: object expected"); - message.startEpoch = $root.google.protobuf.UInt32Value.fromObject(object.startEpoch); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.ascending != null) - message.ascending = Boolean(object.ascending); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetEpochsInfoRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEpochsInfoRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startEpoch = null; - object.count = 0; - object.ascending = false; - object.prove = false; - } - if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) - object.startEpoch = $root.google.protobuf.UInt32Value.toObject(message.startEpoch, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.ascending != null && message.hasOwnProperty("ascending")) - object.ascending = message.ascending; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetEpochsInfoRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetEpochsInfoRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetEpochsInfoRequestV0; - })(); - - return GetEpochsInfoRequest; - })(); - - v0.GetEpochsInfoResponse = (function() { - - /** - * Properties of a GetEpochsInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEpochsInfoResponse - * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null} [v0] GetEpochsInfoResponse v0 - */ - - /** - * Constructs a new GetEpochsInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEpochsInfoResponse. - * @implements IGetEpochsInfoResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set - */ - function GetEpochsInfoResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEpochsInfoResponse v0. - * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @instance - */ - GetEpochsInfoResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEpochsInfoResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @instance - */ - Object.defineProperty(GetEpochsInfoResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEpochsInfoResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse instance - */ - GetEpochsInfoResponse.create = function create(properties) { - return new GetEpochsInfoResponse(properties); - }; - - /** - * Encodes the specified GetEpochsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEpochsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEpochsInfoResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEpochsInfoResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEpochsInfoResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEpochsInfoResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEpochsInfoResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse - */ - GetEpochsInfoResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEpochsInfoResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} message GetEpochsInfoResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEpochsInfoResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEpochsInfoResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @instance - * @returns {Object.} JSON object - */ - GetEpochsInfoResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEpochsInfoResponse.GetEpochsInfoResponseV0 = (function() { - - /** - * Properties of a GetEpochsInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @interface IGetEpochsInfoResponseV0 - * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null} [epochs] GetEpochsInfoResponseV0 epochs - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEpochsInfoResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEpochsInfoResponseV0 metadata - */ - - /** - * Constructs a new GetEpochsInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @classdesc Represents a GetEpochsInfoResponseV0. - * @implements IGetEpochsInfoResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set - */ - function GetEpochsInfoResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEpochsInfoResponseV0 epochs. - * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null|undefined} epochs - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - */ - GetEpochsInfoResponseV0.prototype.epochs = null; - - /** - * GetEpochsInfoResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - */ - GetEpochsInfoResponseV0.prototype.proof = null; - - /** - * GetEpochsInfoResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - */ - GetEpochsInfoResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEpochsInfoResponseV0 result. - * @member {"epochs"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - */ - Object.defineProperty(GetEpochsInfoResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["epochs", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEpochsInfoResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 instance - */ - GetEpochsInfoResponseV0.create = function create(properties) { - return new GetEpochsInfoResponseV0(properties); - }; - - /** - * Encodes the specified GetEpochsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.epochs != null && Object.hasOwnProperty.call(message, "epochs")) - $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.encode(message.epochs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEpochsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEpochsInfoResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEpochsInfoResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.epochs != null && message.hasOwnProperty("epochs")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify(message.epochs); - if (error) - return "epochs." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetEpochsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 - */ - GetEpochsInfoResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); - if (object.epochs != null) { - if (typeof object.epochs !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.epochs: object expected"); - message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.fromObject(object.epochs); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetEpochsInfoResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEpochsInfoResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.epochs != null && message.hasOwnProperty("epochs")) { - object.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.toObject(message.epochs, options); - if (options.oneofs) - object.result = "epochs"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetEpochsInfoResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetEpochsInfoResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEpochsInfoResponseV0.EpochInfos = (function() { - - /** - * Properties of an EpochInfos. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @interface IEpochInfos - * @property {Array.|null} [epochInfos] EpochInfos epochInfos - */ - - /** - * Constructs a new EpochInfos. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @classdesc Represents an EpochInfos. - * @implements IEpochInfos - * @constructor - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set - */ - function EpochInfos(properties) { - this.epochInfos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EpochInfos epochInfos. - * @member {Array.} epochInfos - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @instance - */ - EpochInfos.prototype.epochInfos = $util.emptyArray; - - /** - * Creates a new EpochInfos instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos instance - */ - EpochInfos.create = function create(properties) { - return new EpochInfos(properties); - }; - - /** - * Encodes the specified EpochInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EpochInfos.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.epochInfos != null && message.epochInfos.length) - for (var i = 0; i < message.epochInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.encode(message.epochInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EpochInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EpochInfos.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EpochInfos message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EpochInfos.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.epochInfos && message.epochInfos.length)) - message.epochInfos = []; - message.epochInfos.push($root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EpochInfos message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EpochInfos.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EpochInfos message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EpochInfos.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.epochInfos != null && message.hasOwnProperty("epochInfos")) { - if (!Array.isArray(message.epochInfos)) - return "epochInfos: array expected"; - for (var i = 0; i < message.epochInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify(message.epochInfos[i]); - if (error) - return "epochInfos." + error; - } - } - return null; - }; - - /** - * Creates an EpochInfos message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos - */ - EpochInfos.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); - if (object.epochInfos) { - if (!Array.isArray(object.epochInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: array expected"); - message.epochInfos = []; - for (var i = 0; i < object.epochInfos.length; ++i) { - if (typeof object.epochInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: object expected"); - message.epochInfos[i] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.fromObject(object.epochInfos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EpochInfos message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} message EpochInfos - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EpochInfos.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.epochInfos = []; - if (message.epochInfos && message.epochInfos.length) { - object.epochInfos = []; - for (var j = 0; j < message.epochInfos.length; ++j) - object.epochInfos[j] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.toObject(message.epochInfos[j], options); - } - return object; - }; - - /** - * Converts this EpochInfos to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @instance - * @returns {Object.} JSON object - */ - EpochInfos.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EpochInfos; - })(); - - GetEpochsInfoResponseV0.EpochInfo = (function() { - - /** - * Properties of an EpochInfo. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @interface IEpochInfo - * @property {number|null} [number] EpochInfo number - * @property {number|Long|null} [firstBlockHeight] EpochInfo firstBlockHeight - * @property {number|null} [firstCoreBlockHeight] EpochInfo firstCoreBlockHeight - * @property {number|Long|null} [startTime] EpochInfo startTime - * @property {number|null} [feeMultiplier] EpochInfo feeMultiplier - * @property {number|null} [protocolVersion] EpochInfo protocolVersion - */ - - /** - * Constructs a new EpochInfo. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @classdesc Represents an EpochInfo. - * @implements IEpochInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set - */ - function EpochInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EpochInfo number. - * @member {number} number - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.number = 0; - - /** - * EpochInfo firstBlockHeight. - * @member {number|Long} firstBlockHeight - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.firstBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * EpochInfo firstCoreBlockHeight. - * @member {number} firstCoreBlockHeight - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.firstCoreBlockHeight = 0; - - /** - * EpochInfo startTime. - * @member {number|Long} startTime - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * EpochInfo feeMultiplier. - * @member {number} feeMultiplier - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.feeMultiplier = 0; - - /** - * EpochInfo protocolVersion. - * @member {number} protocolVersion - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.protocolVersion = 0; - - /** - * Creates a new EpochInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo instance - */ - EpochInfo.create = function create(properties) { - return new EpochInfo(properties); - }; - - /** - * Encodes the specified EpochInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EpochInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.number); - if (message.firstBlockHeight != null && Object.hasOwnProperty.call(message, "firstBlockHeight")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.firstBlockHeight); - if (message.firstCoreBlockHeight != null && Object.hasOwnProperty.call(message, "firstCoreBlockHeight")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.firstCoreBlockHeight); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startTime); - if (message.feeMultiplier != null && Object.hasOwnProperty.call(message, "feeMultiplier")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.feeMultiplier); - if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.protocolVersion); - return writer; - }; - - /** - * Encodes the specified EpochInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EpochInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EpochInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EpochInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.number = reader.uint32(); - break; - case 2: - message.firstBlockHeight = reader.uint64(); - break; - case 3: - message.firstCoreBlockHeight = reader.uint32(); - break; - case 4: - message.startTime = reader.uint64(); - break; - case 5: - message.feeMultiplier = reader.double(); - break; - case 6: - message.protocolVersion = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EpochInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EpochInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EpochInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EpochInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) - if (!$util.isInteger(message.firstBlockHeight) && !(message.firstBlockHeight && $util.isInteger(message.firstBlockHeight.low) && $util.isInteger(message.firstBlockHeight.high))) - return "firstBlockHeight: integer|Long expected"; - if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) - if (!$util.isInteger(message.firstCoreBlockHeight)) - return "firstCoreBlockHeight: integer expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) - if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) - return "startTime: integer|Long expected"; - if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) - if (typeof message.feeMultiplier !== "number") - return "feeMultiplier: number expected"; - if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) - if (!$util.isInteger(message.protocolVersion)) - return "protocolVersion: integer expected"; - return null; - }; - - /** - * Creates an EpochInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo - */ - EpochInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); - if (object.number != null) - message.number = object.number >>> 0; - if (object.firstBlockHeight != null) - if ($util.Long) - (message.firstBlockHeight = $util.Long.fromValue(object.firstBlockHeight)).unsigned = true; - else if (typeof object.firstBlockHeight === "string") - message.firstBlockHeight = parseInt(object.firstBlockHeight, 10); - else if (typeof object.firstBlockHeight === "number") - message.firstBlockHeight = object.firstBlockHeight; - else if (typeof object.firstBlockHeight === "object") - message.firstBlockHeight = new $util.LongBits(object.firstBlockHeight.low >>> 0, object.firstBlockHeight.high >>> 0).toNumber(true); - if (object.firstCoreBlockHeight != null) - message.firstCoreBlockHeight = object.firstCoreBlockHeight >>> 0; - if (object.startTime != null) - if ($util.Long) - (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = true; - else if (typeof object.startTime === "string") - message.startTime = parseInt(object.startTime, 10); - else if (typeof object.startTime === "number") - message.startTime = object.startTime; - else if (typeof object.startTime === "object") - message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(true); - if (object.feeMultiplier != null) - message.feeMultiplier = Number(object.feeMultiplier); - if (object.protocolVersion != null) - message.protocolVersion = object.protocolVersion >>> 0; - return message; - }; - - /** - * Creates a plain object from an EpochInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} message EpochInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EpochInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.firstBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.firstBlockHeight = options.longs === String ? "0" : 0; - object.firstCoreBlockHeight = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startTime = options.longs === String ? "0" : 0; - object.feeMultiplier = 0; - object.protocolVersion = 0; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) - if (typeof message.firstBlockHeight === "number") - object.firstBlockHeight = options.longs === String ? String(message.firstBlockHeight) : message.firstBlockHeight; - else - object.firstBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.firstBlockHeight) : options.longs === Number ? new $util.LongBits(message.firstBlockHeight.low >>> 0, message.firstBlockHeight.high >>> 0).toNumber(true) : message.firstBlockHeight; - if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) - object.firstCoreBlockHeight = message.firstCoreBlockHeight; - if (message.startTime != null && message.hasOwnProperty("startTime")) - if (typeof message.startTime === "number") - object.startTime = options.longs === String ? String(message.startTime) : message.startTime; - else - object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber(true) : message.startTime; - if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) - object.feeMultiplier = options.json && !isFinite(message.feeMultiplier) ? String(message.feeMultiplier) : message.feeMultiplier; - if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) - object.protocolVersion = message.protocolVersion; - return object; - }; - - /** - * Converts this EpochInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - * @returns {Object.} JSON object - */ - EpochInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EpochInfo; - })(); - - return GetEpochsInfoResponseV0; - })(); - - return GetEpochsInfoResponse; - })(); - - v0.GetContestedResourcesRequest = (function() { - - /** - * Properties of a GetContestedResourcesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourcesRequest - * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null} [v0] GetContestedResourcesRequest v0 - */ - - /** - * Constructs a new GetContestedResourcesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourcesRequest. - * @implements IGetContestedResourcesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set - */ - function GetContestedResourcesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourcesRequest v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @instance - */ - GetContestedResourcesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourcesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @instance - */ - Object.defineProperty(GetContestedResourcesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourcesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest instance - */ - GetContestedResourcesRequest.create = function create(properties) { - return new GetContestedResourcesRequest(properties); - }; - - /** - * Encodes the specified GetContestedResourcesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourcesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourcesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourcesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest - */ - GetContestedResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest} message GetContestedResourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourcesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourcesRequest.GetContestedResourcesRequestV0 = (function() { - - /** - * Properties of a GetContestedResourcesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @interface IGetContestedResourcesRequestV0 - * @property {Uint8Array|null} [contractId] GetContestedResourcesRequestV0 contractId - * @property {string|null} [documentTypeName] GetContestedResourcesRequestV0 documentTypeName - * @property {string|null} [indexName] GetContestedResourcesRequestV0 indexName - * @property {Array.|null} [startIndexValues] GetContestedResourcesRequestV0 startIndexValues - * @property {Array.|null} [endIndexValues] GetContestedResourcesRequestV0 endIndexValues - * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null} [startAtValueInfo] GetContestedResourcesRequestV0 startAtValueInfo - * @property {number|null} [count] GetContestedResourcesRequestV0 count - * @property {boolean|null} [orderAscending] GetContestedResourcesRequestV0 orderAscending - * @property {boolean|null} [prove] GetContestedResourcesRequestV0 prove - */ - - /** - * Constructs a new GetContestedResourcesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @classdesc Represents a GetContestedResourcesRequestV0. - * @implements IGetContestedResourcesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set - */ - function GetContestedResourcesRequestV0(properties) { - this.startIndexValues = []; - this.endIndexValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourcesRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetContestedResourcesRequestV0 documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.documentTypeName = ""; - - /** - * GetContestedResourcesRequestV0 indexName. - * @member {string} indexName - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.indexName = ""; - - /** - * GetContestedResourcesRequestV0 startIndexValues. - * @member {Array.} startIndexValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.startIndexValues = $util.emptyArray; - - /** - * GetContestedResourcesRequestV0 endIndexValues. - * @member {Array.} endIndexValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.endIndexValues = $util.emptyArray; - - /** - * GetContestedResourcesRequestV0 startAtValueInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null|undefined} startAtValueInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.startAtValueInfo = null; - - /** - * GetContestedResourcesRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.count = 0; - - /** - * GetContestedResourcesRequestV0 orderAscending. - * @member {boolean} orderAscending - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.orderAscending = false; - - /** - * GetContestedResourcesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.prove = false; - - /** - * Creates a new GetContestedResourcesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 instance - */ - GetContestedResourcesRequestV0.create = function create(properties) { - return new GetContestedResourcesRequestV0(properties); - }; - - /** - * Encodes the specified GetContestedResourcesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); - if (message.startIndexValues != null && message.startIndexValues.length) - for (var i = 0; i < message.startIndexValues.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startIndexValues[i]); - if (message.endIndexValues != null && message.endIndexValues.length) - for (var i = 0; i < message.endIndexValues.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.endIndexValues[i]); - if (message.startAtValueInfo != null && Object.hasOwnProperty.call(message, "startAtValueInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.encode(message.startAtValueInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); - if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetContestedResourcesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - message.indexName = reader.string(); - break; - case 4: - if (!(message.startIndexValues && message.startIndexValues.length)) - message.startIndexValues = []; - message.startIndexValues.push(reader.bytes()); - break; - case 5: - if (!(message.endIndexValues && message.endIndexValues.length)) - message.endIndexValues = []; - message.endIndexValues.push(reader.bytes()); - break; - case 6: - message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.decode(reader, reader.uint32()); - break; - case 7: - message.count = reader.uint32(); - break; - case 8: - message.orderAscending = reader.bool(); - break; - case 9: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourcesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourcesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.indexName != null && message.hasOwnProperty("indexName")) - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - if (message.startIndexValues != null && message.hasOwnProperty("startIndexValues")) { - if (!Array.isArray(message.startIndexValues)) - return "startIndexValues: array expected"; - for (var i = 0; i < message.startIndexValues.length; ++i) - if (!(message.startIndexValues[i] && typeof message.startIndexValues[i].length === "number" || $util.isString(message.startIndexValues[i]))) - return "startIndexValues: buffer[] expected"; - } - if (message.endIndexValues != null && message.hasOwnProperty("endIndexValues")) { - if (!Array.isArray(message.endIndexValues)) - return "endIndexValues: array expected"; - for (var i = 0; i < message.endIndexValues.length; ++i) - if (!(message.endIndexValues[i] && typeof message.endIndexValues[i].length === "number" || $util.isString(message.endIndexValues[i]))) - return "endIndexValues: buffer[] expected"; - } - if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify(message.startAtValueInfo); - if (error) - return "startAtValueInfo." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - if (typeof message.orderAscending !== "boolean") - return "orderAscending: boolean expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetContestedResourcesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 - */ - GetContestedResourcesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.startIndexValues) { - if (!Array.isArray(object.startIndexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startIndexValues: array expected"); - message.startIndexValues = []; - for (var i = 0; i < object.startIndexValues.length; ++i) - if (typeof object.startIndexValues[i] === "string") - $util.base64.decode(object.startIndexValues[i], message.startIndexValues[i] = $util.newBuffer($util.base64.length(object.startIndexValues[i])), 0); - else if (object.startIndexValues[i].length >= 0) - message.startIndexValues[i] = object.startIndexValues[i]; - } - if (object.endIndexValues) { - if (!Array.isArray(object.endIndexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.endIndexValues: array expected"); - message.endIndexValues = []; - for (var i = 0; i < object.endIndexValues.length; ++i) - if (typeof object.endIndexValues[i] === "string") - $util.base64.decode(object.endIndexValues[i], message.endIndexValues[i] = $util.newBuffer($util.base64.length(object.endIndexValues[i])), 0); - else if (object.endIndexValues[i].length >= 0) - message.endIndexValues[i] = object.endIndexValues[i]; - } - if (object.startAtValueInfo != null) { - if (typeof object.startAtValueInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startAtValueInfo: object expected"); - message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.fromObject(object.startAtValueInfo); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.orderAscending != null) - message.orderAscending = Boolean(object.orderAscending); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetContestedResourcesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourcesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.startIndexValues = []; - object.endIndexValues = []; - } - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.indexName = ""; - object.startAtValueInfo = null; - object.count = 0; - object.orderAscending = false; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.indexName != null && message.hasOwnProperty("indexName")) - object.indexName = message.indexName; - if (message.startIndexValues && message.startIndexValues.length) { - object.startIndexValues = []; - for (var j = 0; j < message.startIndexValues.length; ++j) - object.startIndexValues[j] = options.bytes === String ? $util.base64.encode(message.startIndexValues[j], 0, message.startIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.startIndexValues[j]) : message.startIndexValues[j]; - } - if (message.endIndexValues && message.endIndexValues.length) { - object.endIndexValues = []; - for (var j = 0; j < message.endIndexValues.length; ++j) - object.endIndexValues[j] = options.bytes === String ? $util.base64.encode(message.endIndexValues[j], 0, message.endIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.endIndexValues[j]) : message.endIndexValues[j]; - } - if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) - object.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.toObject(message.startAtValueInfo, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - object.orderAscending = message.orderAscending; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetContestedResourcesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourcesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourcesRequestV0.StartAtValueInfo = (function() { - - /** - * Properties of a StartAtValueInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @interface IStartAtValueInfo - * @property {Uint8Array|null} [startValue] StartAtValueInfo startValue - * @property {boolean|null} [startValueIncluded] StartAtValueInfo startValueIncluded - */ - - /** - * Constructs a new StartAtValueInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @classdesc Represents a StartAtValueInfo. - * @implements IStartAtValueInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set - */ - function StartAtValueInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtValueInfo startValue. - * @member {Uint8Array} startValue - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @instance - */ - StartAtValueInfo.prototype.startValue = $util.newBuffer([]); - - /** - * StartAtValueInfo startValueIncluded. - * @member {boolean} startValueIncluded - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @instance - */ - StartAtValueInfo.prototype.startValueIncluded = false; - - /** - * Creates a new StartAtValueInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo instance - */ - StartAtValueInfo.create = function create(properties) { - return new StartAtValueInfo(properties); - }; - - /** - * Encodes the specified StartAtValueInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtValueInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startValue != null && Object.hasOwnProperty.call(message, "startValue")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startValue); - if (message.startValueIncluded != null && Object.hasOwnProperty.call(message, "startValueIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startValueIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtValueInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtValueInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtValueInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtValueInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startValue = reader.bytes(); - break; - case 2: - message.startValueIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtValueInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtValueInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtValueInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtValueInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startValue != null && message.hasOwnProperty("startValue")) - if (!(message.startValue && typeof message.startValue.length === "number" || $util.isString(message.startValue))) - return "startValue: buffer expected"; - if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) - if (typeof message.startValueIncluded !== "boolean") - return "startValueIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtValueInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo - */ - StartAtValueInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); - if (object.startValue != null) - if (typeof object.startValue === "string") - $util.base64.decode(object.startValue, message.startValue = $util.newBuffer($util.base64.length(object.startValue)), 0); - else if (object.startValue.length >= 0) - message.startValue = object.startValue; - if (object.startValueIncluded != null) - message.startValueIncluded = Boolean(object.startValueIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtValueInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} message StartAtValueInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtValueInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startValue = ""; - else { - object.startValue = []; - if (options.bytes !== Array) - object.startValue = $util.newBuffer(object.startValue); - } - object.startValueIncluded = false; - } - if (message.startValue != null && message.hasOwnProperty("startValue")) - object.startValue = options.bytes === String ? $util.base64.encode(message.startValue, 0, message.startValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValue) : message.startValue; - if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) - object.startValueIncluded = message.startValueIncluded; - return object; - }; - - /** - * Converts this StartAtValueInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtValueInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtValueInfo; - })(); - - return GetContestedResourcesRequestV0; - })(); - - return GetContestedResourcesRequest; - })(); - - v0.GetContestedResourcesResponse = (function() { - - /** - * Properties of a GetContestedResourcesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourcesResponse - * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null} [v0] GetContestedResourcesResponse v0 - */ - - /** - * Constructs a new GetContestedResourcesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourcesResponse. - * @implements IGetContestedResourcesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set - */ - function GetContestedResourcesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourcesResponse v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @instance - */ - GetContestedResourcesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourcesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @instance - */ - Object.defineProperty(GetContestedResourcesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourcesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse instance - */ - GetContestedResourcesResponse.create = function create(properties) { - return new GetContestedResourcesResponse(properties); - }; - - /** - * Encodes the specified GetContestedResourcesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourcesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourcesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse - */ - GetContestedResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} message GetContestedResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourcesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourcesResponse.GetContestedResourcesResponseV0 = (function() { - - /** - * Properties of a GetContestedResourcesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @interface IGetContestedResourcesResponseV0 - * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null} [contestedResourceValues] GetContestedResourcesResponseV0 contestedResourceValues - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourcesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourcesResponseV0 metadata - */ - - /** - * Constructs a new GetContestedResourcesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @classdesc Represents a GetContestedResourcesResponseV0. - * @implements IGetContestedResourcesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set - */ - function GetContestedResourcesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourcesResponseV0 contestedResourceValues. - * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null|undefined} contestedResourceValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - */ - GetContestedResourcesResponseV0.prototype.contestedResourceValues = null; - - /** - * GetContestedResourcesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - */ - GetContestedResourcesResponseV0.prototype.proof = null; - - /** - * GetContestedResourcesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - */ - GetContestedResourcesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourcesResponseV0 result. - * @member {"contestedResourceValues"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - */ - Object.defineProperty(GetContestedResourcesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["contestedResourceValues", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourcesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 instance - */ - GetContestedResourcesResponseV0.create = function create(properties) { - return new GetContestedResourcesResponseV0(properties); - }; - - /** - * Encodes the specified GetContestedResourcesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceValues != null && Object.hasOwnProperty.call(message, "contestedResourceValues")) - $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.encode(message.contestedResourceValues, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourcesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourcesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourcesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify(message.contestedResourceValues); - if (error) - return "contestedResourceValues." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetContestedResourcesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 - */ - GetContestedResourcesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); - if (object.contestedResourceValues != null) { - if (typeof object.contestedResourceValues !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.contestedResourceValues: object expected"); - message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.fromObject(object.contestedResourceValues); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourcesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourcesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { - object.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.toObject(message.contestedResourceValues, options); - if (options.oneofs) - object.result = "contestedResourceValues"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetContestedResourcesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourcesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourcesResponseV0.ContestedResourceValues = (function() { - - /** - * Properties of a ContestedResourceValues. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @interface IContestedResourceValues - * @property {Array.|null} [contestedResourceValues] ContestedResourceValues contestedResourceValues - */ - - /** - * Constructs a new ContestedResourceValues. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @classdesc Represents a ContestedResourceValues. - * @implements IContestedResourceValues - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set - */ - function ContestedResourceValues(properties) { - this.contestedResourceValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceValues contestedResourceValues. - * @member {Array.} contestedResourceValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @instance - */ - ContestedResourceValues.prototype.contestedResourceValues = $util.emptyArray; - - /** - * Creates a new ContestedResourceValues instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues instance - */ - ContestedResourceValues.create = function create(properties) { - return new ContestedResourceValues(properties); - }; - - /** - * Encodes the specified ContestedResourceValues message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceValues != null && message.contestedResourceValues.length) - for (var i = 0; i < message.contestedResourceValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contestedResourceValues[i]); - return writer; - }; - - /** - * Encodes the specified ContestedResourceValues message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceValues message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceValues.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.contestedResourceValues && message.contestedResourceValues.length)) - message.contestedResourceValues = []; - message.contestedResourceValues.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceValues message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { - if (!Array.isArray(message.contestedResourceValues)) - return "contestedResourceValues: array expected"; - for (var i = 0; i < message.contestedResourceValues.length; ++i) - if (!(message.contestedResourceValues[i] && typeof message.contestedResourceValues[i].length === "number" || $util.isString(message.contestedResourceValues[i]))) - return "contestedResourceValues: buffer[] expected"; - } - return null; - }; - - /** - * Creates a ContestedResourceValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues - */ - ContestedResourceValues.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); - if (object.contestedResourceValues) { - if (!Array.isArray(object.contestedResourceValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.contestedResourceValues: array expected"); - message.contestedResourceValues = []; - for (var i = 0; i < object.contestedResourceValues.length; ++i) - if (typeof object.contestedResourceValues[i] === "string") - $util.base64.decode(object.contestedResourceValues[i], message.contestedResourceValues[i] = $util.newBuffer($util.base64.length(object.contestedResourceValues[i])), 0); - else if (object.contestedResourceValues[i].length >= 0) - message.contestedResourceValues[i] = object.contestedResourceValues[i]; - } - return message; - }; - - /** - * Creates a plain object from a ContestedResourceValues message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} message ContestedResourceValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.contestedResourceValues = []; - if (message.contestedResourceValues && message.contestedResourceValues.length) { - object.contestedResourceValues = []; - for (var j = 0; j < message.contestedResourceValues.length; ++j) - object.contestedResourceValues[j] = options.bytes === String ? $util.base64.encode(message.contestedResourceValues[j], 0, message.contestedResourceValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.contestedResourceValues[j]) : message.contestedResourceValues[j]; - } - return object; - }; - - /** - * Converts this ContestedResourceValues to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceValues; - })(); - - return GetContestedResourcesResponseV0; - })(); - - return GetContestedResourcesResponse; - })(); - - v0.GetVotePollsByEndDateRequest = (function() { - - /** - * Properties of a GetVotePollsByEndDateRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetVotePollsByEndDateRequest - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null} [v0] GetVotePollsByEndDateRequest v0 - */ - - /** - * Constructs a new GetVotePollsByEndDateRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetVotePollsByEndDateRequest. - * @implements IGetVotePollsByEndDateRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set - */ - function GetVotePollsByEndDateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetVotePollsByEndDateRequest v0. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @instance - */ - GetVotePollsByEndDateRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetVotePollsByEndDateRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @instance - */ - Object.defineProperty(GetVotePollsByEndDateRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetVotePollsByEndDateRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest instance - */ - GetVotePollsByEndDateRequest.create = function create(properties) { - return new GetVotePollsByEndDateRequest(properties); - }; - - /** - * Encodes the specified GetVotePollsByEndDateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetVotePollsByEndDateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVotePollsByEndDateRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVotePollsByEndDateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetVotePollsByEndDateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest - */ - GetVotePollsByEndDateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetVotePollsByEndDateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVotePollsByEndDateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetVotePollsByEndDateRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @instance - * @returns {Object.} JSON object - */ - GetVotePollsByEndDateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 = (function() { - - /** - * Properties of a GetVotePollsByEndDateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @interface IGetVotePollsByEndDateRequestV0 - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null} [startTimeInfo] GetVotePollsByEndDateRequestV0 startTimeInfo - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null} [endTimeInfo] GetVotePollsByEndDateRequestV0 endTimeInfo - * @property {number|null} [limit] GetVotePollsByEndDateRequestV0 limit - * @property {number|null} [offset] GetVotePollsByEndDateRequestV0 offset - * @property {boolean|null} [ascending] GetVotePollsByEndDateRequestV0 ascending - * @property {boolean|null} [prove] GetVotePollsByEndDateRequestV0 prove - */ - - /** - * Constructs a new GetVotePollsByEndDateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @classdesc Represents a GetVotePollsByEndDateRequestV0. - * @implements IGetVotePollsByEndDateRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set - */ - function GetVotePollsByEndDateRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetVotePollsByEndDateRequestV0 startTimeInfo. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null|undefined} startTimeInfo - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.startTimeInfo = null; - - /** - * GetVotePollsByEndDateRequestV0 endTimeInfo. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null|undefined} endTimeInfo - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.endTimeInfo = null; - - /** - * GetVotePollsByEndDateRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.limit = 0; - - /** - * GetVotePollsByEndDateRequestV0 offset. - * @member {number} offset - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.offset = 0; - - /** - * GetVotePollsByEndDateRequestV0 ascending. - * @member {boolean} ascending - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.ascending = false; - - /** - * GetVotePollsByEndDateRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.prove = false; - - /** - * Creates a new GetVotePollsByEndDateRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 instance - */ - GetVotePollsByEndDateRequestV0.create = function create(properties) { - return new GetVotePollsByEndDateRequestV0(properties); - }; - - /** - * Encodes the specified GetVotePollsByEndDateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimeInfo != null && Object.hasOwnProperty.call(message, "startTimeInfo")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.encode(message.startTimeInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTimeInfo != null && Object.hasOwnProperty.call(message, "endTimeInfo")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.encode(message.endTimeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.offset); - if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ascending); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetVotePollsByEndDateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.decode(reader, reader.uint32()); - break; - case 2: - message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.decode(reader, reader.uint32()); - break; - case 3: - message.limit = reader.uint32(); - break; - case 4: - message.offset = reader.uint32(); - break; - case 5: - message.ascending = reader.bool(); - break; - case 6: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVotePollsByEndDateRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVotePollsByEndDateRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify(message.startTimeInfo); - if (error) - return "startTimeInfo." + error; - } - if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify(message.endTimeInfo); - if (error) - return "endTimeInfo." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.ascending != null && message.hasOwnProperty("ascending")) - if (typeof message.ascending !== "boolean") - return "ascending: boolean expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetVotePollsByEndDateRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 - */ - GetVotePollsByEndDateRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); - if (object.startTimeInfo != null) { - if (typeof object.startTimeInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.startTimeInfo: object expected"); - message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.fromObject(object.startTimeInfo); - } - if (object.endTimeInfo != null) { - if (typeof object.endTimeInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.endTimeInfo: object expected"); - message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.fromObject(object.endTimeInfo); - } - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.offset != null) - message.offset = object.offset >>> 0; - if (object.ascending != null) - message.ascending = Boolean(object.ascending); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetVotePollsByEndDateRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVotePollsByEndDateRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTimeInfo = null; - object.endTimeInfo = null; - object.limit = 0; - object.offset = 0; - object.ascending = false; - object.prove = false; - } - if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) - object.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.toObject(message.startTimeInfo, options); - if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) - object.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.toObject(message.endTimeInfo, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.ascending != null && message.hasOwnProperty("ascending")) - object.ascending = message.ascending; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetVotePollsByEndDateRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetVotePollsByEndDateRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetVotePollsByEndDateRequestV0.StartAtTimeInfo = (function() { - - /** - * Properties of a StartAtTimeInfo. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @interface IStartAtTimeInfo - * @property {number|Long|null} [startTimeMs] StartAtTimeInfo startTimeMs - * @property {boolean|null} [startTimeIncluded] StartAtTimeInfo startTimeIncluded - */ - - /** - * Constructs a new StartAtTimeInfo. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @classdesc Represents a StartAtTimeInfo. - * @implements IStartAtTimeInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set - */ - function StartAtTimeInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtTimeInfo startTimeMs. - * @member {number|Long} startTimeMs - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @instance - */ - StartAtTimeInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StartAtTimeInfo startTimeIncluded. - * @member {boolean} startTimeIncluded - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @instance - */ - StartAtTimeInfo.prototype.startTimeIncluded = false; - - /** - * Creates a new StartAtTimeInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo instance - */ - StartAtTimeInfo.create = function create(properties) { - return new StartAtTimeInfo(properties); - }; - - /** - * Encodes the specified StartAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtTimeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); - if (message.startTimeIncluded != null && Object.hasOwnProperty.call(message, "startTimeIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startTimeIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtTimeInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtTimeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTimeMs = reader.uint64(); - break; - case 2: - message.startTimeIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtTimeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtTimeInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtTimeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) - if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) - return "startTimeMs: integer|Long expected"; - if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) - if (typeof message.startTimeIncluded !== "boolean") - return "startTimeIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtTimeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo - */ - StartAtTimeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); - if (object.startTimeMs != null) - if ($util.Long) - (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; - else if (typeof object.startTimeMs === "string") - message.startTimeMs = parseInt(object.startTimeMs, 10); - else if (typeof object.startTimeMs === "number") - message.startTimeMs = object.startTimeMs; - else if (typeof object.startTimeMs === "object") - message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); - if (object.startTimeIncluded != null) - message.startTimeIncluded = Boolean(object.startTimeIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtTimeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} message StartAtTimeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtTimeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startTimeMs = options.longs === String ? "0" : 0; - object.startTimeIncluded = false; - } - if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) - if (typeof message.startTimeMs === "number") - object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; - else - object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; - if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) - object.startTimeIncluded = message.startTimeIncluded; - return object; - }; - - /** - * Converts this StartAtTimeInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtTimeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtTimeInfo; - })(); - - GetVotePollsByEndDateRequestV0.EndAtTimeInfo = (function() { - - /** - * Properties of an EndAtTimeInfo. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @interface IEndAtTimeInfo - * @property {number|Long|null} [endTimeMs] EndAtTimeInfo endTimeMs - * @property {boolean|null} [endTimeIncluded] EndAtTimeInfo endTimeIncluded - */ - - /** - * Constructs a new EndAtTimeInfo. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @classdesc Represents an EndAtTimeInfo. - * @implements IEndAtTimeInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set - */ - function EndAtTimeInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EndAtTimeInfo endTimeMs. - * @member {number|Long} endTimeMs - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @instance - */ - EndAtTimeInfo.prototype.endTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * EndAtTimeInfo endTimeIncluded. - * @member {boolean} endTimeIncluded - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @instance - */ - EndAtTimeInfo.prototype.endTimeIncluded = false; - - /** - * Creates a new EndAtTimeInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo instance - */ - EndAtTimeInfo.create = function create(properties) { - return new EndAtTimeInfo(properties); - }; - - /** - * Encodes the specified EndAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndAtTimeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.endTimeMs != null && Object.hasOwnProperty.call(message, "endTimeMs")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.endTimeMs); - if (message.endTimeIncluded != null && Object.hasOwnProperty.call(message, "endTimeIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.endTimeIncluded); - return writer; - }; - - /** - * Encodes the specified EndAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EndAtTimeInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndAtTimeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.endTimeMs = reader.uint64(); - break; - case 2: - message.endTimeIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EndAtTimeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EndAtTimeInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EndAtTimeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) - if (!$util.isInteger(message.endTimeMs) && !(message.endTimeMs && $util.isInteger(message.endTimeMs.low) && $util.isInteger(message.endTimeMs.high))) - return "endTimeMs: integer|Long expected"; - if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) - if (typeof message.endTimeIncluded !== "boolean") - return "endTimeIncluded: boolean expected"; - return null; - }; - - /** - * Creates an EndAtTimeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo - */ - EndAtTimeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); - if (object.endTimeMs != null) - if ($util.Long) - (message.endTimeMs = $util.Long.fromValue(object.endTimeMs)).unsigned = true; - else if (typeof object.endTimeMs === "string") - message.endTimeMs = parseInt(object.endTimeMs, 10); - else if (typeof object.endTimeMs === "number") - message.endTimeMs = object.endTimeMs; - else if (typeof object.endTimeMs === "object") - message.endTimeMs = new $util.LongBits(object.endTimeMs.low >>> 0, object.endTimeMs.high >>> 0).toNumber(true); - if (object.endTimeIncluded != null) - message.endTimeIncluded = Boolean(object.endTimeIncluded); - return message; - }; - - /** - * Creates a plain object from an EndAtTimeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} message EndAtTimeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EndAtTimeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.endTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.endTimeMs = options.longs === String ? "0" : 0; - object.endTimeIncluded = false; - } - if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) - if (typeof message.endTimeMs === "number") - object.endTimeMs = options.longs === String ? String(message.endTimeMs) : message.endTimeMs; - else - object.endTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeMs) : options.longs === Number ? new $util.LongBits(message.endTimeMs.low >>> 0, message.endTimeMs.high >>> 0).toNumber(true) : message.endTimeMs; - if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) - object.endTimeIncluded = message.endTimeIncluded; - return object; - }; - - /** - * Converts this EndAtTimeInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @instance - * @returns {Object.} JSON object - */ - EndAtTimeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EndAtTimeInfo; - })(); - - return GetVotePollsByEndDateRequestV0; - })(); - - return GetVotePollsByEndDateRequest; - })(); - - v0.GetVotePollsByEndDateResponse = (function() { - - /** - * Properties of a GetVotePollsByEndDateResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetVotePollsByEndDateResponse - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null} [v0] GetVotePollsByEndDateResponse v0 - */ - - /** - * Constructs a new GetVotePollsByEndDateResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetVotePollsByEndDateResponse. - * @implements IGetVotePollsByEndDateResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set - */ - function GetVotePollsByEndDateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetVotePollsByEndDateResponse v0. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @instance - */ - GetVotePollsByEndDateResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetVotePollsByEndDateResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @instance - */ - Object.defineProperty(GetVotePollsByEndDateResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetVotePollsByEndDateResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse instance - */ - GetVotePollsByEndDateResponse.create = function create(properties) { - return new GetVotePollsByEndDateResponse(properties); - }; - - /** - * Encodes the specified GetVotePollsByEndDateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetVotePollsByEndDateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVotePollsByEndDateResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVotePollsByEndDateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetVotePollsByEndDateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse - */ - GetVotePollsByEndDateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetVotePollsByEndDateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVotePollsByEndDateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetVotePollsByEndDateResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @instance - * @returns {Object.} JSON object - */ - GetVotePollsByEndDateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 = (function() { - - /** - * Properties of a GetVotePollsByEndDateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @interface IGetVotePollsByEndDateResponseV0 - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null} [votePollsByTimestamps] GetVotePollsByEndDateResponseV0 votePollsByTimestamps - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetVotePollsByEndDateResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetVotePollsByEndDateResponseV0 metadata - */ - - /** - * Constructs a new GetVotePollsByEndDateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @classdesc Represents a GetVotePollsByEndDateResponseV0. - * @implements IGetVotePollsByEndDateResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set - */ - function GetVotePollsByEndDateResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetVotePollsByEndDateResponseV0 votePollsByTimestamps. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null|undefined} votePollsByTimestamps - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - */ - GetVotePollsByEndDateResponseV0.prototype.votePollsByTimestamps = null; - - /** - * GetVotePollsByEndDateResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - */ - GetVotePollsByEndDateResponseV0.prototype.proof = null; - - /** - * GetVotePollsByEndDateResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - */ - GetVotePollsByEndDateResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetVotePollsByEndDateResponseV0 result. - * @member {"votePollsByTimestamps"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - */ - Object.defineProperty(GetVotePollsByEndDateResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["votePollsByTimestamps", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetVotePollsByEndDateResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 instance - */ - GetVotePollsByEndDateResponseV0.create = function create(properties) { - return new GetVotePollsByEndDateResponseV0(properties); - }; - - /** - * Encodes the specified GetVotePollsByEndDateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.votePollsByTimestamps != null && Object.hasOwnProperty.call(message, "votePollsByTimestamps")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.encode(message.votePollsByTimestamps, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetVotePollsByEndDateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVotePollsByEndDateResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVotePollsByEndDateResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify(message.votePollsByTimestamps); - if (error) - return "votePollsByTimestamps." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetVotePollsByEndDateResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 - */ - GetVotePollsByEndDateResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); - if (object.votePollsByTimestamps != null) { - if (typeof object.votePollsByTimestamps !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.votePollsByTimestamps: object expected"); - message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.fromObject(object.votePollsByTimestamps); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetVotePollsByEndDateResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVotePollsByEndDateResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { - object.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.toObject(message.votePollsByTimestamps, options); - if (options.oneofs) - object.result = "votePollsByTimestamps"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetVotePollsByEndDateResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetVotePollsByEndDateResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp = (function() { - - /** - * Properties of a SerializedVotePollsByTimestamp. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @interface ISerializedVotePollsByTimestamp - * @property {number|Long|null} [timestamp] SerializedVotePollsByTimestamp timestamp - * @property {Array.|null} [serializedVotePolls] SerializedVotePollsByTimestamp serializedVotePolls - */ - - /** - * Constructs a new SerializedVotePollsByTimestamp. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @classdesc Represents a SerializedVotePollsByTimestamp. - * @implements ISerializedVotePollsByTimestamp - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set - */ - function SerializedVotePollsByTimestamp(properties) { - this.serializedVotePolls = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SerializedVotePollsByTimestamp timestamp. - * @member {number|Long} timestamp - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @instance - */ - SerializedVotePollsByTimestamp.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SerializedVotePollsByTimestamp serializedVotePolls. - * @member {Array.} serializedVotePolls - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @instance - */ - SerializedVotePollsByTimestamp.prototype.serializedVotePolls = $util.emptyArray; - - /** - * Creates a new SerializedVotePollsByTimestamp instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp instance - */ - SerializedVotePollsByTimestamp.create = function create(properties) { - return new SerializedVotePollsByTimestamp(properties); - }; - - /** - * Encodes the specified SerializedVotePollsByTimestamp message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SerializedVotePollsByTimestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); - if (message.serializedVotePolls != null && message.serializedVotePolls.length) - for (var i = 0; i < message.serializedVotePolls.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.serializedVotePolls[i]); - return writer; - }; - - /** - * Encodes the specified SerializedVotePollsByTimestamp message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SerializedVotePollsByTimestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SerializedVotePollsByTimestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.timestamp = reader.uint64(); - break; - case 2: - if (!(message.serializedVotePolls && message.serializedVotePolls.length)) - message.serializedVotePolls = []; - message.serializedVotePolls.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SerializedVotePollsByTimestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SerializedVotePollsByTimestamp message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SerializedVotePollsByTimestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.serializedVotePolls != null && message.hasOwnProperty("serializedVotePolls")) { - if (!Array.isArray(message.serializedVotePolls)) - return "serializedVotePolls: array expected"; - for (var i = 0; i < message.serializedVotePolls.length; ++i) - if (!(message.serializedVotePolls[i] && typeof message.serializedVotePolls[i].length === "number" || $util.isString(message.serializedVotePolls[i]))) - return "serializedVotePolls: buffer[] expected"; - } - return null; - }; - - /** - * Creates a SerializedVotePollsByTimestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp - */ - SerializedVotePollsByTimestamp.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.serializedVotePolls) { - if (!Array.isArray(object.serializedVotePolls)) - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.serializedVotePolls: array expected"); - message.serializedVotePolls = []; - for (var i = 0; i < object.serializedVotePolls.length; ++i) - if (typeof object.serializedVotePolls[i] === "string") - $util.base64.decode(object.serializedVotePolls[i], message.serializedVotePolls[i] = $util.newBuffer($util.base64.length(object.serializedVotePolls[i])), 0); - else if (object.serializedVotePolls[i].length >= 0) - message.serializedVotePolls[i] = object.serializedVotePolls[i]; - } - return message; - }; - - /** - * Creates a plain object from a SerializedVotePollsByTimestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SerializedVotePollsByTimestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.serializedVotePolls = []; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.serializedVotePolls && message.serializedVotePolls.length) { - object.serializedVotePolls = []; - for (var j = 0; j < message.serializedVotePolls.length; ++j) - object.serializedVotePolls[j] = options.bytes === String ? $util.base64.encode(message.serializedVotePolls[j], 0, message.serializedVotePolls[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedVotePolls[j]) : message.serializedVotePolls[j]; - } - return object; - }; - - /** - * Converts this SerializedVotePollsByTimestamp to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @instance - * @returns {Object.} JSON object - */ - SerializedVotePollsByTimestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SerializedVotePollsByTimestamp; - })(); - - GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps = (function() { - - /** - * Properties of a SerializedVotePollsByTimestamps. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @interface ISerializedVotePollsByTimestamps - * @property {Array.|null} [votePollsByTimestamps] SerializedVotePollsByTimestamps votePollsByTimestamps - * @property {boolean|null} [finishedResults] SerializedVotePollsByTimestamps finishedResults - */ - - /** - * Constructs a new SerializedVotePollsByTimestamps. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @classdesc Represents a SerializedVotePollsByTimestamps. - * @implements ISerializedVotePollsByTimestamps - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set - */ - function SerializedVotePollsByTimestamps(properties) { - this.votePollsByTimestamps = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SerializedVotePollsByTimestamps votePollsByTimestamps. - * @member {Array.} votePollsByTimestamps - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @instance - */ - SerializedVotePollsByTimestamps.prototype.votePollsByTimestamps = $util.emptyArray; - - /** - * SerializedVotePollsByTimestamps finishedResults. - * @member {boolean} finishedResults - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @instance - */ - SerializedVotePollsByTimestamps.prototype.finishedResults = false; - - /** - * Creates a new SerializedVotePollsByTimestamps instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps instance - */ - SerializedVotePollsByTimestamps.create = function create(properties) { - return new SerializedVotePollsByTimestamps(properties); - }; - - /** - * Encodes the specified SerializedVotePollsByTimestamps message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SerializedVotePollsByTimestamps.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.votePollsByTimestamps != null && message.votePollsByTimestamps.length) - for (var i = 0; i < message.votePollsByTimestamps.length; ++i) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.encode(message.votePollsByTimestamps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); - return writer; - }; - - /** - * Encodes the specified SerializedVotePollsByTimestamps message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SerializedVotePollsByTimestamps.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SerializedVotePollsByTimestamps.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.votePollsByTimestamps && message.votePollsByTimestamps.length)) - message.votePollsByTimestamps = []; - message.votePollsByTimestamps.push($root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.decode(reader, reader.uint32())); - break; - case 2: - message.finishedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SerializedVotePollsByTimestamps.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SerializedVotePollsByTimestamps message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SerializedVotePollsByTimestamps.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { - if (!Array.isArray(message.votePollsByTimestamps)) - return "votePollsByTimestamps: array expected"; - for (var i = 0; i < message.votePollsByTimestamps.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify(message.votePollsByTimestamps[i]); - if (error) - return "votePollsByTimestamps." + error; - } - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - if (typeof message.finishedResults !== "boolean") - return "finishedResults: boolean expected"; - return null; - }; - - /** - * Creates a SerializedVotePollsByTimestamps message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps - */ - SerializedVotePollsByTimestamps.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); - if (object.votePollsByTimestamps) { - if (!Array.isArray(object.votePollsByTimestamps)) - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: array expected"); - message.votePollsByTimestamps = []; - for (var i = 0; i < object.votePollsByTimestamps.length; ++i) { - if (typeof object.votePollsByTimestamps[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: object expected"); - message.votePollsByTimestamps[i] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.fromObject(object.votePollsByTimestamps[i]); - } - } - if (object.finishedResults != null) - message.finishedResults = Boolean(object.finishedResults); - return message; - }; - - /** - * Creates a plain object from a SerializedVotePollsByTimestamps message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SerializedVotePollsByTimestamps.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.votePollsByTimestamps = []; - if (options.defaults) - object.finishedResults = false; - if (message.votePollsByTimestamps && message.votePollsByTimestamps.length) { - object.votePollsByTimestamps = []; - for (var j = 0; j < message.votePollsByTimestamps.length; ++j) - object.votePollsByTimestamps[j] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.toObject(message.votePollsByTimestamps[j], options); - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - object.finishedResults = message.finishedResults; - return object; - }; - - /** - * Converts this SerializedVotePollsByTimestamps to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @instance - * @returns {Object.} JSON object - */ - SerializedVotePollsByTimestamps.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SerializedVotePollsByTimestamps; - })(); - - return GetVotePollsByEndDateResponseV0; - })(); - - return GetVotePollsByEndDateResponse; - })(); - - v0.GetContestedResourceVoteStateRequest = (function() { - - /** - * Properties of a GetContestedResourceVoteStateRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceVoteStateRequest - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null} [v0] GetContestedResourceVoteStateRequest v0 - */ - - /** - * Constructs a new GetContestedResourceVoteStateRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceVoteStateRequest. - * @implements IGetContestedResourceVoteStateRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set - */ - function GetContestedResourceVoteStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVoteStateRequest v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @instance - */ - GetContestedResourceVoteStateRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVoteStateRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @instance - */ - Object.defineProperty(GetContestedResourceVoteStateRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVoteStateRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest instance - */ - GetContestedResourceVoteStateRequest.create = function create(properties) { - return new GetContestedResourceVoteStateRequest(properties); - }; - - /** - * Encodes the specified GetContestedResourceVoteStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVoteStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVoteStateRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVoteStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceVoteStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest - */ - GetContestedResourceVoteStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVoteStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVoteStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceVoteStateRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVoteStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 = (function() { - - /** - * Properties of a GetContestedResourceVoteStateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @interface IGetContestedResourceVoteStateRequestV0 - * @property {Uint8Array|null} [contractId] GetContestedResourceVoteStateRequestV0 contractId - * @property {string|null} [documentTypeName] GetContestedResourceVoteStateRequestV0 documentTypeName - * @property {string|null} [indexName] GetContestedResourceVoteStateRequestV0 indexName - * @property {Array.|null} [indexValues] GetContestedResourceVoteStateRequestV0 indexValues - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType|null} [resultType] GetContestedResourceVoteStateRequestV0 resultType - * @property {boolean|null} [allowIncludeLockedAndAbstainingVoteTally] GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo - * @property {number|null} [count] GetContestedResourceVoteStateRequestV0 count - * @property {boolean|null} [prove] GetContestedResourceVoteStateRequestV0 prove - */ - - /** - * Constructs a new GetContestedResourceVoteStateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @classdesc Represents a GetContestedResourceVoteStateRequestV0. - * @implements IGetContestedResourceVoteStateRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set - */ - function GetContestedResourceVoteStateRequestV0(properties) { - this.indexValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVoteStateRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetContestedResourceVoteStateRequestV0 documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.documentTypeName = ""; - - /** - * GetContestedResourceVoteStateRequestV0 indexName. - * @member {string} indexName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.indexName = ""; - - /** - * GetContestedResourceVoteStateRequestV0 indexValues. - * @member {Array.} indexValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.indexValues = $util.emptyArray; - - /** - * GetContestedResourceVoteStateRequestV0 resultType. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType} resultType - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.resultType = 0; - - /** - * GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally. - * @member {boolean} allowIncludeLockedAndAbstainingVoteTally - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.allowIncludeLockedAndAbstainingVoteTally = false; - - /** - * GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.startAtIdentifierInfo = null; - - /** - * GetContestedResourceVoteStateRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.count = 0; - - /** - * GetContestedResourceVoteStateRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.prove = false; - - /** - * Creates a new GetContestedResourceVoteStateRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 instance - */ - GetContestedResourceVoteStateRequestV0.create = function create(properties) { - return new GetContestedResourceVoteStateRequestV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceVoteStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); - if (message.indexValues != null && message.indexValues.length) - for (var i = 0; i < message.indexValues.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); - if (message.resultType != null && Object.hasOwnProperty.call(message, "resultType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resultType); - if (message.allowIncludeLockedAndAbstainingVoteTally != null && Object.hasOwnProperty.call(message, "allowIncludeLockedAndAbstainingVoteTally")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowIncludeLockedAndAbstainingVoteTally); - if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.count); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVoteStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - message.indexName = reader.string(); - break; - case 4: - if (!(message.indexValues && message.indexValues.length)) - message.indexValues = []; - message.indexValues.push(reader.bytes()); - break; - case 5: - message.resultType = reader.int32(); - break; - case 6: - message.allowIncludeLockedAndAbstainingVoteTally = reader.bool(); - break; - case 7: - message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); - break; - case 8: - message.count = reader.uint32(); - break; - case 9: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVoteStateRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVoteStateRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.indexName != null && message.hasOwnProperty("indexName")) - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - if (message.indexValues != null && message.hasOwnProperty("indexValues")) { - if (!Array.isArray(message.indexValues)) - return "indexValues: array expected"; - for (var i = 0; i < message.indexValues.length; ++i) - if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) - return "indexValues: buffer[] expected"; - } - if (message.resultType != null && message.hasOwnProperty("resultType")) - switch (message.resultType) { - default: - return "resultType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) - if (typeof message.allowIncludeLockedAndAbstainingVoteTally !== "boolean") - return "allowIncludeLockedAndAbstainingVoteTally: boolean expected"; - if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); - if (error) - return "startAtIdentifierInfo." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetContestedResourceVoteStateRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 - */ - GetContestedResourceVoteStateRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.indexValues) { - if (!Array.isArray(object.indexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.indexValues: array expected"); - message.indexValues = []; - for (var i = 0; i < object.indexValues.length; ++i) - if (typeof object.indexValues[i] === "string") - $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); - else if (object.indexValues[i].length >= 0) - message.indexValues[i] = object.indexValues[i]; - } - switch (object.resultType) { - case "DOCUMENTS": - case 0: - message.resultType = 0; - break; - case "VOTE_TALLY": - case 1: - message.resultType = 1; - break; - case "DOCUMENTS_AND_VOTE_TALLY": - case 2: - message.resultType = 2; - break; - } - if (object.allowIncludeLockedAndAbstainingVoteTally != null) - message.allowIncludeLockedAndAbstainingVoteTally = Boolean(object.allowIncludeLockedAndAbstainingVoteTally); - if (object.startAtIdentifierInfo != null) { - if (typeof object.startAtIdentifierInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.startAtIdentifierInfo: object expected"); - message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVoteStateRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVoteStateRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexValues = []; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.indexName = ""; - object.resultType = options.enums === String ? "DOCUMENTS" : 0; - object.allowIncludeLockedAndAbstainingVoteTally = false; - object.startAtIdentifierInfo = null; - object.count = 0; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.indexName != null && message.hasOwnProperty("indexName")) - object.indexName = message.indexName; - if (message.indexValues && message.indexValues.length) { - object.indexValues = []; - for (var j = 0; j < message.indexValues.length; ++j) - object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; - } - if (message.resultType != null && message.hasOwnProperty("resultType")) - object.resultType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType[message.resultType] : message.resultType; - if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) - object.allowIncludeLockedAndAbstainingVoteTally = message.allowIncludeLockedAndAbstainingVoteTally; - if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) - object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetContestedResourceVoteStateRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVoteStateRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo = (function() { - - /** - * Properties of a StartAtIdentifierInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @interface IStartAtIdentifierInfo - * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier - * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded - */ - - /** - * Constructs a new StartAtIdentifierInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @classdesc Represents a StartAtIdentifierInfo. - * @implements IStartAtIdentifierInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set - */ - function StartAtIdentifierInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtIdentifierInfo startIdentifier. - * @member {Uint8Array} startIdentifier - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @instance - */ - StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); - - /** - * StartAtIdentifierInfo startIdentifierIncluded. - * @member {boolean} startIdentifierIncluded - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @instance - */ - StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; - - /** - * Creates a new StartAtIdentifierInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance - */ - StartAtIdentifierInfo.create = function create(properties) { - return new StartAtIdentifierInfo(properties); - }; - - /** - * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtIdentifierInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); - if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtIdentifierInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startIdentifier = reader.bytes(); - break; - case 2: - message.startIdentifierIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtIdentifierInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtIdentifierInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) - if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) - return "startIdentifier: buffer expected"; - if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) - if (typeof message.startIdentifierIncluded !== "boolean") - return "startIdentifierIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - */ - StartAtIdentifierInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); - if (object.startIdentifier != null) - if (typeof object.startIdentifier === "string") - $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); - else if (object.startIdentifier.length >= 0) - message.startIdentifier = object.startIdentifier; - if (object.startIdentifierIncluded != null) - message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtIdentifierInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startIdentifier = ""; - else { - object.startIdentifier = []; - if (options.bytes !== Array) - object.startIdentifier = $util.newBuffer(object.startIdentifier); - } - object.startIdentifierIncluded = false; - } - if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) - object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; - if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) - object.startIdentifierIncluded = message.startIdentifierIncluded; - return object; - }; - - /** - * Converts this StartAtIdentifierInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtIdentifierInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtIdentifierInfo; - })(); - - /** - * ResultType enum. - * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType - * @enum {number} - * @property {number} DOCUMENTS=0 DOCUMENTS value - * @property {number} VOTE_TALLY=1 VOTE_TALLY value - * @property {number} DOCUMENTS_AND_VOTE_TALLY=2 DOCUMENTS_AND_VOTE_TALLY value - */ - GetContestedResourceVoteStateRequestV0.ResultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DOCUMENTS"] = 0; - values[valuesById[1] = "VOTE_TALLY"] = 1; - values[valuesById[2] = "DOCUMENTS_AND_VOTE_TALLY"] = 2; - return values; - })(); - - return GetContestedResourceVoteStateRequestV0; - })(); - - return GetContestedResourceVoteStateRequest; - })(); - - v0.GetContestedResourceVoteStateResponse = (function() { - - /** - * Properties of a GetContestedResourceVoteStateResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceVoteStateResponse - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null} [v0] GetContestedResourceVoteStateResponse v0 - */ - - /** - * Constructs a new GetContestedResourceVoteStateResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceVoteStateResponse. - * @implements IGetContestedResourceVoteStateResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set - */ - function GetContestedResourceVoteStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVoteStateResponse v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @instance - */ - GetContestedResourceVoteStateResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVoteStateResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @instance - */ - Object.defineProperty(GetContestedResourceVoteStateResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVoteStateResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse instance - */ - GetContestedResourceVoteStateResponse.create = function create(properties) { - return new GetContestedResourceVoteStateResponse(properties); - }; - - /** - * Encodes the specified GetContestedResourceVoteStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVoteStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVoteStateResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVoteStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceVoteStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse - */ - GetContestedResourceVoteStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVoteStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVoteStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceVoteStateResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVoteStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 = (function() { - - /** - * Properties of a GetContestedResourceVoteStateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @interface IGetContestedResourceVoteStateResponseV0 - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null} [contestedResourceContenders] GetContestedResourceVoteStateResponseV0 contestedResourceContenders - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVoteStateResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVoteStateResponseV0 metadata - */ - - /** - * Constructs a new GetContestedResourceVoteStateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @classdesc Represents a GetContestedResourceVoteStateResponseV0. - * @implements IGetContestedResourceVoteStateResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set - */ - function GetContestedResourceVoteStateResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVoteStateResponseV0 contestedResourceContenders. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null|undefined} contestedResourceContenders - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - */ - GetContestedResourceVoteStateResponseV0.prototype.contestedResourceContenders = null; - - /** - * GetContestedResourceVoteStateResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - */ - GetContestedResourceVoteStateResponseV0.prototype.proof = null; - - /** - * GetContestedResourceVoteStateResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - */ - GetContestedResourceVoteStateResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVoteStateResponseV0 result. - * @member {"contestedResourceContenders"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - */ - Object.defineProperty(GetContestedResourceVoteStateResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["contestedResourceContenders", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVoteStateResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 instance - */ - GetContestedResourceVoteStateResponseV0.create = function create(properties) { - return new GetContestedResourceVoteStateResponseV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceVoteStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceContenders != null && Object.hasOwnProperty.call(message, "contestedResourceContenders")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.encode(message.contestedResourceContenders, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVoteStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVoteStateResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVoteStateResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify(message.contestedResourceContenders); - if (error) - return "contestedResourceContenders." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetContestedResourceVoteStateResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 - */ - GetContestedResourceVoteStateResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); - if (object.contestedResourceContenders != null) { - if (typeof object.contestedResourceContenders !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.contestedResourceContenders: object expected"); - message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.fromObject(object.contestedResourceContenders); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVoteStateResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVoteStateResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { - object.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.toObject(message.contestedResourceContenders, options); - if (options.oneofs) - object.result = "contestedResourceContenders"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetContestedResourceVoteStateResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVoteStateResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVoteStateResponseV0.FinishedVoteInfo = (function() { - - /** - * Properties of a FinishedVoteInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @interface IFinishedVoteInfo - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome|null} [finishedVoteOutcome] FinishedVoteInfo finishedVoteOutcome - * @property {Uint8Array|null} [wonByIdentityId] FinishedVoteInfo wonByIdentityId - * @property {number|Long|null} [finishedAtBlockHeight] FinishedVoteInfo finishedAtBlockHeight - * @property {number|null} [finishedAtCoreBlockHeight] FinishedVoteInfo finishedAtCoreBlockHeight - * @property {number|Long|null} [finishedAtBlockTimeMs] FinishedVoteInfo finishedAtBlockTimeMs - * @property {number|null} [finishedAtEpoch] FinishedVoteInfo finishedAtEpoch - */ - - /** - * Constructs a new FinishedVoteInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @classdesc Represents a FinishedVoteInfo. - * @implements IFinishedVoteInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set - */ - function FinishedVoteInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FinishedVoteInfo finishedVoteOutcome. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome} finishedVoteOutcome - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedVoteOutcome = 0; - - /** - * FinishedVoteInfo wonByIdentityId. - * @member {Uint8Array} wonByIdentityId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.wonByIdentityId = $util.newBuffer([]); - - /** - * FinishedVoteInfo finishedAtBlockHeight. - * @member {number|Long} finishedAtBlockHeight - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedAtBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * FinishedVoteInfo finishedAtCoreBlockHeight. - * @member {number} finishedAtCoreBlockHeight - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedAtCoreBlockHeight = 0; - - /** - * FinishedVoteInfo finishedAtBlockTimeMs. - * @member {number|Long} finishedAtBlockTimeMs - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedAtBlockTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * FinishedVoteInfo finishedAtEpoch. - * @member {number} finishedAtEpoch - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedAtEpoch = 0; - - /** - * Creates a new FinishedVoteInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo instance - */ - FinishedVoteInfo.create = function create(properties) { - return new FinishedVoteInfo(properties); - }; - - /** - * Encodes the specified FinishedVoteInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FinishedVoteInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.finishedVoteOutcome != null && Object.hasOwnProperty.call(message, "finishedVoteOutcome")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.finishedVoteOutcome); - if (message.wonByIdentityId != null && Object.hasOwnProperty.call(message, "wonByIdentityId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.wonByIdentityId); - if (message.finishedAtBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtBlockHeight")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.finishedAtBlockHeight); - if (message.finishedAtCoreBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtCoreBlockHeight")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.finishedAtCoreBlockHeight); - if (message.finishedAtBlockTimeMs != null && Object.hasOwnProperty.call(message, "finishedAtBlockTimeMs")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.finishedAtBlockTimeMs); - if (message.finishedAtEpoch != null && Object.hasOwnProperty.call(message, "finishedAtEpoch")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.finishedAtEpoch); - return writer; - }; - - /** - * Encodes the specified FinishedVoteInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FinishedVoteInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FinishedVoteInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FinishedVoteInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.finishedVoteOutcome = reader.int32(); - break; - case 2: - message.wonByIdentityId = reader.bytes(); - break; - case 3: - message.finishedAtBlockHeight = reader.uint64(); - break; - case 4: - message.finishedAtCoreBlockHeight = reader.uint32(); - break; - case 5: - message.finishedAtBlockTimeMs = reader.uint64(); - break; - case 6: - message.finishedAtEpoch = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FinishedVoteInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FinishedVoteInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FinishedVoteInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FinishedVoteInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) - switch (message.finishedVoteOutcome) { - default: - return "finishedVoteOutcome: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) - if (!(message.wonByIdentityId && typeof message.wonByIdentityId.length === "number" || $util.isString(message.wonByIdentityId))) - return "wonByIdentityId: buffer expected"; - if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) - if (!$util.isInteger(message.finishedAtBlockHeight) && !(message.finishedAtBlockHeight && $util.isInteger(message.finishedAtBlockHeight.low) && $util.isInteger(message.finishedAtBlockHeight.high))) - return "finishedAtBlockHeight: integer|Long expected"; - if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) - if (!$util.isInteger(message.finishedAtCoreBlockHeight)) - return "finishedAtCoreBlockHeight: integer expected"; - if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) - if (!$util.isInteger(message.finishedAtBlockTimeMs) && !(message.finishedAtBlockTimeMs && $util.isInteger(message.finishedAtBlockTimeMs.low) && $util.isInteger(message.finishedAtBlockTimeMs.high))) - return "finishedAtBlockTimeMs: integer|Long expected"; - if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) - if (!$util.isInteger(message.finishedAtEpoch)) - return "finishedAtEpoch: integer expected"; - return null; - }; - - /** - * Creates a FinishedVoteInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo - */ - FinishedVoteInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); - switch (object.finishedVoteOutcome) { - case "TOWARDS_IDENTITY": - case 0: - message.finishedVoteOutcome = 0; - break; - case "LOCKED": - case 1: - message.finishedVoteOutcome = 1; - break; - case "NO_PREVIOUS_WINNER": - case 2: - message.finishedVoteOutcome = 2; - break; - } - if (object.wonByIdentityId != null) - if (typeof object.wonByIdentityId === "string") - $util.base64.decode(object.wonByIdentityId, message.wonByIdentityId = $util.newBuffer($util.base64.length(object.wonByIdentityId)), 0); - else if (object.wonByIdentityId.length >= 0) - message.wonByIdentityId = object.wonByIdentityId; - if (object.finishedAtBlockHeight != null) - if ($util.Long) - (message.finishedAtBlockHeight = $util.Long.fromValue(object.finishedAtBlockHeight)).unsigned = true; - else if (typeof object.finishedAtBlockHeight === "string") - message.finishedAtBlockHeight = parseInt(object.finishedAtBlockHeight, 10); - else if (typeof object.finishedAtBlockHeight === "number") - message.finishedAtBlockHeight = object.finishedAtBlockHeight; - else if (typeof object.finishedAtBlockHeight === "object") - message.finishedAtBlockHeight = new $util.LongBits(object.finishedAtBlockHeight.low >>> 0, object.finishedAtBlockHeight.high >>> 0).toNumber(true); - if (object.finishedAtCoreBlockHeight != null) - message.finishedAtCoreBlockHeight = object.finishedAtCoreBlockHeight >>> 0; - if (object.finishedAtBlockTimeMs != null) - if ($util.Long) - (message.finishedAtBlockTimeMs = $util.Long.fromValue(object.finishedAtBlockTimeMs)).unsigned = true; - else if (typeof object.finishedAtBlockTimeMs === "string") - message.finishedAtBlockTimeMs = parseInt(object.finishedAtBlockTimeMs, 10); - else if (typeof object.finishedAtBlockTimeMs === "number") - message.finishedAtBlockTimeMs = object.finishedAtBlockTimeMs; - else if (typeof object.finishedAtBlockTimeMs === "object") - message.finishedAtBlockTimeMs = new $util.LongBits(object.finishedAtBlockTimeMs.low >>> 0, object.finishedAtBlockTimeMs.high >>> 0).toNumber(true); - if (object.finishedAtEpoch != null) - message.finishedAtEpoch = object.finishedAtEpoch >>> 0; - return message; - }; - - /** - * Creates a plain object from a FinishedVoteInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} message FinishedVoteInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FinishedVoteInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.finishedVoteOutcome = options.enums === String ? "TOWARDS_IDENTITY" : 0; - if (options.bytes === String) - object.wonByIdentityId = ""; - else { - object.wonByIdentityId = []; - if (options.bytes !== Array) - object.wonByIdentityId = $util.newBuffer(object.wonByIdentityId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.finishedAtBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.finishedAtBlockHeight = options.longs === String ? "0" : 0; - object.finishedAtCoreBlockHeight = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.finishedAtBlockTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.finishedAtBlockTimeMs = options.longs === String ? "0" : 0; - object.finishedAtEpoch = 0; - } - if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) - object.finishedVoteOutcome = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome[message.finishedVoteOutcome] : message.finishedVoteOutcome; - if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) - object.wonByIdentityId = options.bytes === String ? $util.base64.encode(message.wonByIdentityId, 0, message.wonByIdentityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.wonByIdentityId) : message.wonByIdentityId; - if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) - if (typeof message.finishedAtBlockHeight === "number") - object.finishedAtBlockHeight = options.longs === String ? String(message.finishedAtBlockHeight) : message.finishedAtBlockHeight; - else - object.finishedAtBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockHeight) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockHeight.low >>> 0, message.finishedAtBlockHeight.high >>> 0).toNumber(true) : message.finishedAtBlockHeight; - if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) - object.finishedAtCoreBlockHeight = message.finishedAtCoreBlockHeight; - if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) - if (typeof message.finishedAtBlockTimeMs === "number") - object.finishedAtBlockTimeMs = options.longs === String ? String(message.finishedAtBlockTimeMs) : message.finishedAtBlockTimeMs; - else - object.finishedAtBlockTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockTimeMs) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockTimeMs.low >>> 0, message.finishedAtBlockTimeMs.high >>> 0).toNumber(true) : message.finishedAtBlockTimeMs; - if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) - object.finishedAtEpoch = message.finishedAtEpoch; - return object; - }; - - /** - * Converts this FinishedVoteInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - * @returns {Object.} JSON object - */ - FinishedVoteInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * FinishedVoteOutcome enum. - * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome - * @enum {number} - * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value - * @property {number} LOCKED=1 LOCKED value - * @property {number} NO_PREVIOUS_WINNER=2 NO_PREVIOUS_WINNER value - */ - FinishedVoteInfo.FinishedVoteOutcome = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; - values[valuesById[1] = "LOCKED"] = 1; - values[valuesById[2] = "NO_PREVIOUS_WINNER"] = 2; - return values; - })(); - - return FinishedVoteInfo; - })(); - - GetContestedResourceVoteStateResponseV0.ContestedResourceContenders = (function() { - - /** - * Properties of a ContestedResourceContenders. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @interface IContestedResourceContenders - * @property {Array.|null} [contenders] ContestedResourceContenders contenders - * @property {number|null} [abstainVoteTally] ContestedResourceContenders abstainVoteTally - * @property {number|null} [lockVoteTally] ContestedResourceContenders lockVoteTally - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null} [finishedVoteInfo] ContestedResourceContenders finishedVoteInfo - */ - - /** - * Constructs a new ContestedResourceContenders. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @classdesc Represents a ContestedResourceContenders. - * @implements IContestedResourceContenders - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set - */ - function ContestedResourceContenders(properties) { - this.contenders = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceContenders contenders. - * @member {Array.} contenders - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - */ - ContestedResourceContenders.prototype.contenders = $util.emptyArray; - - /** - * ContestedResourceContenders abstainVoteTally. - * @member {number} abstainVoteTally - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - */ - ContestedResourceContenders.prototype.abstainVoteTally = 0; - - /** - * ContestedResourceContenders lockVoteTally. - * @member {number} lockVoteTally - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - */ - ContestedResourceContenders.prototype.lockVoteTally = 0; - - /** - * ContestedResourceContenders finishedVoteInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null|undefined} finishedVoteInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - */ - ContestedResourceContenders.prototype.finishedVoteInfo = null; - - /** - * Creates a new ContestedResourceContenders instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders instance - */ - ContestedResourceContenders.create = function create(properties) { - return new ContestedResourceContenders(properties); - }; - - /** - * Encodes the specified ContestedResourceContenders message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceContenders.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contenders != null && message.contenders.length) - for (var i = 0; i < message.contenders.length; ++i) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.encode(message.contenders[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.abstainVoteTally != null && Object.hasOwnProperty.call(message, "abstainVoteTally")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.abstainVoteTally); - if (message.lockVoteTally != null && Object.hasOwnProperty.call(message, "lockVoteTally")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.lockVoteTally); - if (message.finishedVoteInfo != null && Object.hasOwnProperty.call(message, "finishedVoteInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.encode(message.finishedVoteInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContestedResourceContenders message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceContenders.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceContenders message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceContenders.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.contenders && message.contenders.length)) - message.contenders = []; - message.contenders.push($root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.decode(reader, reader.uint32())); - break; - case 2: - message.abstainVoteTally = reader.uint32(); - break; - case 3: - message.lockVoteTally = reader.uint32(); - break; - case 4: - message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceContenders message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceContenders.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceContenders message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceContenders.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contenders != null && message.hasOwnProperty("contenders")) { - if (!Array.isArray(message.contenders)) - return "contenders: array expected"; - for (var i = 0; i < message.contenders.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify(message.contenders[i]); - if (error) - return "contenders." + error; - } - } - if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) - if (!$util.isInteger(message.abstainVoteTally)) - return "abstainVoteTally: integer expected"; - if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) - if (!$util.isInteger(message.lockVoteTally)) - return "lockVoteTally: integer expected"; - if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify(message.finishedVoteInfo); - if (error) - return "finishedVoteInfo." + error; - } - return null; - }; - - /** - * Creates a ContestedResourceContenders message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders - */ - ContestedResourceContenders.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); - if (object.contenders) { - if (!Array.isArray(object.contenders)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: array expected"); - message.contenders = []; - for (var i = 0; i < object.contenders.length; ++i) { - if (typeof object.contenders[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: object expected"); - message.contenders[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.fromObject(object.contenders[i]); - } - } - if (object.abstainVoteTally != null) - message.abstainVoteTally = object.abstainVoteTally >>> 0; - if (object.lockVoteTally != null) - message.lockVoteTally = object.lockVoteTally >>> 0; - if (object.finishedVoteInfo != null) { - if (typeof object.finishedVoteInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.finishedVoteInfo: object expected"); - message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.fromObject(object.finishedVoteInfo); - } - return message; - }; - - /** - * Creates a plain object from a ContestedResourceContenders message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} message ContestedResourceContenders - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceContenders.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.contenders = []; - if (options.defaults) { - object.abstainVoteTally = 0; - object.lockVoteTally = 0; - object.finishedVoteInfo = null; - } - if (message.contenders && message.contenders.length) { - object.contenders = []; - for (var j = 0; j < message.contenders.length; ++j) - object.contenders[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.toObject(message.contenders[j], options); - } - if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) - object.abstainVoteTally = message.abstainVoteTally; - if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) - object.lockVoteTally = message.lockVoteTally; - if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) - object.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.toObject(message.finishedVoteInfo, options); - return object; - }; - - /** - * Converts this ContestedResourceContenders to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceContenders.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceContenders; - })(); - - GetContestedResourceVoteStateResponseV0.Contender = (function() { - - /** - * Properties of a Contender. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @interface IContender - * @property {Uint8Array|null} [identifier] Contender identifier - * @property {number|null} [voteCount] Contender voteCount - * @property {Uint8Array|null} [document] Contender document - */ - - /** - * Constructs a new Contender. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @classdesc Represents a Contender. - * @implements IContender - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set - */ - function Contender(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Contender identifier. - * @member {Uint8Array} identifier - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @instance - */ - Contender.prototype.identifier = $util.newBuffer([]); - - /** - * Contender voteCount. - * @member {number} voteCount - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @instance - */ - Contender.prototype.voteCount = 0; - - /** - * Contender document. - * @member {Uint8Array} document - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @instance - */ - Contender.prototype.document = $util.newBuffer([]); - - /** - * Creates a new Contender instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender instance - */ - Contender.create = function create(properties) { - return new Contender(properties); - }; - - /** - * Encodes the specified Contender message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Contender.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); - if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.document); - return writer; - }; - - /** - * Encodes the specified Contender message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Contender.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Contender message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Contender.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identifier = reader.bytes(); - break; - case 2: - message.voteCount = reader.uint32(); - break; - case 3: - message.document = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Contender message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Contender.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Contender message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Contender.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identifier != null && message.hasOwnProperty("identifier")) - if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) - return "identifier: buffer expected"; - if (message.voteCount != null && message.hasOwnProperty("voteCount")) - if (!$util.isInteger(message.voteCount)) - return "voteCount: integer expected"; - if (message.document != null && message.hasOwnProperty("document")) - if (!(message.document && typeof message.document.length === "number" || $util.isString(message.document))) - return "document: buffer expected"; - return null; - }; - - /** - * Creates a Contender message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender - */ - Contender.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); - if (object.identifier != null) - if (typeof object.identifier === "string") - $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); - else if (object.identifier.length >= 0) - message.identifier = object.identifier; - if (object.voteCount != null) - message.voteCount = object.voteCount >>> 0; - if (object.document != null) - if (typeof object.document === "string") - $util.base64.decode(object.document, message.document = $util.newBuffer($util.base64.length(object.document)), 0); - else if (object.document.length >= 0) - message.document = object.document; - return message; - }; - - /** - * Creates a plain object from a Contender message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} message Contender - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Contender.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identifier = ""; - else { - object.identifier = []; - if (options.bytes !== Array) - object.identifier = $util.newBuffer(object.identifier); - } - object.voteCount = 0; - if (options.bytes === String) - object.document = ""; - else { - object.document = []; - if (options.bytes !== Array) - object.document = $util.newBuffer(object.document); - } - } - if (message.identifier != null && message.hasOwnProperty("identifier")) - object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; - if (message.voteCount != null && message.hasOwnProperty("voteCount")) - object.voteCount = message.voteCount; - if (message.document != null && message.hasOwnProperty("document")) - object.document = options.bytes === String ? $util.base64.encode(message.document, 0, message.document.length) : options.bytes === Array ? Array.prototype.slice.call(message.document) : message.document; - return object; - }; - - /** - * Converts this Contender to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @instance - * @returns {Object.} JSON object - */ - Contender.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Contender; - })(); - - return GetContestedResourceVoteStateResponseV0; - })(); - - return GetContestedResourceVoteStateResponse; - })(); - - v0.GetContestedResourceVotersForIdentityRequest = (function() { - - /** - * Properties of a GetContestedResourceVotersForIdentityRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceVotersForIdentityRequest - * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null} [v0] GetContestedResourceVotersForIdentityRequest v0 - */ - - /** - * Constructs a new GetContestedResourceVotersForIdentityRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceVotersForIdentityRequest. - * @implements IGetContestedResourceVotersForIdentityRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set - */ - function GetContestedResourceVotersForIdentityRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVotersForIdentityRequest v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @instance - */ - GetContestedResourceVotersForIdentityRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVotersForIdentityRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @instance - */ - Object.defineProperty(GetContestedResourceVotersForIdentityRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVotersForIdentityRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest instance - */ - GetContestedResourceVotersForIdentityRequest.create = function create(properties) { - return new GetContestedResourceVotersForIdentityRequest(properties); - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVotersForIdentityRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVotersForIdentityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceVotersForIdentityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest - */ - GetContestedResourceVotersForIdentityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVotersForIdentityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVotersForIdentityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceVotersForIdentityRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVotersForIdentityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 = (function() { - - /** - * Properties of a GetContestedResourceVotersForIdentityRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @interface IGetContestedResourceVotersForIdentityRequestV0 - * @property {Uint8Array|null} [contractId] GetContestedResourceVotersForIdentityRequestV0 contractId - * @property {string|null} [documentTypeName] GetContestedResourceVotersForIdentityRequestV0 documentTypeName - * @property {string|null} [indexName] GetContestedResourceVotersForIdentityRequestV0 indexName - * @property {Array.|null} [indexValues] GetContestedResourceVotersForIdentityRequestV0 indexValues - * @property {Uint8Array|null} [contestantId] GetContestedResourceVotersForIdentityRequestV0 contestantId - * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo - * @property {number|null} [count] GetContestedResourceVotersForIdentityRequestV0 count - * @property {boolean|null} [orderAscending] GetContestedResourceVotersForIdentityRequestV0 orderAscending - * @property {boolean|null} [prove] GetContestedResourceVotersForIdentityRequestV0 prove - */ - - /** - * Constructs a new GetContestedResourceVotersForIdentityRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @classdesc Represents a GetContestedResourceVotersForIdentityRequestV0. - * @implements IGetContestedResourceVotersForIdentityRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set - */ - function GetContestedResourceVotersForIdentityRequestV0(properties) { - this.indexValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVotersForIdentityRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetContestedResourceVotersForIdentityRequestV0 documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.documentTypeName = ""; - - /** - * GetContestedResourceVotersForIdentityRequestV0 indexName. - * @member {string} indexName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.indexName = ""; - - /** - * GetContestedResourceVotersForIdentityRequestV0 indexValues. - * @member {Array.} indexValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.indexValues = $util.emptyArray; - - /** - * GetContestedResourceVotersForIdentityRequestV0 contestantId. - * @member {Uint8Array} contestantId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.contestantId = $util.newBuffer([]); - - /** - * GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.startAtIdentifierInfo = null; - - /** - * GetContestedResourceVotersForIdentityRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.count = 0; - - /** - * GetContestedResourceVotersForIdentityRequestV0 orderAscending. - * @member {boolean} orderAscending - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.orderAscending = false; - - /** - * GetContestedResourceVotersForIdentityRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.prove = false; - - /** - * Creates a new GetContestedResourceVotersForIdentityRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 instance - */ - GetContestedResourceVotersForIdentityRequestV0.create = function create(properties) { - return new GetContestedResourceVotersForIdentityRequestV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); - if (message.indexValues != null && message.indexValues.length) - for (var i = 0; i < message.indexValues.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); - if (message.contestantId != null && Object.hasOwnProperty.call(message, "contestantId")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.contestantId); - if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); - if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - message.indexName = reader.string(); - break; - case 4: - if (!(message.indexValues && message.indexValues.length)) - message.indexValues = []; - message.indexValues.push(reader.bytes()); - break; - case 5: - message.contestantId = reader.bytes(); - break; - case 6: - message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); - break; - case 7: - message.count = reader.uint32(); - break; - case 8: - message.orderAscending = reader.bool(); - break; - case 9: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVotersForIdentityRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVotersForIdentityRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.indexName != null && message.hasOwnProperty("indexName")) - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - if (message.indexValues != null && message.hasOwnProperty("indexValues")) { - if (!Array.isArray(message.indexValues)) - return "indexValues: array expected"; - for (var i = 0; i < message.indexValues.length; ++i) - if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) - return "indexValues: buffer[] expected"; - } - if (message.contestantId != null && message.hasOwnProperty("contestantId")) - if (!(message.contestantId && typeof message.contestantId.length === "number" || $util.isString(message.contestantId))) - return "contestantId: buffer expected"; - if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); - if (error) - return "startAtIdentifierInfo." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - if (typeof message.orderAscending !== "boolean") - return "orderAscending: boolean expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetContestedResourceVotersForIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 - */ - GetContestedResourceVotersForIdentityRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.indexValues) { - if (!Array.isArray(object.indexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.indexValues: array expected"); - message.indexValues = []; - for (var i = 0; i < object.indexValues.length; ++i) - if (typeof object.indexValues[i] === "string") - $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); - else if (object.indexValues[i].length >= 0) - message.indexValues[i] = object.indexValues[i]; - } - if (object.contestantId != null) - if (typeof object.contestantId === "string") - $util.base64.decode(object.contestantId, message.contestantId = $util.newBuffer($util.base64.length(object.contestantId)), 0); - else if (object.contestantId.length >= 0) - message.contestantId = object.contestantId; - if (object.startAtIdentifierInfo != null) { - if (typeof object.startAtIdentifierInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.startAtIdentifierInfo: object expected"); - message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.orderAscending != null) - message.orderAscending = Boolean(object.orderAscending); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVotersForIdentityRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVotersForIdentityRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexValues = []; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.indexName = ""; - if (options.bytes === String) - object.contestantId = ""; - else { - object.contestantId = []; - if (options.bytes !== Array) - object.contestantId = $util.newBuffer(object.contestantId); - } - object.startAtIdentifierInfo = null; - object.count = 0; - object.orderAscending = false; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.indexName != null && message.hasOwnProperty("indexName")) - object.indexName = message.indexName; - if (message.indexValues && message.indexValues.length) { - object.indexValues = []; - for (var j = 0; j < message.indexValues.length; ++j) - object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; - } - if (message.contestantId != null && message.hasOwnProperty("contestantId")) - object.contestantId = options.bytes === String ? $util.base64.encode(message.contestantId, 0, message.contestantId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contestantId) : message.contestantId; - if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) - object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - object.orderAscending = message.orderAscending; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetContestedResourceVotersForIdentityRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo = (function() { - - /** - * Properties of a StartAtIdentifierInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @interface IStartAtIdentifierInfo - * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier - * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded - */ - - /** - * Constructs a new StartAtIdentifierInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @classdesc Represents a StartAtIdentifierInfo. - * @implements IStartAtIdentifierInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set - */ - function StartAtIdentifierInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtIdentifierInfo startIdentifier. - * @member {Uint8Array} startIdentifier - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @instance - */ - StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); - - /** - * StartAtIdentifierInfo startIdentifierIncluded. - * @member {boolean} startIdentifierIncluded - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @instance - */ - StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; - - /** - * Creates a new StartAtIdentifierInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance - */ - StartAtIdentifierInfo.create = function create(properties) { - return new StartAtIdentifierInfo(properties); - }; - - /** - * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtIdentifierInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); - if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtIdentifierInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startIdentifier = reader.bytes(); - break; - case 2: - message.startIdentifierIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtIdentifierInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtIdentifierInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) - if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) - return "startIdentifier: buffer expected"; - if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) - if (typeof message.startIdentifierIncluded !== "boolean") - return "startIdentifierIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - */ - StartAtIdentifierInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); - if (object.startIdentifier != null) - if (typeof object.startIdentifier === "string") - $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); - else if (object.startIdentifier.length >= 0) - message.startIdentifier = object.startIdentifier; - if (object.startIdentifierIncluded != null) - message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtIdentifierInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startIdentifier = ""; - else { - object.startIdentifier = []; - if (options.bytes !== Array) - object.startIdentifier = $util.newBuffer(object.startIdentifier); - } - object.startIdentifierIncluded = false; - } - if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) - object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; - if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) - object.startIdentifierIncluded = message.startIdentifierIncluded; - return object; - }; - - /** - * Converts this StartAtIdentifierInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtIdentifierInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtIdentifierInfo; - })(); - - return GetContestedResourceVotersForIdentityRequestV0; - })(); - - return GetContestedResourceVotersForIdentityRequest; - })(); - - v0.GetContestedResourceVotersForIdentityResponse = (function() { - - /** - * Properties of a GetContestedResourceVotersForIdentityResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceVotersForIdentityResponse - * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null} [v0] GetContestedResourceVotersForIdentityResponse v0 - */ - - /** - * Constructs a new GetContestedResourceVotersForIdentityResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceVotersForIdentityResponse. - * @implements IGetContestedResourceVotersForIdentityResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set - */ - function GetContestedResourceVotersForIdentityResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVotersForIdentityResponse v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @instance - */ - GetContestedResourceVotersForIdentityResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVotersForIdentityResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @instance - */ - Object.defineProperty(GetContestedResourceVotersForIdentityResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVotersForIdentityResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse instance - */ - GetContestedResourceVotersForIdentityResponse.create = function create(properties) { - return new GetContestedResourceVotersForIdentityResponse(properties); - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVotersForIdentityResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVotersForIdentityResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceVotersForIdentityResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse - */ - GetContestedResourceVotersForIdentityResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVotersForIdentityResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVotersForIdentityResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceVotersForIdentityResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVotersForIdentityResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 = (function() { - - /** - * Properties of a GetContestedResourceVotersForIdentityResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @interface IGetContestedResourceVotersForIdentityResponseV0 - * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null} [contestedResourceVoters] GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVotersForIdentityResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVotersForIdentityResponseV0 metadata - */ - - /** - * Constructs a new GetContestedResourceVotersForIdentityResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @classdesc Represents a GetContestedResourceVotersForIdentityResponseV0. - * @implements IGetContestedResourceVotersForIdentityResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set - */ - function GetContestedResourceVotersForIdentityResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null|undefined} contestedResourceVoters - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - */ - GetContestedResourceVotersForIdentityResponseV0.prototype.contestedResourceVoters = null; - - /** - * GetContestedResourceVotersForIdentityResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - */ - GetContestedResourceVotersForIdentityResponseV0.prototype.proof = null; - - /** - * GetContestedResourceVotersForIdentityResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - */ - GetContestedResourceVotersForIdentityResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVotersForIdentityResponseV0 result. - * @member {"contestedResourceVoters"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - */ - Object.defineProperty(GetContestedResourceVotersForIdentityResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["contestedResourceVoters", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVotersForIdentityResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 instance - */ - GetContestedResourceVotersForIdentityResponseV0.create = function create(properties) { - return new GetContestedResourceVotersForIdentityResponseV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceVoters != null && Object.hasOwnProperty.call(message, "contestedResourceVoters")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.encode(message.contestedResourceVoters, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVotersForIdentityResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVotersForIdentityResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify(message.contestedResourceVoters); - if (error) - return "contestedResourceVoters." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetContestedResourceVotersForIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 - */ - GetContestedResourceVotersForIdentityResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); - if (object.contestedResourceVoters != null) { - if (typeof object.contestedResourceVoters !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.contestedResourceVoters: object expected"); - message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.fromObject(object.contestedResourceVoters); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVotersForIdentityResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVotersForIdentityResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { - object.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.toObject(message.contestedResourceVoters, options); - if (options.oneofs) - object.result = "contestedResourceVoters"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetContestedResourceVotersForIdentityResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVotersForIdentityResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters = (function() { - - /** - * Properties of a ContestedResourceVoters. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @interface IContestedResourceVoters - * @property {Array.|null} [voters] ContestedResourceVoters voters - * @property {boolean|null} [finishedResults] ContestedResourceVoters finishedResults - */ - - /** - * Constructs a new ContestedResourceVoters. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @classdesc Represents a ContestedResourceVoters. - * @implements IContestedResourceVoters - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set - */ - function ContestedResourceVoters(properties) { - this.voters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceVoters voters. - * @member {Array.} voters - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @instance - */ - ContestedResourceVoters.prototype.voters = $util.emptyArray; - - /** - * ContestedResourceVoters finishedResults. - * @member {boolean} finishedResults - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @instance - */ - ContestedResourceVoters.prototype.finishedResults = false; - - /** - * Creates a new ContestedResourceVoters instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters instance - */ - ContestedResourceVoters.create = function create(properties) { - return new ContestedResourceVoters(properties); - }; - - /** - * Encodes the specified ContestedResourceVoters message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceVoters.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voters != null && message.voters.length) - for (var i = 0; i < message.voters.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.voters[i]); - if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); - return writer; - }; - - /** - * Encodes the specified ContestedResourceVoters message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceVoters.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceVoters message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceVoters.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.voters && message.voters.length)) - message.voters = []; - message.voters.push(reader.bytes()); - break; - case 2: - message.finishedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceVoters message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceVoters.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceVoters message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceVoters.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voters != null && message.hasOwnProperty("voters")) { - if (!Array.isArray(message.voters)) - return "voters: array expected"; - for (var i = 0; i < message.voters.length; ++i) - if (!(message.voters[i] && typeof message.voters[i].length === "number" || $util.isString(message.voters[i]))) - return "voters: buffer[] expected"; - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - if (typeof message.finishedResults !== "boolean") - return "finishedResults: boolean expected"; - return null; - }; - - /** - * Creates a ContestedResourceVoters message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters - */ - ContestedResourceVoters.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); - if (object.voters) { - if (!Array.isArray(object.voters)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.voters: array expected"); - message.voters = []; - for (var i = 0; i < object.voters.length; ++i) - if (typeof object.voters[i] === "string") - $util.base64.decode(object.voters[i], message.voters[i] = $util.newBuffer($util.base64.length(object.voters[i])), 0); - else if (object.voters[i].length >= 0) - message.voters[i] = object.voters[i]; - } - if (object.finishedResults != null) - message.finishedResults = Boolean(object.finishedResults); - return message; - }; - - /** - * Creates a plain object from a ContestedResourceVoters message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} message ContestedResourceVoters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceVoters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.voters = []; - if (options.defaults) - object.finishedResults = false; - if (message.voters && message.voters.length) { - object.voters = []; - for (var j = 0; j < message.voters.length; ++j) - object.voters[j] = options.bytes === String ? $util.base64.encode(message.voters[j], 0, message.voters[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.voters[j]) : message.voters[j]; - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - object.finishedResults = message.finishedResults; - return object; - }; - - /** - * Converts this ContestedResourceVoters to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceVoters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceVoters; - })(); - - return GetContestedResourceVotersForIdentityResponseV0; - })(); - - return GetContestedResourceVotersForIdentityResponse; - })(); - - v0.GetContestedResourceIdentityVotesRequest = (function() { - - /** - * Properties of a GetContestedResourceIdentityVotesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceIdentityVotesRequest - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null} [v0] GetContestedResourceIdentityVotesRequest v0 - */ - - /** - * Constructs a new GetContestedResourceIdentityVotesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceIdentityVotesRequest. - * @implements IGetContestedResourceIdentityVotesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set - */ - function GetContestedResourceIdentityVotesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceIdentityVotesRequest v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @instance - */ - GetContestedResourceIdentityVotesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceIdentityVotesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @instance - */ - Object.defineProperty(GetContestedResourceIdentityVotesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceIdentityVotesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest instance - */ - GetContestedResourceIdentityVotesRequest.create = function create(properties) { - return new GetContestedResourceIdentityVotesRequest(properties); - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceIdentityVotesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceIdentityVotesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceIdentityVotesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest - */ - GetContestedResourceIdentityVotesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceIdentityVotesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceIdentityVotesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceIdentityVotesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceIdentityVotesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 = (function() { - - /** - * Properties of a GetContestedResourceIdentityVotesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @interface IGetContestedResourceIdentityVotesRequestV0 - * @property {Uint8Array|null} [identityId] GetContestedResourceIdentityVotesRequestV0 identityId - * @property {google.protobuf.IUInt32Value|null} [limit] GetContestedResourceIdentityVotesRequestV0 limit - * @property {google.protobuf.IUInt32Value|null} [offset] GetContestedResourceIdentityVotesRequestV0 offset - * @property {boolean|null} [orderAscending] GetContestedResourceIdentityVotesRequestV0 orderAscending - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null} [startAtVotePollIdInfo] GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo - * @property {boolean|null} [prove] GetContestedResourceIdentityVotesRequestV0 prove - */ - - /** - * Constructs a new GetContestedResourceIdentityVotesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @classdesc Represents a GetContestedResourceIdentityVotesRequestV0. - * @implements IGetContestedResourceIdentityVotesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set - */ - function GetContestedResourceIdentityVotesRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceIdentityVotesRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetContestedResourceIdentityVotesRequestV0 limit. - * @member {google.protobuf.IUInt32Value|null|undefined} limit - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.limit = null; - - /** - * GetContestedResourceIdentityVotesRequestV0 offset. - * @member {google.protobuf.IUInt32Value|null|undefined} offset - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.offset = null; - - /** - * GetContestedResourceIdentityVotesRequestV0 orderAscending. - * @member {boolean} orderAscending - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.orderAscending = false; - - /** - * GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null|undefined} startAtVotePollIdInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.startAtVotePollIdInfo = null; - - /** - * GetContestedResourceIdentityVotesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.prove = false; - - /** - * Creates a new GetContestedResourceIdentityVotesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 instance - */ - GetContestedResourceIdentityVotesRequestV0.create = function create(properties) { - return new GetContestedResourceIdentityVotesRequestV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.orderAscending); - if (message.startAtVotePollIdInfo != null && Object.hasOwnProperty.call(message, "startAtVotePollIdInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.encode(message.startAtVotePollIdInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 3: - message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 4: - message.orderAscending = reader.bool(); - break; - case 5: - message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.decode(reader, reader.uint32()); - break; - case 6: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceIdentityVotesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceIdentityVotesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.UInt32Value.verify(message.limit); - if (error) - return "limit." + error; - } - if (message.offset != null && message.hasOwnProperty("offset")) { - var error = $root.google.protobuf.UInt32Value.verify(message.offset); - if (error) - return "offset." + error; - } - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - if (typeof message.orderAscending !== "boolean") - return "orderAscending: boolean expected"; - if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify(message.startAtVotePollIdInfo); - if (error) - return "startAtVotePollIdInfo." + error; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetContestedResourceIdentityVotesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 - */ - GetContestedResourceIdentityVotesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.limit: object expected"); - message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); - } - if (object.offset != null) { - if (typeof object.offset !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.offset: object expected"); - message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); - } - if (object.orderAscending != null) - message.orderAscending = Boolean(object.orderAscending); - if (object.startAtVotePollIdInfo != null) { - if (typeof object.startAtVotePollIdInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.startAtVotePollIdInfo: object expected"); - message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.fromObject(object.startAtVotePollIdInfo); - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceIdentityVotesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceIdentityVotesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.limit = null; - object.offset = null; - object.orderAscending = false; - object.startAtVotePollIdInfo = null; - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - object.orderAscending = message.orderAscending; - if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) - object.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.toObject(message.startAtVotePollIdInfo, options); - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetContestedResourceIdentityVotesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceIdentityVotesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo = (function() { - - /** - * Properties of a StartAtVotePollIdInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @interface IStartAtVotePollIdInfo - * @property {Uint8Array|null} [startAtPollIdentifier] StartAtVotePollIdInfo startAtPollIdentifier - * @property {boolean|null} [startPollIdentifierIncluded] StartAtVotePollIdInfo startPollIdentifierIncluded - */ - - /** - * Constructs a new StartAtVotePollIdInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @classdesc Represents a StartAtVotePollIdInfo. - * @implements IStartAtVotePollIdInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set - */ - function StartAtVotePollIdInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtVotePollIdInfo startAtPollIdentifier. - * @member {Uint8Array} startAtPollIdentifier - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @instance - */ - StartAtVotePollIdInfo.prototype.startAtPollIdentifier = $util.newBuffer([]); - - /** - * StartAtVotePollIdInfo startPollIdentifierIncluded. - * @member {boolean} startPollIdentifierIncluded - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @instance - */ - StartAtVotePollIdInfo.prototype.startPollIdentifierIncluded = false; - - /** - * Creates a new StartAtVotePollIdInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo instance - */ - StartAtVotePollIdInfo.create = function create(properties) { - return new StartAtVotePollIdInfo(properties); - }; - - /** - * Encodes the specified StartAtVotePollIdInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtVotePollIdInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startAtPollIdentifier != null && Object.hasOwnProperty.call(message, "startAtPollIdentifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startAtPollIdentifier); - if (message.startPollIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startPollIdentifierIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startPollIdentifierIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtVotePollIdInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtVotePollIdInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtVotePollIdInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startAtPollIdentifier = reader.bytes(); - break; - case 2: - message.startPollIdentifierIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtVotePollIdInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtVotePollIdInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtVotePollIdInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) - if (!(message.startAtPollIdentifier && typeof message.startAtPollIdentifier.length === "number" || $util.isString(message.startAtPollIdentifier))) - return "startAtPollIdentifier: buffer expected"; - if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) - if (typeof message.startPollIdentifierIncluded !== "boolean") - return "startPollIdentifierIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtVotePollIdInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo - */ - StartAtVotePollIdInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); - if (object.startAtPollIdentifier != null) - if (typeof object.startAtPollIdentifier === "string") - $util.base64.decode(object.startAtPollIdentifier, message.startAtPollIdentifier = $util.newBuffer($util.base64.length(object.startAtPollIdentifier)), 0); - else if (object.startAtPollIdentifier.length >= 0) - message.startAtPollIdentifier = object.startAtPollIdentifier; - if (object.startPollIdentifierIncluded != null) - message.startPollIdentifierIncluded = Boolean(object.startPollIdentifierIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtVotePollIdInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} message StartAtVotePollIdInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtVotePollIdInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startAtPollIdentifier = ""; - else { - object.startAtPollIdentifier = []; - if (options.bytes !== Array) - object.startAtPollIdentifier = $util.newBuffer(object.startAtPollIdentifier); - } - object.startPollIdentifierIncluded = false; - } - if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) - object.startAtPollIdentifier = options.bytes === String ? $util.base64.encode(message.startAtPollIdentifier, 0, message.startAtPollIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAtPollIdentifier) : message.startAtPollIdentifier; - if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) - object.startPollIdentifierIncluded = message.startPollIdentifierIncluded; - return object; - }; - - /** - * Converts this StartAtVotePollIdInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtVotePollIdInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtVotePollIdInfo; - })(); - - return GetContestedResourceIdentityVotesRequestV0; - })(); - - return GetContestedResourceIdentityVotesRequest; - })(); - - v0.GetContestedResourceIdentityVotesResponse = (function() { - - /** - * Properties of a GetContestedResourceIdentityVotesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceIdentityVotesResponse - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null} [v0] GetContestedResourceIdentityVotesResponse v0 - */ - - /** - * Constructs a new GetContestedResourceIdentityVotesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceIdentityVotesResponse. - * @implements IGetContestedResourceIdentityVotesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set - */ - function GetContestedResourceIdentityVotesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceIdentityVotesResponse v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @instance - */ - GetContestedResourceIdentityVotesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceIdentityVotesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @instance - */ - Object.defineProperty(GetContestedResourceIdentityVotesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceIdentityVotesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse instance - */ - GetContestedResourceIdentityVotesResponse.create = function create(properties) { - return new GetContestedResourceIdentityVotesResponse(properties); - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceIdentityVotesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceIdentityVotesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceIdentityVotesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse - */ - GetContestedResourceIdentityVotesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceIdentityVotesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceIdentityVotesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceIdentityVotesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceIdentityVotesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 = (function() { - - /** - * Properties of a GetContestedResourceIdentityVotesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @interface IGetContestedResourceIdentityVotesResponseV0 - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null} [votes] GetContestedResourceIdentityVotesResponseV0 votes - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceIdentityVotesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceIdentityVotesResponseV0 metadata - */ - - /** - * Constructs a new GetContestedResourceIdentityVotesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @classdesc Represents a GetContestedResourceIdentityVotesResponseV0. - * @implements IGetContestedResourceIdentityVotesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set - */ - function GetContestedResourceIdentityVotesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceIdentityVotesResponseV0 votes. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null|undefined} votes - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - */ - GetContestedResourceIdentityVotesResponseV0.prototype.votes = null; - - /** - * GetContestedResourceIdentityVotesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - */ - GetContestedResourceIdentityVotesResponseV0.prototype.proof = null; - - /** - * GetContestedResourceIdentityVotesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - */ - GetContestedResourceIdentityVotesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceIdentityVotesResponseV0 result. - * @member {"votes"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - */ - Object.defineProperty(GetContestedResourceIdentityVotesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["votes", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceIdentityVotesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 instance - */ - GetContestedResourceIdentityVotesResponseV0.create = function create(properties) { - return new GetContestedResourceIdentityVotesResponseV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.votes != null && Object.hasOwnProperty.call(message, "votes")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.encode(message.votes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceIdentityVotesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceIdentityVotesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.votes != null && message.hasOwnProperty("votes")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify(message.votes); - if (error) - return "votes." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetContestedResourceIdentityVotesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 - */ - GetContestedResourceIdentityVotesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); - if (object.votes != null) { - if (typeof object.votes !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.votes: object expected"); - message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.fromObject(object.votes); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceIdentityVotesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceIdentityVotesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.votes != null && message.hasOwnProperty("votes")) { - object.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.toObject(message.votes, options); - if (options.oneofs) - object.result = "votes"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetContestedResourceIdentityVotesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceIdentityVotesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes = (function() { - - /** - * Properties of a ContestedResourceIdentityVotes. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @interface IContestedResourceIdentityVotes - * @property {Array.|null} [contestedResourceIdentityVotes] ContestedResourceIdentityVotes contestedResourceIdentityVotes - * @property {boolean|null} [finishedResults] ContestedResourceIdentityVotes finishedResults - */ - - /** - * Constructs a new ContestedResourceIdentityVotes. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @classdesc Represents a ContestedResourceIdentityVotes. - * @implements IContestedResourceIdentityVotes - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set - */ - function ContestedResourceIdentityVotes(properties) { - this.contestedResourceIdentityVotes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceIdentityVotes contestedResourceIdentityVotes. - * @member {Array.} contestedResourceIdentityVotes - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @instance - */ - ContestedResourceIdentityVotes.prototype.contestedResourceIdentityVotes = $util.emptyArray; - - /** - * ContestedResourceIdentityVotes finishedResults. - * @member {boolean} finishedResults - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @instance - */ - ContestedResourceIdentityVotes.prototype.finishedResults = false; - - /** - * Creates a new ContestedResourceIdentityVotes instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes instance - */ - ContestedResourceIdentityVotes.create = function create(properties) { - return new ContestedResourceIdentityVotes(properties); - }; - - /** - * Encodes the specified ContestedResourceIdentityVotes message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceIdentityVotes.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceIdentityVotes != null && message.contestedResourceIdentityVotes.length) - for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.encode(message.contestedResourceIdentityVotes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); - return writer; - }; - - /** - * Encodes the specified ContestedResourceIdentityVotes message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceIdentityVotes.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceIdentityVotes.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length)) - message.contestedResourceIdentityVotes = []; - message.contestedResourceIdentityVotes.push($root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.decode(reader, reader.uint32())); - break; - case 2: - message.finishedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceIdentityVotes.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceIdentityVotes message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceIdentityVotes.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contestedResourceIdentityVotes != null && message.hasOwnProperty("contestedResourceIdentityVotes")) { - if (!Array.isArray(message.contestedResourceIdentityVotes)) - return "contestedResourceIdentityVotes: array expected"; - for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify(message.contestedResourceIdentityVotes[i]); - if (error) - return "contestedResourceIdentityVotes." + error; - } - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - if (typeof message.finishedResults !== "boolean") - return "finishedResults: boolean expected"; - return null; - }; - - /** - * Creates a ContestedResourceIdentityVotes message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes - */ - ContestedResourceIdentityVotes.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); - if (object.contestedResourceIdentityVotes) { - if (!Array.isArray(object.contestedResourceIdentityVotes)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: array expected"); - message.contestedResourceIdentityVotes = []; - for (var i = 0; i < object.contestedResourceIdentityVotes.length; ++i) { - if (typeof object.contestedResourceIdentityVotes[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: object expected"); - message.contestedResourceIdentityVotes[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.fromObject(object.contestedResourceIdentityVotes[i]); - } - } - if (object.finishedResults != null) - message.finishedResults = Boolean(object.finishedResults); - return message; - }; - - /** - * Creates a plain object from a ContestedResourceIdentityVotes message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} message ContestedResourceIdentityVotes - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceIdentityVotes.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.contestedResourceIdentityVotes = []; - if (options.defaults) - object.finishedResults = false; - if (message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length) { - object.contestedResourceIdentityVotes = []; - for (var j = 0; j < message.contestedResourceIdentityVotes.length; ++j) - object.contestedResourceIdentityVotes[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.toObject(message.contestedResourceIdentityVotes[j], options); - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - object.finishedResults = message.finishedResults; - return object; - }; - - /** - * Converts this ContestedResourceIdentityVotes to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceIdentityVotes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceIdentityVotes; - })(); - - GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice = (function() { - - /** - * Properties of a ResourceVoteChoice. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @interface IResourceVoteChoice - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType|null} [voteChoiceType] ResourceVoteChoice voteChoiceType - * @property {Uint8Array|null} [identityId] ResourceVoteChoice identityId - */ - - /** - * Constructs a new ResourceVoteChoice. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @classdesc Represents a ResourceVoteChoice. - * @implements IResourceVoteChoice - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set - */ - function ResourceVoteChoice(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceVoteChoice voteChoiceType. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType} voteChoiceType - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @instance - */ - ResourceVoteChoice.prototype.voteChoiceType = 0; - - /** - * ResourceVoteChoice identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @instance - */ - ResourceVoteChoice.prototype.identityId = $util.newBuffer([]); - - /** - * Creates a new ResourceVoteChoice instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice instance - */ - ResourceVoteChoice.create = function create(properties) { - return new ResourceVoteChoice(properties); - }; - - /** - * Encodes the specified ResourceVoteChoice message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceVoteChoice.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voteChoiceType != null && Object.hasOwnProperty.call(message, "voteChoiceType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.voteChoiceType); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityId); - return writer; - }; - - /** - * Encodes the specified ResourceVoteChoice message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceVoteChoice.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceVoteChoice message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceVoteChoice.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.voteChoiceType = reader.int32(); - break; - case 2: - message.identityId = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceVoteChoice message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceVoteChoice.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceVoteChoice message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceVoteChoice.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) - switch (message.voteChoiceType) { - default: - return "voteChoiceType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - return null; - }; - - /** - * Creates a ResourceVoteChoice message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice - */ - ResourceVoteChoice.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); - switch (object.voteChoiceType) { - case "TOWARDS_IDENTITY": - case 0: - message.voteChoiceType = 0; - break; - case "ABSTAIN": - case 1: - message.voteChoiceType = 1; - break; - case "LOCK": - case 2: - message.voteChoiceType = 2; - break; - } - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - return message; - }; - - /** - * Creates a plain object from a ResourceVoteChoice message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} message ResourceVoteChoice - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceVoteChoice.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.voteChoiceType = options.enums === String ? "TOWARDS_IDENTITY" : 0; - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - } - if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) - object.voteChoiceType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType[message.voteChoiceType] : message.voteChoiceType; - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - return object; - }; - - /** - * Converts this ResourceVoteChoice to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @instance - * @returns {Object.} JSON object - */ - ResourceVoteChoice.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * VoteChoiceType enum. - * @name org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType - * @enum {number} - * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value - * @property {number} ABSTAIN=1 ABSTAIN value - * @property {number} LOCK=2 LOCK value - */ - ResourceVoteChoice.VoteChoiceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; - values[valuesById[1] = "ABSTAIN"] = 1; - values[valuesById[2] = "LOCK"] = 2; - return values; - })(); - - return ResourceVoteChoice; - })(); - - GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote = (function() { - - /** - * Properties of a ContestedResourceIdentityVote. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @interface IContestedResourceIdentityVote - * @property {Uint8Array|null} [contractId] ContestedResourceIdentityVote contractId - * @property {string|null} [documentTypeName] ContestedResourceIdentityVote documentTypeName - * @property {Array.|null} [serializedIndexStorageValues] ContestedResourceIdentityVote serializedIndexStorageValues - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null} [voteChoice] ContestedResourceIdentityVote voteChoice - */ - - /** - * Constructs a new ContestedResourceIdentityVote. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @classdesc Represents a ContestedResourceIdentityVote. - * @implements IContestedResourceIdentityVote - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set - */ - function ContestedResourceIdentityVote(properties) { - this.serializedIndexStorageValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceIdentityVote contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - */ - ContestedResourceIdentityVote.prototype.contractId = $util.newBuffer([]); - - /** - * ContestedResourceIdentityVote documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - */ - ContestedResourceIdentityVote.prototype.documentTypeName = ""; - - /** - * ContestedResourceIdentityVote serializedIndexStorageValues. - * @member {Array.} serializedIndexStorageValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - */ - ContestedResourceIdentityVote.prototype.serializedIndexStorageValues = $util.emptyArray; - - /** - * ContestedResourceIdentityVote voteChoice. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null|undefined} voteChoice - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - */ - ContestedResourceIdentityVote.prototype.voteChoice = null; - - /** - * Creates a new ContestedResourceIdentityVote instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote instance - */ - ContestedResourceIdentityVote.create = function create(properties) { - return new ContestedResourceIdentityVote(properties); - }; - - /** - * Encodes the specified ContestedResourceIdentityVote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceIdentityVote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.serializedIndexStorageValues != null && message.serializedIndexStorageValues.length) - for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.serializedIndexStorageValues[i]); - if (message.voteChoice != null && Object.hasOwnProperty.call(message, "voteChoice")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.encode(message.voteChoice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContestedResourceIdentityVote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceIdentityVote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceIdentityVote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - if (!(message.serializedIndexStorageValues && message.serializedIndexStorageValues.length)) - message.serializedIndexStorageValues = []; - message.serializedIndexStorageValues.push(reader.bytes()); - break; - case 4: - message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceIdentityVote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceIdentityVote message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceIdentityVote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.serializedIndexStorageValues != null && message.hasOwnProperty("serializedIndexStorageValues")) { - if (!Array.isArray(message.serializedIndexStorageValues)) - return "serializedIndexStorageValues: array expected"; - for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) - if (!(message.serializedIndexStorageValues[i] && typeof message.serializedIndexStorageValues[i].length === "number" || $util.isString(message.serializedIndexStorageValues[i]))) - return "serializedIndexStorageValues: buffer[] expected"; - } - if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify(message.voteChoice); - if (error) - return "voteChoice." + error; - } - return null; - }; - - /** - * Creates a ContestedResourceIdentityVote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote - */ - ContestedResourceIdentityVote.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.serializedIndexStorageValues) { - if (!Array.isArray(object.serializedIndexStorageValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.serializedIndexStorageValues: array expected"); - message.serializedIndexStorageValues = []; - for (var i = 0; i < object.serializedIndexStorageValues.length; ++i) - if (typeof object.serializedIndexStorageValues[i] === "string") - $util.base64.decode(object.serializedIndexStorageValues[i], message.serializedIndexStorageValues[i] = $util.newBuffer($util.base64.length(object.serializedIndexStorageValues[i])), 0); - else if (object.serializedIndexStorageValues[i].length >= 0) - message.serializedIndexStorageValues[i] = object.serializedIndexStorageValues[i]; - } - if (object.voteChoice != null) { - if (typeof object.voteChoice !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.voteChoice: object expected"); - message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.fromObject(object.voteChoice); - } - return message; - }; - - /** - * Creates a plain object from a ContestedResourceIdentityVote message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} message ContestedResourceIdentityVote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceIdentityVote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.serializedIndexStorageValues = []; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.voteChoice = null; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.serializedIndexStorageValues && message.serializedIndexStorageValues.length) { - object.serializedIndexStorageValues = []; - for (var j = 0; j < message.serializedIndexStorageValues.length; ++j) - object.serializedIndexStorageValues[j] = options.bytes === String ? $util.base64.encode(message.serializedIndexStorageValues[j], 0, message.serializedIndexStorageValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedIndexStorageValues[j]) : message.serializedIndexStorageValues[j]; - } - if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) - object.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.toObject(message.voteChoice, options); - return object; - }; - - /** - * Converts this ContestedResourceIdentityVote to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceIdentityVote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceIdentityVote; - })(); - - return GetContestedResourceIdentityVotesResponseV0; - })(); - - return GetContestedResourceIdentityVotesResponse; - })(); - - v0.GetPrefundedSpecializedBalanceRequest = (function() { - - /** - * Properties of a GetPrefundedSpecializedBalanceRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetPrefundedSpecializedBalanceRequest - * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null} [v0] GetPrefundedSpecializedBalanceRequest v0 - */ - - /** - * Constructs a new GetPrefundedSpecializedBalanceRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetPrefundedSpecializedBalanceRequest. - * @implements IGetPrefundedSpecializedBalanceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set - */ - function GetPrefundedSpecializedBalanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPrefundedSpecializedBalanceRequest v0. - * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @instance - */ - GetPrefundedSpecializedBalanceRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPrefundedSpecializedBalanceRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @instance - */ - Object.defineProperty(GetPrefundedSpecializedBalanceRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPrefundedSpecializedBalanceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest instance - */ - GetPrefundedSpecializedBalanceRequest.create = function create(properties) { - return new GetPrefundedSpecializedBalanceRequest(properties); - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPrefundedSpecializedBalanceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPrefundedSpecializedBalanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetPrefundedSpecializedBalanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest - */ - GetPrefundedSpecializedBalanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetPrefundedSpecializedBalanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPrefundedSpecializedBalanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetPrefundedSpecializedBalanceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetPrefundedSpecializedBalanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 = (function() { - - /** - * Properties of a GetPrefundedSpecializedBalanceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @interface IGetPrefundedSpecializedBalanceRequestV0 - * @property {Uint8Array|null} [id] GetPrefundedSpecializedBalanceRequestV0 id - * @property {boolean|null} [prove] GetPrefundedSpecializedBalanceRequestV0 prove - */ - - /** - * Constructs a new GetPrefundedSpecializedBalanceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @classdesc Represents a GetPrefundedSpecializedBalanceRequestV0. - * @implements IGetPrefundedSpecializedBalanceRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set - */ - function GetPrefundedSpecializedBalanceRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPrefundedSpecializedBalanceRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @instance - */ - GetPrefundedSpecializedBalanceRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetPrefundedSpecializedBalanceRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @instance - */ - GetPrefundedSpecializedBalanceRequestV0.prototype.prove = false; - - /** - * Creates a new GetPrefundedSpecializedBalanceRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 instance - */ - GetPrefundedSpecializedBalanceRequestV0.create = function create(properties) { - return new GetPrefundedSpecializedBalanceRequestV0(properties); - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPrefundedSpecializedBalanceRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPrefundedSpecializedBalanceRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetPrefundedSpecializedBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 - */ - GetPrefundedSpecializedBalanceRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetPrefundedSpecializedBalanceRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPrefundedSpecializedBalanceRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetPrefundedSpecializedBalanceRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetPrefundedSpecializedBalanceRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetPrefundedSpecializedBalanceRequestV0; - })(); - - return GetPrefundedSpecializedBalanceRequest; - })(); - - v0.GetPrefundedSpecializedBalanceResponse = (function() { - - /** - * Properties of a GetPrefundedSpecializedBalanceResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetPrefundedSpecializedBalanceResponse - * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null} [v0] GetPrefundedSpecializedBalanceResponse v0 - */ - - /** - * Constructs a new GetPrefundedSpecializedBalanceResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetPrefundedSpecializedBalanceResponse. - * @implements IGetPrefundedSpecializedBalanceResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set - */ - function GetPrefundedSpecializedBalanceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPrefundedSpecializedBalanceResponse v0. - * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @instance - */ - GetPrefundedSpecializedBalanceResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPrefundedSpecializedBalanceResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @instance - */ - Object.defineProperty(GetPrefundedSpecializedBalanceResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPrefundedSpecializedBalanceResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse instance - */ - GetPrefundedSpecializedBalanceResponse.create = function create(properties) { - return new GetPrefundedSpecializedBalanceResponse(properties); - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPrefundedSpecializedBalanceResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPrefundedSpecializedBalanceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetPrefundedSpecializedBalanceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse - */ - GetPrefundedSpecializedBalanceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetPrefundedSpecializedBalanceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPrefundedSpecializedBalanceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetPrefundedSpecializedBalanceResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @instance - * @returns {Object.} JSON object - */ - GetPrefundedSpecializedBalanceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 = (function() { - - /** - * Properties of a GetPrefundedSpecializedBalanceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @interface IGetPrefundedSpecializedBalanceResponseV0 - * @property {number|Long|null} [balance] GetPrefundedSpecializedBalanceResponseV0 balance - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPrefundedSpecializedBalanceResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPrefundedSpecializedBalanceResponseV0 metadata - */ - - /** - * Constructs a new GetPrefundedSpecializedBalanceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @classdesc Represents a GetPrefundedSpecializedBalanceResponseV0. - * @implements IGetPrefundedSpecializedBalanceResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set - */ - function GetPrefundedSpecializedBalanceResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPrefundedSpecializedBalanceResponseV0 balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - */ - GetPrefundedSpecializedBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetPrefundedSpecializedBalanceResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - */ - GetPrefundedSpecializedBalanceResponseV0.prototype.proof = null; - - /** - * GetPrefundedSpecializedBalanceResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - */ - GetPrefundedSpecializedBalanceResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPrefundedSpecializedBalanceResponseV0 result. - * @member {"balance"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - */ - Object.defineProperty(GetPrefundedSpecializedBalanceResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPrefundedSpecializedBalanceResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 instance - */ - GetPrefundedSpecializedBalanceResponseV0.create = function create(properties) { - return new GetPrefundedSpecializedBalanceResponseV0(properties); - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balance = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPrefundedSpecializedBalanceResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPrefundedSpecializedBalanceResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.balance != null && message.hasOwnProperty("balance")) { - properties.result = 1; - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetPrefundedSpecializedBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 - */ - GetPrefundedSpecializedBalanceResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetPrefundedSpecializedBalanceResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPrefundedSpecializedBalanceResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.balance != null && message.hasOwnProperty("balance")) { - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - if (options.oneofs) - object.result = "balance"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetPrefundedSpecializedBalanceResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetPrefundedSpecializedBalanceResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetPrefundedSpecializedBalanceResponseV0; - })(); - - return GetPrefundedSpecializedBalanceResponse; - })(); - - v0.GetTotalCreditsInPlatformRequest = (function() { - - /** - * Properties of a GetTotalCreditsInPlatformRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTotalCreditsInPlatformRequest - * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null} [v0] GetTotalCreditsInPlatformRequest v0 - */ - - /** - * Constructs a new GetTotalCreditsInPlatformRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTotalCreditsInPlatformRequest. - * @implements IGetTotalCreditsInPlatformRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set - */ - function GetTotalCreditsInPlatformRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTotalCreditsInPlatformRequest v0. - * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @instance - */ - GetTotalCreditsInPlatformRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTotalCreditsInPlatformRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @instance - */ - Object.defineProperty(GetTotalCreditsInPlatformRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTotalCreditsInPlatformRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest instance - */ - GetTotalCreditsInPlatformRequest.create = function create(properties) { - return new GetTotalCreditsInPlatformRequest(properties); - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTotalCreditsInPlatformRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTotalCreditsInPlatformRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTotalCreditsInPlatformRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest - */ - GetTotalCreditsInPlatformRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTotalCreditsInPlatformRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTotalCreditsInPlatformRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTotalCreditsInPlatformRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @instance - * @returns {Object.} JSON object - */ - GetTotalCreditsInPlatformRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 = (function() { - - /** - * Properties of a GetTotalCreditsInPlatformRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @interface IGetTotalCreditsInPlatformRequestV0 - * @property {boolean|null} [prove] GetTotalCreditsInPlatformRequestV0 prove - */ - - /** - * Constructs a new GetTotalCreditsInPlatformRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @classdesc Represents a GetTotalCreditsInPlatformRequestV0. - * @implements IGetTotalCreditsInPlatformRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set - */ - function GetTotalCreditsInPlatformRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTotalCreditsInPlatformRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @instance - */ - GetTotalCreditsInPlatformRequestV0.prototype.prove = false; - - /** - * Creates a new GetTotalCreditsInPlatformRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 instance - */ - GetTotalCreditsInPlatformRequestV0.create = function create(properties) { - return new GetTotalCreditsInPlatformRequestV0(properties); - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTotalCreditsInPlatformRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTotalCreditsInPlatformRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTotalCreditsInPlatformRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 - */ - GetTotalCreditsInPlatformRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTotalCreditsInPlatformRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTotalCreditsInPlatformRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.prove = false; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTotalCreditsInPlatformRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTotalCreditsInPlatformRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTotalCreditsInPlatformRequestV0; - })(); - - return GetTotalCreditsInPlatformRequest; - })(); - - v0.GetTotalCreditsInPlatformResponse = (function() { - - /** - * Properties of a GetTotalCreditsInPlatformResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTotalCreditsInPlatformResponse - * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null} [v0] GetTotalCreditsInPlatformResponse v0 - */ - - /** - * Constructs a new GetTotalCreditsInPlatformResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTotalCreditsInPlatformResponse. - * @implements IGetTotalCreditsInPlatformResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set - */ - function GetTotalCreditsInPlatformResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTotalCreditsInPlatformResponse v0. - * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @instance - */ - GetTotalCreditsInPlatformResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTotalCreditsInPlatformResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @instance - */ - Object.defineProperty(GetTotalCreditsInPlatformResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTotalCreditsInPlatformResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse instance - */ - GetTotalCreditsInPlatformResponse.create = function create(properties) { - return new GetTotalCreditsInPlatformResponse(properties); - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTotalCreditsInPlatformResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTotalCreditsInPlatformResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTotalCreditsInPlatformResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse - */ - GetTotalCreditsInPlatformResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTotalCreditsInPlatformResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTotalCreditsInPlatformResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTotalCreditsInPlatformResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @instance - * @returns {Object.} JSON object - */ - GetTotalCreditsInPlatformResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 = (function() { - - /** - * Properties of a GetTotalCreditsInPlatformResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @interface IGetTotalCreditsInPlatformResponseV0 - * @property {number|Long|null} [credits] GetTotalCreditsInPlatformResponseV0 credits - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTotalCreditsInPlatformResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTotalCreditsInPlatformResponseV0 metadata - */ - - /** - * Constructs a new GetTotalCreditsInPlatformResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @classdesc Represents a GetTotalCreditsInPlatformResponseV0. - * @implements IGetTotalCreditsInPlatformResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set - */ - function GetTotalCreditsInPlatformResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTotalCreditsInPlatformResponseV0 credits. - * @member {number|Long} credits - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - */ - GetTotalCreditsInPlatformResponseV0.prototype.credits = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetTotalCreditsInPlatformResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - */ - GetTotalCreditsInPlatformResponseV0.prototype.proof = null; - - /** - * GetTotalCreditsInPlatformResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - */ - GetTotalCreditsInPlatformResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTotalCreditsInPlatformResponseV0 result. - * @member {"credits"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - */ - Object.defineProperty(GetTotalCreditsInPlatformResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["credits", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTotalCreditsInPlatformResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 instance - */ - GetTotalCreditsInPlatformResponseV0.create = function create(properties) { - return new GetTotalCreditsInPlatformResponseV0(properties); - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.credits != null && Object.hasOwnProperty.call(message, "credits")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.credits); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.credits = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTotalCreditsInPlatformResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTotalCreditsInPlatformResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.credits != null && message.hasOwnProperty("credits")) { - properties.result = 1; - if (!$util.isInteger(message.credits) && !(message.credits && $util.isInteger(message.credits.low) && $util.isInteger(message.credits.high))) - return "credits: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTotalCreditsInPlatformResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 - */ - GetTotalCreditsInPlatformResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); - if (object.credits != null) - if ($util.Long) - (message.credits = $util.Long.fromValue(object.credits)).unsigned = true; - else if (typeof object.credits === "string") - message.credits = parseInt(object.credits, 10); - else if (typeof object.credits === "number") - message.credits = object.credits; - else if (typeof object.credits === "object") - message.credits = new $util.LongBits(object.credits.low >>> 0, object.credits.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTotalCreditsInPlatformResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTotalCreditsInPlatformResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.credits != null && message.hasOwnProperty("credits")) { - if (typeof message.credits === "number") - object.credits = options.longs === String ? String(message.credits) : message.credits; - else - object.credits = options.longs === String ? $util.Long.prototype.toString.call(message.credits) : options.longs === Number ? new $util.LongBits(message.credits.low >>> 0, message.credits.high >>> 0).toNumber(true) : message.credits; - if (options.oneofs) - object.result = "credits"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTotalCreditsInPlatformResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTotalCreditsInPlatformResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTotalCreditsInPlatformResponseV0; - })(); - - return GetTotalCreditsInPlatformResponse; - })(); - - v0.GetPathElementsRequest = (function() { - - /** - * Properties of a GetPathElementsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetPathElementsRequest - * @property {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null} [v0] GetPathElementsRequest v0 - */ - - /** - * Constructs a new GetPathElementsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetPathElementsRequest. - * @implements IGetPathElementsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set - */ - function GetPathElementsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPathElementsRequest v0. - * @member {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @instance - */ - GetPathElementsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPathElementsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @instance - */ - Object.defineProperty(GetPathElementsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPathElementsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest instance - */ - GetPathElementsRequest.create = function create(properties) { - return new GetPathElementsRequest(properties); - }; - - /** - * Encodes the specified GetPathElementsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPathElementsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPathElementsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPathElementsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPathElementsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPathElementsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetPathElementsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest - */ - GetPathElementsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetPathElementsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest} message GetPathElementsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPathElementsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetPathElementsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @instance - * @returns {Object.} JSON object - */ - GetPathElementsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPathElementsRequest.GetPathElementsRequestV0 = (function() { - - /** - * Properties of a GetPathElementsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @interface IGetPathElementsRequestV0 - * @property {Array.|null} [path] GetPathElementsRequestV0 path - * @property {Array.|null} [keys] GetPathElementsRequestV0 keys - * @property {boolean|null} [prove] GetPathElementsRequestV0 prove - */ - - /** - * Constructs a new GetPathElementsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @classdesc Represents a GetPathElementsRequestV0. - * @implements IGetPathElementsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set - */ - function GetPathElementsRequestV0(properties) { - this.path = []; - this.keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPathElementsRequestV0 path. - * @member {Array.} path - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @instance - */ - GetPathElementsRequestV0.prototype.path = $util.emptyArray; - - /** - * GetPathElementsRequestV0 keys. - * @member {Array.} keys - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @instance - */ - GetPathElementsRequestV0.prototype.keys = $util.emptyArray; - - /** - * GetPathElementsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @instance - */ - GetPathElementsRequestV0.prototype.prove = false; - - /** - * Creates a new GetPathElementsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 instance - */ - GetPathElementsRequestV0.create = function create(properties) { - return new GetPathElementsRequestV0(properties); - }; - - /** - * Encodes the specified GetPathElementsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) - for (var i = 0; i < message.path.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path[i]); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keys[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetPathElementsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - message.path.push(reader.bytes()); - break; - case 2: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPathElementsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPathElementsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!(message.path[i] && typeof message.path[i].length === "number" || $util.isString(message.path[i]))) - return "path: buffer[] expected"; - } - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) - if (!(message.keys[i] && typeof message.keys[i].length === "number" || $util.isString(message.keys[i]))) - return "keys: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetPathElementsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 - */ - GetPathElementsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - if (typeof object.path[i] === "string") - $util.base64.decode(object.path[i], message.path[i] = $util.newBuffer($util.base64.length(object.path[i])), 0); - else if (object.path[i].length >= 0) - message.path[i] = object.path[i]; - } - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) - if (typeof object.keys[i] === "string") - $util.base64.decode(object.keys[i], message.keys[i] = $util.newBuffer($util.base64.length(object.keys[i])), 0); - else if (object.keys[i].length >= 0) - message.keys[i] = object.keys[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetPathElementsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} message GetPathElementsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPathElementsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.keys = []; - } - if (options.defaults) - object.prove = false; - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = options.bytes === String ? $util.base64.encode(message.path[j], 0, message.path[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.path[j]) : message.path[j]; - } - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = options.bytes === String ? $util.base64.encode(message.keys[j], 0, message.keys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keys[j]) : message.keys[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetPathElementsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetPathElementsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetPathElementsRequestV0; - })(); - - return GetPathElementsRequest; - })(); - - v0.GetPathElementsResponse = (function() { - - /** - * Properties of a GetPathElementsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetPathElementsResponse - * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null} [v0] GetPathElementsResponse v0 - */ - - /** - * Constructs a new GetPathElementsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetPathElementsResponse. - * @implements IGetPathElementsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set - */ - function GetPathElementsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPathElementsResponse v0. - * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @instance - */ - GetPathElementsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPathElementsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @instance - */ - Object.defineProperty(GetPathElementsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPathElementsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse instance - */ - GetPathElementsResponse.create = function create(properties) { - return new GetPathElementsResponse(properties); - }; - - /** - * Encodes the specified GetPathElementsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPathElementsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPathElementsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPathElementsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPathElementsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPathElementsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetPathElementsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse - */ - GetPathElementsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetPathElementsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} message GetPathElementsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPathElementsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetPathElementsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @instance - * @returns {Object.} JSON object - */ - GetPathElementsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPathElementsResponse.GetPathElementsResponseV0 = (function() { - - /** - * Properties of a GetPathElementsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @interface IGetPathElementsResponseV0 - * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null} [elements] GetPathElementsResponseV0 elements - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPathElementsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPathElementsResponseV0 metadata - */ - - /** - * Constructs a new GetPathElementsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @classdesc Represents a GetPathElementsResponseV0. - * @implements IGetPathElementsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set - */ - function GetPathElementsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPathElementsResponseV0 elements. - * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null|undefined} elements - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - */ - GetPathElementsResponseV0.prototype.elements = null; - - /** - * GetPathElementsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - */ - GetPathElementsResponseV0.prototype.proof = null; - - /** - * GetPathElementsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - */ - GetPathElementsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPathElementsResponseV0 result. - * @member {"elements"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - */ - Object.defineProperty(GetPathElementsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["elements", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPathElementsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 instance - */ - GetPathElementsResponseV0.create = function create(properties) { - return new GetPathElementsResponseV0(properties); - }; - - /** - * Encodes the specified GetPathElementsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.elements != null && Object.hasOwnProperty.call(message, "elements")) - $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.encode(message.elements, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPathElementsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPathElementsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPathElementsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.elements != null && message.hasOwnProperty("elements")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify(message.elements); - if (error) - return "elements." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetPathElementsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 - */ - GetPathElementsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); - if (object.elements != null) { - if (typeof object.elements !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.elements: object expected"); - message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.fromObject(object.elements); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetPathElementsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} message GetPathElementsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPathElementsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.elements != null && message.hasOwnProperty("elements")) { - object.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.toObject(message.elements, options); - if (options.oneofs) - object.result = "elements"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetPathElementsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetPathElementsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPathElementsResponseV0.Elements = (function() { - - /** - * Properties of an Elements. - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @interface IElements - * @property {Array.|null} [elements] Elements elements - */ - - /** - * Constructs a new Elements. - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @classdesc Represents an Elements. - * @implements IElements - * @constructor - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set - */ - function Elements(properties) { - this.elements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Elements elements. - * @member {Array.} elements - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @instance - */ - Elements.prototype.elements = $util.emptyArray; - - /** - * Creates a new Elements instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements instance - */ - Elements.create = function create(properties) { - return new Elements(properties); - }; - - /** - * Encodes the specified Elements message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Elements.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.elements != null && message.elements.length) - for (var i = 0; i < message.elements.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.elements[i]); - return writer; - }; - - /** - * Encodes the specified Elements message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Elements.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Elements message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Elements.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.elements && message.elements.length)) - message.elements = []; - message.elements.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Elements message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Elements.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Elements message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Elements.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.elements != null && message.hasOwnProperty("elements")) { - if (!Array.isArray(message.elements)) - return "elements: array expected"; - for (var i = 0; i < message.elements.length; ++i) - if (!(message.elements[i] && typeof message.elements[i].length === "number" || $util.isString(message.elements[i]))) - return "elements: buffer[] expected"; - } - return null; - }; - - /** - * Creates an Elements message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements - */ - Elements.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); - if (object.elements) { - if (!Array.isArray(object.elements)) - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.elements: array expected"); - message.elements = []; - for (var i = 0; i < object.elements.length; ++i) - if (typeof object.elements[i] === "string") - $util.base64.decode(object.elements[i], message.elements[i] = $util.newBuffer($util.base64.length(object.elements[i])), 0); - else if (object.elements[i].length >= 0) - message.elements[i] = object.elements[i]; - } - return message; - }; - - /** - * Creates a plain object from an Elements message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} message Elements - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Elements.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.elements = []; - if (message.elements && message.elements.length) { - object.elements = []; - for (var j = 0; j < message.elements.length; ++j) - object.elements[j] = options.bytes === String ? $util.base64.encode(message.elements[j], 0, message.elements[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.elements[j]) : message.elements[j]; - } - return object; - }; - - /** - * Converts this Elements to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @instance - * @returns {Object.} JSON object - */ - Elements.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Elements; - })(); - - return GetPathElementsResponseV0; - })(); - - return GetPathElementsResponse; - })(); - - v0.GetStatusRequest = (function() { - - /** - * Properties of a GetStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetStatusRequest - * @property {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null} [v0] GetStatusRequest v0 - */ - - /** - * Constructs a new GetStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetStatusRequest. - * @implements IGetStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set - */ - function GetStatusRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetStatusRequest v0. - * @member {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @instance - */ - GetStatusRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetStatusRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @instance - */ - Object.defineProperty(GetStatusRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest instance - */ - GetStatusRequest.create = function create(properties) { - return new GetStatusRequest(properties); - }; - - /** - * Encodes the specified GetStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest - */ - GetStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest} message GetStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @instance - * @returns {Object.} JSON object - */ - GetStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetStatusRequest.GetStatusRequestV0 = (function() { - - /** - * Properties of a GetStatusRequestV0. - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @interface IGetStatusRequestV0 - */ - - /** - * Constructs a new GetStatusRequestV0. - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @classdesc Represents a GetStatusRequestV0. - * @implements IGetStatusRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set - */ - function GetStatusRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new GetStatusRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 instance - */ - GetStatusRequestV0.create = function create(properties) { - return new GetStatusRequestV0(properties); - }; - - /** - * Encodes the specified GetStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GetStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStatusRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetStatusRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStatusRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStatusRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GetStatusRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 - */ - GetStatusRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0) - return object; - return new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); - }; - - /** - * Creates a plain object from a GetStatusRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} message GetStatusRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStatusRequestV0.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GetStatusRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetStatusRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetStatusRequestV0; - })(); - - return GetStatusRequest; - })(); - - v0.GetStatusResponse = (function() { - - /** - * Properties of a GetStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetStatusResponse - * @property {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null} [v0] GetStatusResponse v0 - */ - - /** - * Constructs a new GetStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetStatusResponse. - * @implements IGetStatusResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set - */ - function GetStatusResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetStatusResponse v0. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @instance - */ - GetStatusResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetStatusResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @instance - */ - Object.defineProperty(GetStatusResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetStatusResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse instance - */ - GetStatusResponse.create = function create(properties) { - return new GetStatusResponse(properties); - }; - - /** - * Encodes the specified GetStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStatusResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetStatusResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStatusResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStatusResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetStatusResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse - */ - GetStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetStatusResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse} message GetStatusResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStatusResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetStatusResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @instance - * @returns {Object.} JSON object - */ - GetStatusResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetStatusResponse.GetStatusResponseV0 = (function() { - - /** - * Properties of a GetStatusResponseV0. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @interface IGetStatusResponseV0 - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null} [version] GetStatusResponseV0 version - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null} [node] GetStatusResponseV0 node - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null} [chain] GetStatusResponseV0 chain - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null} [network] GetStatusResponseV0 network - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null} [stateSync] GetStatusResponseV0 stateSync - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null} [time] GetStatusResponseV0 time - */ - - /** - * Constructs a new GetStatusResponseV0. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @classdesc Represents a GetStatusResponseV0. - * @implements IGetStatusResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set - */ - function GetStatusResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetStatusResponseV0 version. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null|undefined} version - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.version = null; - - /** - * GetStatusResponseV0 node. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null|undefined} node - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.node = null; - - /** - * GetStatusResponseV0 chain. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null|undefined} chain - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.chain = null; - - /** - * GetStatusResponseV0 network. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null|undefined} network - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.network = null; - - /** - * GetStatusResponseV0 stateSync. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null|undefined} stateSync - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.stateSync = null; - - /** - * GetStatusResponseV0 time. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null|undefined} time - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.time = null; - - /** - * Creates a new GetStatusResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 instance - */ - GetStatusResponseV0.create = function create(properties) { - return new GetStatusResponseV0(properties); - }; - - /** - * Encodes the specified GetStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.node != null && Object.hasOwnProperty.call(message, "node")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.encode(message.node, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.encode(message.chain, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.encode(message.network, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.stateSync != null && Object.hasOwnProperty.call(message, "stateSync")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.encode(message.stateSync, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.encode(message.time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStatusResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.decode(reader, reader.uint32()); - break; - case 2: - message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.decode(reader, reader.uint32()); - break; - case 3: - message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.decode(reader, reader.uint32()); - break; - case 4: - message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.decode(reader, reader.uint32()); - break; - case 5: - message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.decode(reader, reader.uint32()); - break; - case 6: - message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetStatusResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStatusResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStatusResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify(message.version); - if (error) - return "version." + error; - } - if (message.node != null && message.hasOwnProperty("node")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify(message.node); - if (error) - return "node." + error; - } - if (message.chain != null && message.hasOwnProperty("chain")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify(message.chain); - if (error) - return "chain." + error; - } - if (message.network != null && message.hasOwnProperty("network")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify(message.network); - if (error) - return "network." + error; - } - if (message.stateSync != null && message.hasOwnProperty("stateSync")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify(message.stateSync); - if (error) - return "stateSync." + error; - } - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify(message.time); - if (error) - return "time." + error; - } - return null; - }; - - /** - * Creates a GetStatusResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 - */ - GetStatusResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.version: object expected"); - message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.fromObject(object.version); - } - if (object.node != null) { - if (typeof object.node !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.node: object expected"); - message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.fromObject(object.node); - } - if (object.chain != null) { - if (typeof object.chain !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.chain: object expected"); - message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.fromObject(object.chain); - } - if (object.network != null) { - if (typeof object.network !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.network: object expected"); - message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.fromObject(object.network); - } - if (object.stateSync != null) { - if (typeof object.stateSync !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.stateSync: object expected"); - message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.fromObject(object.stateSync); - } - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.time: object expected"); - message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.fromObject(object.time); - } - return message; - }; - - /** - * Creates a plain object from a GetStatusResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} message GetStatusResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStatusResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = null; - object.node = null; - object.chain = null; - object.network = null; - object.stateSync = null; - object.time = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.toObject(message.version, options); - if (message.node != null && message.hasOwnProperty("node")) - object.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.toObject(message.node, options); - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.toObject(message.chain, options); - if (message.network != null && message.hasOwnProperty("network")) - object.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.toObject(message.network, options); - if (message.stateSync != null && message.hasOwnProperty("stateSync")) - object.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.toObject(message.stateSync, options); - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.toObject(message.time, options); - return object; - }; - - /** - * Converts this GetStatusResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetStatusResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetStatusResponseV0.Version = (function() { - - /** - * Properties of a Version. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface IVersion - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null} [software] Version software - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null} [protocol] Version protocol - */ - - /** - * Constructs a new Version. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Version. - * @implements IVersion - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set - */ - function Version(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Version software. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null|undefined} software - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @instance - */ - Version.prototype.software = null; - - /** - * Version protocol. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null|undefined} protocol - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @instance - */ - Version.prototype.protocol = null; - - /** - * Creates a new Version instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version instance - */ - Version.create = function create(properties) { - return new Version(properties); - }; - - /** - * Encodes the specified Version message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.software != null && Object.hasOwnProperty.call(message, "software")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.encode(message.software, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.encode(message.protocol, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Version message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.decode(reader, reader.uint32()); - break; - case 2: - message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Version message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Version message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Version.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.software != null && message.hasOwnProperty("software")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify(message.software); - if (error) - return "software." + error; - } - if (message.protocol != null && message.hasOwnProperty("protocol")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify(message.protocol); - if (error) - return "protocol." + error; - } - return null; - }; - - /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version - */ - Version.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); - if (object.software != null) { - if (typeof object.software !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.software: object expected"); - message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.fromObject(object.software); - } - if (object.protocol != null) { - if (typeof object.protocol !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.protocol: object expected"); - message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.fromObject(object.protocol); - } - return message; - }; - - /** - * Creates a plain object from a Version message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} message Version - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Version.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.software = null; - object.protocol = null; - } - if (message.software != null && message.hasOwnProperty("software")) - object.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.toObject(message.software, options); - if (message.protocol != null && message.hasOwnProperty("protocol")) - object.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.toObject(message.protocol, options); - return object; - }; - - /** - * Converts this Version to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @instance - * @returns {Object.} JSON object - */ - Version.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Version.Software = (function() { - - /** - * Properties of a Software. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @interface ISoftware - * @property {string|null} [dapi] Software dapi - * @property {string|null} [drive] Software drive - * @property {string|null} [tenderdash] Software tenderdash - */ - - /** - * Constructs a new Software. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @classdesc Represents a Software. - * @implements ISoftware - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set - */ - function Software(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Software dapi. - * @member {string} dapi - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @instance - */ - Software.prototype.dapi = ""; - - /** - * Software drive. - * @member {string} drive - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @instance - */ - Software.prototype.drive = ""; - - /** - * Software tenderdash. - * @member {string} tenderdash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @instance - */ - Software.prototype.tenderdash = ""; - - /** - * Creates a new Software instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software instance - */ - Software.create = function create(properties) { - return new Software(properties); - }; - - /** - * Encodes the specified Software message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Software.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dapi != null && Object.hasOwnProperty.call(message, "dapi")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dapi); - if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.drive); - if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tenderdash); - return writer; - }; - - /** - * Encodes the specified Software message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Software.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Software message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Software.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dapi = reader.string(); - break; - case 2: - message.drive = reader.string(); - break; - case 3: - message.tenderdash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Software message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Software.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Software message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Software.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dapi != null && message.hasOwnProperty("dapi")) - if (!$util.isString(message.dapi)) - return "dapi: string expected"; - if (message.drive != null && message.hasOwnProperty("drive")) - if (!$util.isString(message.drive)) - return "drive: string expected"; - if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) - if (!$util.isString(message.tenderdash)) - return "tenderdash: string expected"; - return null; - }; - - /** - * Creates a Software message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software - */ - Software.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); - if (object.dapi != null) - message.dapi = String(object.dapi); - if (object.drive != null) - message.drive = String(object.drive); - if (object.tenderdash != null) - message.tenderdash = String(object.tenderdash); - return message; - }; - - /** - * Creates a plain object from a Software message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} message Software - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Software.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dapi = ""; - object.drive = ""; - object.tenderdash = ""; - } - if (message.dapi != null && message.hasOwnProperty("dapi")) - object.dapi = message.dapi; - if (message.drive != null && message.hasOwnProperty("drive")) - object.drive = message.drive; - if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) - object.tenderdash = message.tenderdash; - return object; - }; - - /** - * Converts this Software to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @instance - * @returns {Object.} JSON object - */ - Software.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Software; - })(); - - Version.Protocol = (function() { - - /** - * Properties of a Protocol. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @interface IProtocol - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null} [tenderdash] Protocol tenderdash - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null} [drive] Protocol drive - */ - - /** - * Constructs a new Protocol. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @classdesc Represents a Protocol. - * @implements IProtocol - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set - */ - function Protocol(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Protocol tenderdash. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null|undefined} tenderdash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @instance - */ - Protocol.prototype.tenderdash = null; - - /** - * Protocol drive. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null|undefined} drive - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @instance - */ - Protocol.prototype.drive = null; - - /** - * Creates a new Protocol instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol instance - */ - Protocol.create = function create(properties) { - return new Protocol(properties); - }; - - /** - * Encodes the specified Protocol message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Protocol.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.encode(message.tenderdash, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.encode(message.drive, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Protocol message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Protocol.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Protocol message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Protocol.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.decode(reader, reader.uint32()); - break; - case 2: - message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Protocol message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Protocol.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Protocol message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Protocol.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify(message.tenderdash); - if (error) - return "tenderdash." + error; - } - if (message.drive != null && message.hasOwnProperty("drive")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify(message.drive); - if (error) - return "drive." + error; - } - return null; - }; - - /** - * Creates a Protocol message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol - */ - Protocol.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); - if (object.tenderdash != null) { - if (typeof object.tenderdash !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.tenderdash: object expected"); - message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.fromObject(object.tenderdash); - } - if (object.drive != null) { - if (typeof object.drive !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.drive: object expected"); - message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.fromObject(object.drive); - } - return message; - }; - - /** - * Creates a plain object from a Protocol message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} message Protocol - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Protocol.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tenderdash = null; - object.drive = null; - } - if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) - object.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.toObject(message.tenderdash, options); - if (message.drive != null && message.hasOwnProperty("drive")) - object.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.toObject(message.drive, options); - return object; - }; - - /** - * Converts this Protocol to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @instance - * @returns {Object.} JSON object - */ - Protocol.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Protocol.Tenderdash = (function() { - - /** - * Properties of a Tenderdash. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @interface ITenderdash - * @property {number|null} [p2p] Tenderdash p2p - * @property {number|null} [block] Tenderdash block - */ - - /** - * Constructs a new Tenderdash. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @classdesc Represents a Tenderdash. - * @implements ITenderdash - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set - */ - function Tenderdash(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Tenderdash p2p. - * @member {number} p2p - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @instance - */ - Tenderdash.prototype.p2p = 0; - - /** - * Tenderdash block. - * @member {number} block - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @instance - */ - Tenderdash.prototype.block = 0; - - /** - * Creates a new Tenderdash instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash instance - */ - Tenderdash.create = function create(properties) { - return new Tenderdash(properties); - }; - - /** - * Encodes the specified Tenderdash message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tenderdash.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.p2p); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.block); - return writer; - }; - - /** - * Encodes the specified Tenderdash message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tenderdash.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Tenderdash message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tenderdash.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.p2p = reader.uint32(); - break; - case 2: - message.block = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Tenderdash message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tenderdash.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Tenderdash message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Tenderdash.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.p2p != null && message.hasOwnProperty("p2p")) - if (!$util.isInteger(message.p2p)) - return "p2p: integer expected"; - if (message.block != null && message.hasOwnProperty("block")) - if (!$util.isInteger(message.block)) - return "block: integer expected"; - return null; - }; - - /** - * Creates a Tenderdash message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash - */ - Tenderdash.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); - if (object.p2p != null) - message.p2p = object.p2p >>> 0; - if (object.block != null) - message.block = object.block >>> 0; - return message; - }; - - /** - * Creates a plain object from a Tenderdash message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} message Tenderdash - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tenderdash.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.p2p = 0; - object.block = 0; - } - if (message.p2p != null && message.hasOwnProperty("p2p")) - object.p2p = message.p2p; - if (message.block != null && message.hasOwnProperty("block")) - object.block = message.block; - return object; - }; - - /** - * Converts this Tenderdash to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @instance - * @returns {Object.} JSON object - */ - Tenderdash.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Tenderdash; - })(); - - Protocol.Drive = (function() { - - /** - * Properties of a Drive. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @interface IDrive - * @property {number|null} [latest] Drive latest - * @property {number|null} [current] Drive current - */ - - /** - * Constructs a new Drive. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @classdesc Represents a Drive. - * @implements IDrive - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set - */ - function Drive(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Drive latest. - * @member {number} latest - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @instance - */ - Drive.prototype.latest = 0; - - /** - * Drive current. - * @member {number} current - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @instance - */ - Drive.prototype.current = 0; - - /** - * Creates a new Drive instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive instance - */ - Drive.create = function create(properties) { - return new Drive(properties); - }; - - /** - * Encodes the specified Drive message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Drive.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.latest != null && Object.hasOwnProperty.call(message, "latest")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.latest); - if (message.current != null && Object.hasOwnProperty.call(message, "current")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.current); - return writer; - }; - - /** - * Encodes the specified Drive message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Drive.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Drive message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Drive.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.latest = reader.uint32(); - break; - case 4: - message.current = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Drive message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Drive.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Drive message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Drive.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.latest != null && message.hasOwnProperty("latest")) - if (!$util.isInteger(message.latest)) - return "latest: integer expected"; - if (message.current != null && message.hasOwnProperty("current")) - if (!$util.isInteger(message.current)) - return "current: integer expected"; - return null; - }; - - /** - * Creates a Drive message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive - */ - Drive.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); - if (object.latest != null) - message.latest = object.latest >>> 0; - if (object.current != null) - message.current = object.current >>> 0; - return message; - }; - - /** - * Creates a plain object from a Drive message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} message Drive - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Drive.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.latest = 0; - object.current = 0; - } - if (message.latest != null && message.hasOwnProperty("latest")) - object.latest = message.latest; - if (message.current != null && message.hasOwnProperty("current")) - object.current = message.current; - return object; - }; - - /** - * Converts this Drive to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @instance - * @returns {Object.} JSON object - */ - Drive.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Drive; - })(); - - return Protocol; - })(); - - return Version; - })(); - - GetStatusResponseV0.Time = (function() { - - /** - * Properties of a Time. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface ITime - * @property {number|Long|null} [local] Time local - * @property {number|Long|null} [block] Time block - * @property {number|Long|null} [genesis] Time genesis - * @property {number|null} [epoch] Time epoch - */ - - /** - * Constructs a new Time. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Time. - * @implements ITime - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set - */ - function Time(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Time local. - * @member {number|Long} local - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - */ - Time.prototype.local = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Time block. - * @member {number|Long} block - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - */ - Time.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Time genesis. - * @member {number|Long} genesis - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - */ - Time.prototype.genesis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Time epoch. - * @member {number} epoch - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - */ - Time.prototype.epoch = 0; - - /** - * Creates a new Time instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time instance - */ - Time.create = function create(properties) { - return new Time(properties); - }; - - /** - * Encodes the specified Time message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Time.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.local != null && Object.hasOwnProperty.call(message, "local")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.local); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block); - if (message.genesis != null && Object.hasOwnProperty.call(message, "genesis")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.genesis); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.epoch); - return writer; - }; - - /** - * Encodes the specified Time message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Time.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Time message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Time.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.local = reader.uint64(); - break; - case 2: - message.block = reader.uint64(); - break; - case 3: - message.genesis = reader.uint64(); - break; - case 4: - message.epoch = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Time message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Time.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Time message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Time.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.local != null && message.hasOwnProperty("local")) - if (!$util.isInteger(message.local) && !(message.local && $util.isInteger(message.local.low) && $util.isInteger(message.local.high))) - return "local: integer|Long expected"; - if (message.block != null && message.hasOwnProperty("block")) - if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) - return "block: integer|Long expected"; - if (message.genesis != null && message.hasOwnProperty("genesis")) - if (!$util.isInteger(message.genesis) && !(message.genesis && $util.isInteger(message.genesis.low) && $util.isInteger(message.genesis.high))) - return "genesis: integer|Long expected"; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - return null; - }; - - /** - * Creates a Time message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time - */ - Time.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); - if (object.local != null) - if ($util.Long) - (message.local = $util.Long.fromValue(object.local)).unsigned = true; - else if (typeof object.local === "string") - message.local = parseInt(object.local, 10); - else if (typeof object.local === "number") - message.local = object.local; - else if (typeof object.local === "object") - message.local = new $util.LongBits(object.local.low >>> 0, object.local.high >>> 0).toNumber(true); - if (object.block != null) - if ($util.Long) - (message.block = $util.Long.fromValue(object.block)).unsigned = true; - else if (typeof object.block === "string") - message.block = parseInt(object.block, 10); - else if (typeof object.block === "number") - message.block = object.block; - else if (typeof object.block === "object") - message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); - if (object.genesis != null) - if ($util.Long) - (message.genesis = $util.Long.fromValue(object.genesis)).unsigned = true; - else if (typeof object.genesis === "string") - message.genesis = parseInt(object.genesis, 10); - else if (typeof object.genesis === "number") - message.genesis = object.genesis; - else if (typeof object.genesis === "object") - message.genesis = new $util.LongBits(object.genesis.low >>> 0, object.genesis.high >>> 0).toNumber(true); - if (object.epoch != null) - message.epoch = object.epoch >>> 0; - return message; - }; - - /** - * Creates a plain object from a Time message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} message Time - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Time.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.local = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.local = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.genesis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.genesis = options.longs === String ? "0" : 0; - object.epoch = 0; - } - if (message.local != null && message.hasOwnProperty("local")) - if (typeof message.local === "number") - object.local = options.longs === String ? String(message.local) : message.local; - else - object.local = options.longs === String ? $util.Long.prototype.toString.call(message.local) : options.longs === Number ? new $util.LongBits(message.local.low >>> 0, message.local.high >>> 0).toNumber(true) : message.local; - if (message.block != null && message.hasOwnProperty("block")) - if (typeof message.block === "number") - object.block = options.longs === String ? String(message.block) : message.block; - else - object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; - if (message.genesis != null && message.hasOwnProperty("genesis")) - if (typeof message.genesis === "number") - object.genesis = options.longs === String ? String(message.genesis) : message.genesis; - else - object.genesis = options.longs === String ? $util.Long.prototype.toString.call(message.genesis) : options.longs === Number ? new $util.LongBits(message.genesis.low >>> 0, message.genesis.high >>> 0).toNumber(true) : message.genesis; - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - return object; - }; - - /** - * Converts this Time to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - * @returns {Object.} JSON object - */ - Time.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Time; - })(); - - GetStatusResponseV0.Node = (function() { - - /** - * Properties of a Node. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface INode - * @property {Uint8Array|null} [id] Node id - * @property {Uint8Array|null} [proTxHash] Node proTxHash - */ - - /** - * Constructs a new Node. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set - */ - function Node(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Node id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @instance - */ - Node.prototype.id = $util.newBuffer([]); - - /** - * Node proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @instance - */ - Node.prototype.proTxHash = $util.newBuffer([]); - - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node instance - */ - Node.create = function create(properties) { - return new Node(properties); - }; - - /** - * Encodes the specified Node message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proTxHash); - return writer; - }; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Node message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.proTxHash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Node message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - return null; - }; - - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - return message; - }; - - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} message Node - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - return object; - }; - - /** - * Converts this Node to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Node; - })(); - - GetStatusResponseV0.Chain = (function() { - - /** - * Properties of a Chain. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface IChain - * @property {boolean|null} [catchingUp] Chain catchingUp - * @property {Uint8Array|null} [latestBlockHash] Chain latestBlockHash - * @property {Uint8Array|null} [latestAppHash] Chain latestAppHash - * @property {number|Long|null} [latestBlockHeight] Chain latestBlockHeight - * @property {Uint8Array|null} [earliestBlockHash] Chain earliestBlockHash - * @property {Uint8Array|null} [earliestAppHash] Chain earliestAppHash - * @property {number|Long|null} [earliestBlockHeight] Chain earliestBlockHeight - * @property {number|Long|null} [maxPeerBlockHeight] Chain maxPeerBlockHeight - * @property {number|null} [coreChainLockedHeight] Chain coreChainLockedHeight - */ - - /** - * Constructs a new Chain. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Chain. - * @implements IChain - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set - */ - function Chain(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Chain catchingUp. - * @member {boolean} catchingUp - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.catchingUp = false; - - /** - * Chain latestBlockHash. - * @member {Uint8Array} latestBlockHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.latestBlockHash = $util.newBuffer([]); - - /** - * Chain latestAppHash. - * @member {Uint8Array} latestAppHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.latestAppHash = $util.newBuffer([]); - - /** - * Chain latestBlockHeight. - * @member {number|Long} latestBlockHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.latestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Chain earliestBlockHash. - * @member {Uint8Array} earliestBlockHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.earliestBlockHash = $util.newBuffer([]); - - /** - * Chain earliestAppHash. - * @member {Uint8Array} earliestAppHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.earliestAppHash = $util.newBuffer([]); - - /** - * Chain earliestBlockHeight. - * @member {number|Long} earliestBlockHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.earliestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Chain maxPeerBlockHeight. - * @member {number|Long} maxPeerBlockHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.maxPeerBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Chain coreChainLockedHeight. - * @member {number} coreChainLockedHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.coreChainLockedHeight = 0; - - /** - * Creates a new Chain instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain instance - */ - Chain.create = function create(properties) { - return new Chain(properties); - }; - - /** - * Encodes the specified Chain message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.catchingUp != null && Object.hasOwnProperty.call(message, "catchingUp")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.catchingUp); - if (message.latestBlockHash != null && Object.hasOwnProperty.call(message, "latestBlockHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.latestBlockHash); - if (message.latestAppHash != null && Object.hasOwnProperty.call(message, "latestAppHash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.latestAppHash); - if (message.latestBlockHeight != null && Object.hasOwnProperty.call(message, "latestBlockHeight")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.latestBlockHeight); - if (message.earliestBlockHash != null && Object.hasOwnProperty.call(message, "earliestBlockHash")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.earliestBlockHash); - if (message.earliestAppHash != null && Object.hasOwnProperty.call(message, "earliestAppHash")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.earliestAppHash); - if (message.earliestBlockHeight != null && Object.hasOwnProperty.call(message, "earliestBlockHeight")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.earliestBlockHeight); - if (message.maxPeerBlockHeight != null && Object.hasOwnProperty.call(message, "maxPeerBlockHeight")) - writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.maxPeerBlockHeight); - if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) - writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.coreChainLockedHeight); - return writer; - }; - - /** - * Encodes the specified Chain message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chain message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chain.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.catchingUp = reader.bool(); - break; - case 2: - message.latestBlockHash = reader.bytes(); - break; - case 3: - message.latestAppHash = reader.bytes(); - break; - case 4: - message.latestBlockHeight = reader.uint64(); - break; - case 5: - message.earliestBlockHash = reader.bytes(); - break; - case 6: - message.earliestAppHash = reader.bytes(); - break; - case 7: - message.earliestBlockHeight = reader.uint64(); - break; - case 9: - message.maxPeerBlockHeight = reader.uint64(); - break; - case 10: - message.coreChainLockedHeight = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chain message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) - if (typeof message.catchingUp !== "boolean") - return "catchingUp: boolean expected"; - if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) - if (!(message.latestBlockHash && typeof message.latestBlockHash.length === "number" || $util.isString(message.latestBlockHash))) - return "latestBlockHash: buffer expected"; - if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) - if (!(message.latestAppHash && typeof message.latestAppHash.length === "number" || $util.isString(message.latestAppHash))) - return "latestAppHash: buffer expected"; - if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) - if (!$util.isInteger(message.latestBlockHeight) && !(message.latestBlockHeight && $util.isInteger(message.latestBlockHeight.low) && $util.isInteger(message.latestBlockHeight.high))) - return "latestBlockHeight: integer|Long expected"; - if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) - if (!(message.earliestBlockHash && typeof message.earliestBlockHash.length === "number" || $util.isString(message.earliestBlockHash))) - return "earliestBlockHash: buffer expected"; - if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) - if (!(message.earliestAppHash && typeof message.earliestAppHash.length === "number" || $util.isString(message.earliestAppHash))) - return "earliestAppHash: buffer expected"; - if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) - if (!$util.isInteger(message.earliestBlockHeight) && !(message.earliestBlockHeight && $util.isInteger(message.earliestBlockHeight.low) && $util.isInteger(message.earliestBlockHeight.high))) - return "earliestBlockHeight: integer|Long expected"; - if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) - if (!$util.isInteger(message.maxPeerBlockHeight) && !(message.maxPeerBlockHeight && $util.isInteger(message.maxPeerBlockHeight.low) && $util.isInteger(message.maxPeerBlockHeight.high))) - return "maxPeerBlockHeight: integer|Long expected"; - if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) - if (!$util.isInteger(message.coreChainLockedHeight)) - return "coreChainLockedHeight: integer expected"; - return null; - }; - - /** - * Creates a Chain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain - */ - Chain.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); - if (object.catchingUp != null) - message.catchingUp = Boolean(object.catchingUp); - if (object.latestBlockHash != null) - if (typeof object.latestBlockHash === "string") - $util.base64.decode(object.latestBlockHash, message.latestBlockHash = $util.newBuffer($util.base64.length(object.latestBlockHash)), 0); - else if (object.latestBlockHash.length >= 0) - message.latestBlockHash = object.latestBlockHash; - if (object.latestAppHash != null) - if (typeof object.latestAppHash === "string") - $util.base64.decode(object.latestAppHash, message.latestAppHash = $util.newBuffer($util.base64.length(object.latestAppHash)), 0); - else if (object.latestAppHash.length >= 0) - message.latestAppHash = object.latestAppHash; - if (object.latestBlockHeight != null) - if ($util.Long) - (message.latestBlockHeight = $util.Long.fromValue(object.latestBlockHeight)).unsigned = true; - else if (typeof object.latestBlockHeight === "string") - message.latestBlockHeight = parseInt(object.latestBlockHeight, 10); - else if (typeof object.latestBlockHeight === "number") - message.latestBlockHeight = object.latestBlockHeight; - else if (typeof object.latestBlockHeight === "object") - message.latestBlockHeight = new $util.LongBits(object.latestBlockHeight.low >>> 0, object.latestBlockHeight.high >>> 0).toNumber(true); - if (object.earliestBlockHash != null) - if (typeof object.earliestBlockHash === "string") - $util.base64.decode(object.earliestBlockHash, message.earliestBlockHash = $util.newBuffer($util.base64.length(object.earliestBlockHash)), 0); - else if (object.earliestBlockHash.length >= 0) - message.earliestBlockHash = object.earliestBlockHash; - if (object.earliestAppHash != null) - if (typeof object.earliestAppHash === "string") - $util.base64.decode(object.earliestAppHash, message.earliestAppHash = $util.newBuffer($util.base64.length(object.earliestAppHash)), 0); - else if (object.earliestAppHash.length >= 0) - message.earliestAppHash = object.earliestAppHash; - if (object.earliestBlockHeight != null) - if ($util.Long) - (message.earliestBlockHeight = $util.Long.fromValue(object.earliestBlockHeight)).unsigned = true; - else if (typeof object.earliestBlockHeight === "string") - message.earliestBlockHeight = parseInt(object.earliestBlockHeight, 10); - else if (typeof object.earliestBlockHeight === "number") - message.earliestBlockHeight = object.earliestBlockHeight; - else if (typeof object.earliestBlockHeight === "object") - message.earliestBlockHeight = new $util.LongBits(object.earliestBlockHeight.low >>> 0, object.earliestBlockHeight.high >>> 0).toNumber(true); - if (object.maxPeerBlockHeight != null) - if ($util.Long) - (message.maxPeerBlockHeight = $util.Long.fromValue(object.maxPeerBlockHeight)).unsigned = true; - else if (typeof object.maxPeerBlockHeight === "string") - message.maxPeerBlockHeight = parseInt(object.maxPeerBlockHeight, 10); - else if (typeof object.maxPeerBlockHeight === "number") - message.maxPeerBlockHeight = object.maxPeerBlockHeight; - else if (typeof object.maxPeerBlockHeight === "object") - message.maxPeerBlockHeight = new $util.LongBits(object.maxPeerBlockHeight.low >>> 0, object.maxPeerBlockHeight.high >>> 0).toNumber(true); - if (object.coreChainLockedHeight != null) - message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; - return message; - }; - - /** - * Creates a plain object from a Chain message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} message Chain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.catchingUp = false; - if (options.bytes === String) - object.latestBlockHash = ""; - else { - object.latestBlockHash = []; - if (options.bytes !== Array) - object.latestBlockHash = $util.newBuffer(object.latestBlockHash); - } - if (options.bytes === String) - object.latestAppHash = ""; - else { - object.latestAppHash = []; - if (options.bytes !== Array) - object.latestAppHash = $util.newBuffer(object.latestAppHash); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.latestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.latestBlockHeight = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.earliestBlockHash = ""; - else { - object.earliestBlockHash = []; - if (options.bytes !== Array) - object.earliestBlockHash = $util.newBuffer(object.earliestBlockHash); - } - if (options.bytes === String) - object.earliestAppHash = ""; - else { - object.earliestAppHash = []; - if (options.bytes !== Array) - object.earliestAppHash = $util.newBuffer(object.earliestAppHash); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.earliestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.earliestBlockHeight = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.maxPeerBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxPeerBlockHeight = options.longs === String ? "0" : 0; - object.coreChainLockedHeight = 0; - } - if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) - object.catchingUp = message.catchingUp; - if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) - object.latestBlockHash = options.bytes === String ? $util.base64.encode(message.latestBlockHash, 0, message.latestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestBlockHash) : message.latestBlockHash; - if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) - object.latestAppHash = options.bytes === String ? $util.base64.encode(message.latestAppHash, 0, message.latestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestAppHash) : message.latestAppHash; - if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) - if (typeof message.latestBlockHeight === "number") - object.latestBlockHeight = options.longs === String ? String(message.latestBlockHeight) : message.latestBlockHeight; - else - object.latestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.latestBlockHeight) : options.longs === Number ? new $util.LongBits(message.latestBlockHeight.low >>> 0, message.latestBlockHeight.high >>> 0).toNumber(true) : message.latestBlockHeight; - if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) - object.earliestBlockHash = options.bytes === String ? $util.base64.encode(message.earliestBlockHash, 0, message.earliestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestBlockHash) : message.earliestBlockHash; - if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) - object.earliestAppHash = options.bytes === String ? $util.base64.encode(message.earliestAppHash, 0, message.earliestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestAppHash) : message.earliestAppHash; - if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) - if (typeof message.earliestBlockHeight === "number") - object.earliestBlockHeight = options.longs === String ? String(message.earliestBlockHeight) : message.earliestBlockHeight; - else - object.earliestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.earliestBlockHeight) : options.longs === Number ? new $util.LongBits(message.earliestBlockHeight.low >>> 0, message.earliestBlockHeight.high >>> 0).toNumber(true) : message.earliestBlockHeight; - if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) - if (typeof message.maxPeerBlockHeight === "number") - object.maxPeerBlockHeight = options.longs === String ? String(message.maxPeerBlockHeight) : message.maxPeerBlockHeight; - else - object.maxPeerBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.maxPeerBlockHeight) : options.longs === Number ? new $util.LongBits(message.maxPeerBlockHeight.low >>> 0, message.maxPeerBlockHeight.high >>> 0).toNumber(true) : message.maxPeerBlockHeight; - if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) - object.coreChainLockedHeight = message.coreChainLockedHeight; - return object; - }; - - /** - * Converts this Chain to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - * @returns {Object.} JSON object - */ - Chain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Chain; - })(); - - GetStatusResponseV0.Network = (function() { - - /** - * Properties of a Network. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface INetwork - * @property {string|null} [chainId] Network chainId - * @property {number|null} [peersCount] Network peersCount - * @property {boolean|null} [listening] Network listening - */ - - /** - * Constructs a new Network. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Network. - * @implements INetwork - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set - */ - function Network(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Network chainId. - * @member {string} chainId - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @instance - */ - Network.prototype.chainId = ""; - - /** - * Network peersCount. - * @member {number} peersCount - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @instance - */ - Network.prototype.peersCount = 0; - - /** - * Network listening. - * @member {boolean} listening - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @instance - */ - Network.prototype.listening = false; - - /** - * Creates a new Network instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network instance - */ - Network.create = function create(properties) { - return new Network(properties); - }; - - /** - * Encodes the specified Network message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Network.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chainId); - if (message.peersCount != null && Object.hasOwnProperty.call(message, "peersCount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.peersCount); - if (message.listening != null && Object.hasOwnProperty.call(message, "listening")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.listening); - return writer; - }; - - /** - * Encodes the specified Network message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Network.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Network message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Network.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.chainId = reader.string(); - break; - case 2: - message.peersCount = reader.uint32(); - break; - case 3: - message.listening = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Network message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Network.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Network message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Network.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chainId != null && message.hasOwnProperty("chainId")) - if (!$util.isString(message.chainId)) - return "chainId: string expected"; - if (message.peersCount != null && message.hasOwnProperty("peersCount")) - if (!$util.isInteger(message.peersCount)) - return "peersCount: integer expected"; - if (message.listening != null && message.hasOwnProperty("listening")) - if (typeof message.listening !== "boolean") - return "listening: boolean expected"; - return null; - }; - - /** - * Creates a Network message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network - */ - Network.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); - if (object.chainId != null) - message.chainId = String(object.chainId); - if (object.peersCount != null) - message.peersCount = object.peersCount >>> 0; - if (object.listening != null) - message.listening = Boolean(object.listening); - return message; - }; - - /** - * Creates a plain object from a Network message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} message Network - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Network.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chainId = ""; - object.peersCount = 0; - object.listening = false; - } - if (message.chainId != null && message.hasOwnProperty("chainId")) - object.chainId = message.chainId; - if (message.peersCount != null && message.hasOwnProperty("peersCount")) - object.peersCount = message.peersCount; - if (message.listening != null && message.hasOwnProperty("listening")) - object.listening = message.listening; - return object; - }; - - /** - * Converts this Network to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @instance - * @returns {Object.} JSON object - */ - Network.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Network; - })(); - - GetStatusResponseV0.StateSync = (function() { - - /** - * Properties of a StateSync. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface IStateSync - * @property {number|Long|null} [totalSyncedTime] StateSync totalSyncedTime - * @property {number|Long|null} [remainingTime] StateSync remainingTime - * @property {number|null} [totalSnapshots] StateSync totalSnapshots - * @property {number|Long|null} [chunkProcessAvgTime] StateSync chunkProcessAvgTime - * @property {number|Long|null} [snapshotHeight] StateSync snapshotHeight - * @property {number|Long|null} [snapshotChunksCount] StateSync snapshotChunksCount - * @property {number|Long|null} [backfilledBlocks] StateSync backfilledBlocks - * @property {number|Long|null} [backfillBlocksTotal] StateSync backfillBlocksTotal - */ - - /** - * Constructs a new StateSync. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a StateSync. - * @implements IStateSync - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set - */ - function StateSync(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StateSync totalSyncedTime. - * @member {number|Long} totalSyncedTime - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.totalSyncedTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync remainingTime. - * @member {number|Long} remainingTime - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.remainingTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync totalSnapshots. - * @member {number} totalSnapshots - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.totalSnapshots = 0; - - /** - * StateSync chunkProcessAvgTime. - * @member {number|Long} chunkProcessAvgTime - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.chunkProcessAvgTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync snapshotHeight. - * @member {number|Long} snapshotHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.snapshotHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync snapshotChunksCount. - * @member {number|Long} snapshotChunksCount - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.snapshotChunksCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync backfilledBlocks. - * @member {number|Long} backfilledBlocks - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.backfilledBlocks = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync backfillBlocksTotal. - * @member {number|Long} backfillBlocksTotal - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.backfillBlocksTotal = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new StateSync instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync instance - */ - StateSync.create = function create(properties) { - return new StateSync(properties); - }; - - /** - * Encodes the specified StateSync message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateSync.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.totalSyncedTime != null && Object.hasOwnProperty.call(message, "totalSyncedTime")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.totalSyncedTime); - if (message.remainingTime != null && Object.hasOwnProperty.call(message, "remainingTime")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.remainingTime); - if (message.totalSnapshots != null && Object.hasOwnProperty.call(message, "totalSnapshots")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.totalSnapshots); - if (message.chunkProcessAvgTime != null && Object.hasOwnProperty.call(message, "chunkProcessAvgTime")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.chunkProcessAvgTime); - if (message.snapshotHeight != null && Object.hasOwnProperty.call(message, "snapshotHeight")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.snapshotHeight); - if (message.snapshotChunksCount != null && Object.hasOwnProperty.call(message, "snapshotChunksCount")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.snapshotChunksCount); - if (message.backfilledBlocks != null && Object.hasOwnProperty.call(message, "backfilledBlocks")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.backfilledBlocks); - if (message.backfillBlocksTotal != null && Object.hasOwnProperty.call(message, "backfillBlocksTotal")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.backfillBlocksTotal); - return writer; - }; - - /** - * Encodes the specified StateSync message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateSync.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StateSync message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateSync.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.totalSyncedTime = reader.uint64(); - break; - case 2: - message.remainingTime = reader.uint64(); - break; - case 3: - message.totalSnapshots = reader.uint32(); - break; - case 4: - message.chunkProcessAvgTime = reader.uint64(); - break; - case 5: - message.snapshotHeight = reader.uint64(); - break; - case 6: - message.snapshotChunksCount = reader.uint64(); - break; - case 7: - message.backfilledBlocks = reader.uint64(); - break; - case 8: - message.backfillBlocksTotal = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StateSync message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateSync.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StateSync message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StateSync.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) - if (!$util.isInteger(message.totalSyncedTime) && !(message.totalSyncedTime && $util.isInteger(message.totalSyncedTime.low) && $util.isInteger(message.totalSyncedTime.high))) - return "totalSyncedTime: integer|Long expected"; - if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) - if (!$util.isInteger(message.remainingTime) && !(message.remainingTime && $util.isInteger(message.remainingTime.low) && $util.isInteger(message.remainingTime.high))) - return "remainingTime: integer|Long expected"; - if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) - if (!$util.isInteger(message.totalSnapshots)) - return "totalSnapshots: integer expected"; - if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) - if (!$util.isInteger(message.chunkProcessAvgTime) && !(message.chunkProcessAvgTime && $util.isInteger(message.chunkProcessAvgTime.low) && $util.isInteger(message.chunkProcessAvgTime.high))) - return "chunkProcessAvgTime: integer|Long expected"; - if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) - if (!$util.isInteger(message.snapshotHeight) && !(message.snapshotHeight && $util.isInteger(message.snapshotHeight.low) && $util.isInteger(message.snapshotHeight.high))) - return "snapshotHeight: integer|Long expected"; - if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) - if (!$util.isInteger(message.snapshotChunksCount) && !(message.snapshotChunksCount && $util.isInteger(message.snapshotChunksCount.low) && $util.isInteger(message.snapshotChunksCount.high))) - return "snapshotChunksCount: integer|Long expected"; - if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) - if (!$util.isInteger(message.backfilledBlocks) && !(message.backfilledBlocks && $util.isInteger(message.backfilledBlocks.low) && $util.isInteger(message.backfilledBlocks.high))) - return "backfilledBlocks: integer|Long expected"; - if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) - if (!$util.isInteger(message.backfillBlocksTotal) && !(message.backfillBlocksTotal && $util.isInteger(message.backfillBlocksTotal.low) && $util.isInteger(message.backfillBlocksTotal.high))) - return "backfillBlocksTotal: integer|Long expected"; - return null; - }; - - /** - * Creates a StateSync message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync - */ - StateSync.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); - if (object.totalSyncedTime != null) - if ($util.Long) - (message.totalSyncedTime = $util.Long.fromValue(object.totalSyncedTime)).unsigned = true; - else if (typeof object.totalSyncedTime === "string") - message.totalSyncedTime = parseInt(object.totalSyncedTime, 10); - else if (typeof object.totalSyncedTime === "number") - message.totalSyncedTime = object.totalSyncedTime; - else if (typeof object.totalSyncedTime === "object") - message.totalSyncedTime = new $util.LongBits(object.totalSyncedTime.low >>> 0, object.totalSyncedTime.high >>> 0).toNumber(true); - if (object.remainingTime != null) - if ($util.Long) - (message.remainingTime = $util.Long.fromValue(object.remainingTime)).unsigned = true; - else if (typeof object.remainingTime === "string") - message.remainingTime = parseInt(object.remainingTime, 10); - else if (typeof object.remainingTime === "number") - message.remainingTime = object.remainingTime; - else if (typeof object.remainingTime === "object") - message.remainingTime = new $util.LongBits(object.remainingTime.low >>> 0, object.remainingTime.high >>> 0).toNumber(true); - if (object.totalSnapshots != null) - message.totalSnapshots = object.totalSnapshots >>> 0; - if (object.chunkProcessAvgTime != null) - if ($util.Long) - (message.chunkProcessAvgTime = $util.Long.fromValue(object.chunkProcessAvgTime)).unsigned = true; - else if (typeof object.chunkProcessAvgTime === "string") - message.chunkProcessAvgTime = parseInt(object.chunkProcessAvgTime, 10); - else if (typeof object.chunkProcessAvgTime === "number") - message.chunkProcessAvgTime = object.chunkProcessAvgTime; - else if (typeof object.chunkProcessAvgTime === "object") - message.chunkProcessAvgTime = new $util.LongBits(object.chunkProcessAvgTime.low >>> 0, object.chunkProcessAvgTime.high >>> 0).toNumber(true); - if (object.snapshotHeight != null) - if ($util.Long) - (message.snapshotHeight = $util.Long.fromValue(object.snapshotHeight)).unsigned = true; - else if (typeof object.snapshotHeight === "string") - message.snapshotHeight = parseInt(object.snapshotHeight, 10); - else if (typeof object.snapshotHeight === "number") - message.snapshotHeight = object.snapshotHeight; - else if (typeof object.snapshotHeight === "object") - message.snapshotHeight = new $util.LongBits(object.snapshotHeight.low >>> 0, object.snapshotHeight.high >>> 0).toNumber(true); - if (object.snapshotChunksCount != null) - if ($util.Long) - (message.snapshotChunksCount = $util.Long.fromValue(object.snapshotChunksCount)).unsigned = true; - else if (typeof object.snapshotChunksCount === "string") - message.snapshotChunksCount = parseInt(object.snapshotChunksCount, 10); - else if (typeof object.snapshotChunksCount === "number") - message.snapshotChunksCount = object.snapshotChunksCount; - else if (typeof object.snapshotChunksCount === "object") - message.snapshotChunksCount = new $util.LongBits(object.snapshotChunksCount.low >>> 0, object.snapshotChunksCount.high >>> 0).toNumber(true); - if (object.backfilledBlocks != null) - if ($util.Long) - (message.backfilledBlocks = $util.Long.fromValue(object.backfilledBlocks)).unsigned = true; - else if (typeof object.backfilledBlocks === "string") - message.backfilledBlocks = parseInt(object.backfilledBlocks, 10); - else if (typeof object.backfilledBlocks === "number") - message.backfilledBlocks = object.backfilledBlocks; - else if (typeof object.backfilledBlocks === "object") - message.backfilledBlocks = new $util.LongBits(object.backfilledBlocks.low >>> 0, object.backfilledBlocks.high >>> 0).toNumber(true); - if (object.backfillBlocksTotal != null) - if ($util.Long) - (message.backfillBlocksTotal = $util.Long.fromValue(object.backfillBlocksTotal)).unsigned = true; - else if (typeof object.backfillBlocksTotal === "string") - message.backfillBlocksTotal = parseInt(object.backfillBlocksTotal, 10); - else if (typeof object.backfillBlocksTotal === "number") - message.backfillBlocksTotal = object.backfillBlocksTotal; - else if (typeof object.backfillBlocksTotal === "object") - message.backfillBlocksTotal = new $util.LongBits(object.backfillBlocksTotal.low >>> 0, object.backfillBlocksTotal.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a StateSync message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} message StateSync - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StateSync.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.totalSyncedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalSyncedTime = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.remainingTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.remainingTime = options.longs === String ? "0" : 0; - object.totalSnapshots = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.chunkProcessAvgTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.chunkProcessAvgTime = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.snapshotHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.snapshotHeight = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.snapshotChunksCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.snapshotChunksCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.backfilledBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backfilledBlocks = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.backfillBlocksTotal = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backfillBlocksTotal = options.longs === String ? "0" : 0; - } - if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) - if (typeof message.totalSyncedTime === "number") - object.totalSyncedTime = options.longs === String ? String(message.totalSyncedTime) : message.totalSyncedTime; - else - object.totalSyncedTime = options.longs === String ? $util.Long.prototype.toString.call(message.totalSyncedTime) : options.longs === Number ? new $util.LongBits(message.totalSyncedTime.low >>> 0, message.totalSyncedTime.high >>> 0).toNumber(true) : message.totalSyncedTime; - if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) - if (typeof message.remainingTime === "number") - object.remainingTime = options.longs === String ? String(message.remainingTime) : message.remainingTime; - else - object.remainingTime = options.longs === String ? $util.Long.prototype.toString.call(message.remainingTime) : options.longs === Number ? new $util.LongBits(message.remainingTime.low >>> 0, message.remainingTime.high >>> 0).toNumber(true) : message.remainingTime; - if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) - object.totalSnapshots = message.totalSnapshots; - if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) - if (typeof message.chunkProcessAvgTime === "number") - object.chunkProcessAvgTime = options.longs === String ? String(message.chunkProcessAvgTime) : message.chunkProcessAvgTime; - else - object.chunkProcessAvgTime = options.longs === String ? $util.Long.prototype.toString.call(message.chunkProcessAvgTime) : options.longs === Number ? new $util.LongBits(message.chunkProcessAvgTime.low >>> 0, message.chunkProcessAvgTime.high >>> 0).toNumber(true) : message.chunkProcessAvgTime; - if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) - if (typeof message.snapshotHeight === "number") - object.snapshotHeight = options.longs === String ? String(message.snapshotHeight) : message.snapshotHeight; - else - object.snapshotHeight = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotHeight) : options.longs === Number ? new $util.LongBits(message.snapshotHeight.low >>> 0, message.snapshotHeight.high >>> 0).toNumber(true) : message.snapshotHeight; - if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) - if (typeof message.snapshotChunksCount === "number") - object.snapshotChunksCount = options.longs === String ? String(message.snapshotChunksCount) : message.snapshotChunksCount; - else - object.snapshotChunksCount = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotChunksCount) : options.longs === Number ? new $util.LongBits(message.snapshotChunksCount.low >>> 0, message.snapshotChunksCount.high >>> 0).toNumber(true) : message.snapshotChunksCount; - if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) - if (typeof message.backfilledBlocks === "number") - object.backfilledBlocks = options.longs === String ? String(message.backfilledBlocks) : message.backfilledBlocks; - else - object.backfilledBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.backfilledBlocks) : options.longs === Number ? new $util.LongBits(message.backfilledBlocks.low >>> 0, message.backfilledBlocks.high >>> 0).toNumber(true) : message.backfilledBlocks; - if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) - if (typeof message.backfillBlocksTotal === "number") - object.backfillBlocksTotal = options.longs === String ? String(message.backfillBlocksTotal) : message.backfillBlocksTotal; - else - object.backfillBlocksTotal = options.longs === String ? $util.Long.prototype.toString.call(message.backfillBlocksTotal) : options.longs === Number ? new $util.LongBits(message.backfillBlocksTotal.low >>> 0, message.backfillBlocksTotal.high >>> 0).toNumber(true) : message.backfillBlocksTotal; - return object; - }; - - /** - * Converts this StateSync to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - * @returns {Object.} JSON object - */ - StateSync.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StateSync; - })(); - - return GetStatusResponseV0; - })(); - - return GetStatusResponse; - })(); - - v0.GetCurrentQuorumsInfoRequest = (function() { - - /** - * Properties of a GetCurrentQuorumsInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetCurrentQuorumsInfoRequest - * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null} [v0] GetCurrentQuorumsInfoRequest v0 - */ - - /** - * Constructs a new GetCurrentQuorumsInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetCurrentQuorumsInfoRequest. - * @implements IGetCurrentQuorumsInfoRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set - */ - function GetCurrentQuorumsInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCurrentQuorumsInfoRequest v0. - * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @instance - */ - GetCurrentQuorumsInfoRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetCurrentQuorumsInfoRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @instance - */ - Object.defineProperty(GetCurrentQuorumsInfoRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetCurrentQuorumsInfoRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest instance - */ - GetCurrentQuorumsInfoRequest.create = function create(properties) { - return new GetCurrentQuorumsInfoRequest(properties); - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCurrentQuorumsInfoRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCurrentQuorumsInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetCurrentQuorumsInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest - */ - GetCurrentQuorumsInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetCurrentQuorumsInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCurrentQuorumsInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetCurrentQuorumsInfoRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetCurrentQuorumsInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 = (function() { - - /** - * Properties of a GetCurrentQuorumsInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @interface IGetCurrentQuorumsInfoRequestV0 - */ - - /** - * Constructs a new GetCurrentQuorumsInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @classdesc Represents a GetCurrentQuorumsInfoRequestV0. - * @implements IGetCurrentQuorumsInfoRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set - */ - function GetCurrentQuorumsInfoRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new GetCurrentQuorumsInfoRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 instance - */ - GetCurrentQuorumsInfoRequestV0.create = function create(properties) { - return new GetCurrentQuorumsInfoRequestV0(properties); - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCurrentQuorumsInfoRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCurrentQuorumsInfoRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GetCurrentQuorumsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 - */ - GetCurrentQuorumsInfoRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0) - return object; - return new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); - }; - - /** - * Creates a plain object from a GetCurrentQuorumsInfoRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCurrentQuorumsInfoRequestV0.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GetCurrentQuorumsInfoRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetCurrentQuorumsInfoRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetCurrentQuorumsInfoRequestV0; - })(); - - return GetCurrentQuorumsInfoRequest; - })(); - - v0.GetCurrentQuorumsInfoResponse = (function() { - - /** - * Properties of a GetCurrentQuorumsInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetCurrentQuorumsInfoResponse - * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null} [v0] GetCurrentQuorumsInfoResponse v0 - */ - - /** - * Constructs a new GetCurrentQuorumsInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetCurrentQuorumsInfoResponse. - * @implements IGetCurrentQuorumsInfoResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set - */ - function GetCurrentQuorumsInfoResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCurrentQuorumsInfoResponse v0. - * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @instance - */ - GetCurrentQuorumsInfoResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetCurrentQuorumsInfoResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @instance - */ - Object.defineProperty(GetCurrentQuorumsInfoResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetCurrentQuorumsInfoResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse instance - */ - GetCurrentQuorumsInfoResponse.create = function create(properties) { - return new GetCurrentQuorumsInfoResponse(properties); - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCurrentQuorumsInfoResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCurrentQuorumsInfoResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetCurrentQuorumsInfoResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse - */ - GetCurrentQuorumsInfoResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetCurrentQuorumsInfoResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCurrentQuorumsInfoResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetCurrentQuorumsInfoResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @instance - * @returns {Object.} JSON object - */ - GetCurrentQuorumsInfoResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetCurrentQuorumsInfoResponse.ValidatorV0 = (function() { - - /** - * Properties of a ValidatorV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @interface IValidatorV0 - * @property {Uint8Array|null} [proTxHash] ValidatorV0 proTxHash - * @property {string|null} [nodeIp] ValidatorV0 nodeIp - * @property {boolean|null} [isBanned] ValidatorV0 isBanned - */ - - /** - * Constructs a new ValidatorV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @classdesc Represents a ValidatorV0. - * @implements IValidatorV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set - */ - function ValidatorV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorV0 proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @instance - */ - ValidatorV0.prototype.proTxHash = $util.newBuffer([]); - - /** - * ValidatorV0 nodeIp. - * @member {string} nodeIp - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @instance - */ - ValidatorV0.prototype.nodeIp = ""; - - /** - * ValidatorV0 isBanned. - * @member {boolean} isBanned - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @instance - */ - ValidatorV0.prototype.isBanned = false; - - /** - * Creates a new ValidatorV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 instance - */ - ValidatorV0.create = function create(properties) { - return new ValidatorV0(properties); - }; - - /** - * Encodes the specified ValidatorV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); - if (message.nodeIp != null && Object.hasOwnProperty.call(message, "nodeIp")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIp); - if (message.isBanned != null && Object.hasOwnProperty.call(message, "isBanned")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isBanned); - return writer; - }; - - /** - * Encodes the specified ValidatorV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proTxHash = reader.bytes(); - break; - case 2: - message.nodeIp = reader.string(); - break; - case 3: - message.isBanned = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) - if (!$util.isString(message.nodeIp)) - return "nodeIp: string expected"; - if (message.isBanned != null && message.hasOwnProperty("isBanned")) - if (typeof message.isBanned !== "boolean") - return "isBanned: boolean expected"; - return null; - }; - - /** - * Creates a ValidatorV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 - */ - ValidatorV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - if (object.nodeIp != null) - message.nodeIp = String(object.nodeIp); - if (object.isBanned != null) - message.isBanned = Boolean(object.isBanned); - return message; - }; - - /** - * Creates a plain object from a ValidatorV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} message ValidatorV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - object.nodeIp = ""; - object.isBanned = false; - } - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) - object.nodeIp = message.nodeIp; - if (message.isBanned != null && message.hasOwnProperty("isBanned")) - object.isBanned = message.isBanned; - return object; - }; - - /** - * Converts this ValidatorV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @instance - * @returns {Object.} JSON object - */ - ValidatorV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorV0; - })(); - - GetCurrentQuorumsInfoResponse.ValidatorSetV0 = (function() { - - /** - * Properties of a ValidatorSetV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @interface IValidatorSetV0 - * @property {Uint8Array|null} [quorumHash] ValidatorSetV0 quorumHash - * @property {number|null} [coreHeight] ValidatorSetV0 coreHeight - * @property {Array.|null} [members] ValidatorSetV0 members - * @property {Uint8Array|null} [thresholdPublicKey] ValidatorSetV0 thresholdPublicKey - */ - - /** - * Constructs a new ValidatorSetV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @classdesc Represents a ValidatorSetV0. - * @implements IValidatorSetV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set - */ - function ValidatorSetV0(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorSetV0 quorumHash. - * @member {Uint8Array} quorumHash - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - */ - ValidatorSetV0.prototype.quorumHash = $util.newBuffer([]); - - /** - * ValidatorSetV0 coreHeight. - * @member {number} coreHeight - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - */ - ValidatorSetV0.prototype.coreHeight = 0; - - /** - * ValidatorSetV0 members. - * @member {Array.} members - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - */ - ValidatorSetV0.prototype.members = $util.emptyArray; - - /** - * ValidatorSetV0 thresholdPublicKey. - * @member {Uint8Array} thresholdPublicKey - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - */ - ValidatorSetV0.prototype.thresholdPublicKey = $util.newBuffer([]); - - /** - * Creates a new ValidatorSetV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 instance - */ - ValidatorSetV0.create = function create(properties) { - return new ValidatorSetV0(properties); - }; - - /** - * Encodes the specified ValidatorSetV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSetV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHash); - if (message.coreHeight != null && Object.hasOwnProperty.call(message, "coreHeight")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreHeight); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.encode(message.members[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.thresholdPublicKey != null && Object.hasOwnProperty.call(message, "thresholdPublicKey")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.thresholdPublicKey); - return writer; - }; - - /** - * Encodes the specified ValidatorSetV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSetV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorSetV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSetV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quorumHash = reader.bytes(); - break; - case 2: - message.coreHeight = reader.uint32(); - break; - case 3: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.decode(reader, reader.uint32())); - break; - case 4: - message.thresholdPublicKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorSetV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSetV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorSetV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorSetV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) - if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) - return "quorumHash: buffer expected"; - if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) - if (!$util.isInteger(message.coreHeight)) - return "coreHeight: integer expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify(message.members[i]); - if (error) - return "members." + error; - } - } - if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) - if (!(message.thresholdPublicKey && typeof message.thresholdPublicKey.length === "number" || $util.isString(message.thresholdPublicKey))) - return "thresholdPublicKey: buffer expected"; - return null; - }; - - /** - * Creates a ValidatorSetV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 - */ - ValidatorSetV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); - if (object.quorumHash != null) - if (typeof object.quorumHash === "string") - $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); - else if (object.quorumHash.length >= 0) - message.quorumHash = object.quorumHash; - if (object.coreHeight != null) - message.coreHeight = object.coreHeight >>> 0; - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) { - if (typeof object.members[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: object expected"); - message.members[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.fromObject(object.members[i]); - } - } - if (object.thresholdPublicKey != null) - if (typeof object.thresholdPublicKey === "string") - $util.base64.decode(object.thresholdPublicKey, message.thresholdPublicKey = $util.newBuffer($util.base64.length(object.thresholdPublicKey)), 0); - else if (object.thresholdPublicKey.length >= 0) - message.thresholdPublicKey = object.thresholdPublicKey; - return message; - }; - - /** - * Creates a plain object from a ValidatorSetV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} message ValidatorSetV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorSetV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - if (options.bytes === String) - object.quorumHash = ""; - else { - object.quorumHash = []; - if (options.bytes !== Array) - object.quorumHash = $util.newBuffer(object.quorumHash); - } - object.coreHeight = 0; - if (options.bytes === String) - object.thresholdPublicKey = ""; - else { - object.thresholdPublicKey = []; - if (options.bytes !== Array) - object.thresholdPublicKey = $util.newBuffer(object.thresholdPublicKey); - } - } - if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) - object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; - if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) - object.coreHeight = message.coreHeight; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject(message.members[j], options); - } - if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) - object.thresholdPublicKey = options.bytes === String ? $util.base64.encode(message.thresholdPublicKey, 0, message.thresholdPublicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.thresholdPublicKey) : message.thresholdPublicKey; - return object; - }; - - /** - * Converts this ValidatorSetV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - * @returns {Object.} JSON object - */ - ValidatorSetV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorSetV0; - })(); - - GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 = (function() { - - /** - * Properties of a GetCurrentQuorumsInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @interface IGetCurrentQuorumsInfoResponseV0 - * @property {Array.|null} [quorumHashes] GetCurrentQuorumsInfoResponseV0 quorumHashes - * @property {Uint8Array|null} [currentQuorumHash] GetCurrentQuorumsInfoResponseV0 currentQuorumHash - * @property {Array.|null} [validatorSets] GetCurrentQuorumsInfoResponseV0 validatorSets - * @property {Uint8Array|null} [lastBlockProposer] GetCurrentQuorumsInfoResponseV0 lastBlockProposer - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetCurrentQuorumsInfoResponseV0 metadata - */ - - /** - * Constructs a new GetCurrentQuorumsInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @classdesc Represents a GetCurrentQuorumsInfoResponseV0. - * @implements IGetCurrentQuorumsInfoResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set - */ - function GetCurrentQuorumsInfoResponseV0(properties) { - this.quorumHashes = []; - this.validatorSets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCurrentQuorumsInfoResponseV0 quorumHashes. - * @member {Array.} quorumHashes - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.quorumHashes = $util.emptyArray; - - /** - * GetCurrentQuorumsInfoResponseV0 currentQuorumHash. - * @member {Uint8Array} currentQuorumHash - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.currentQuorumHash = $util.newBuffer([]); - - /** - * GetCurrentQuorumsInfoResponseV0 validatorSets. - * @member {Array.} validatorSets - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.validatorSets = $util.emptyArray; - - /** - * GetCurrentQuorumsInfoResponseV0 lastBlockProposer. - * @member {Uint8Array} lastBlockProposer - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.lastBlockProposer = $util.newBuffer([]); - - /** - * GetCurrentQuorumsInfoResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.metadata = null; - - /** - * Creates a new GetCurrentQuorumsInfoResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 instance - */ - GetCurrentQuorumsInfoResponseV0.create = function create(properties) { - return new GetCurrentQuorumsInfoResponseV0(properties); - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorumHashes != null && message.quorumHashes.length) - for (var i = 0; i < message.quorumHashes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHashes[i]); - if (message.currentQuorumHash != null && Object.hasOwnProperty.call(message, "currentQuorumHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.currentQuorumHash); - if (message.validatorSets != null && message.validatorSets.length) - for (var i = 0; i < message.validatorSets.length; ++i) - $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.encode(message.validatorSets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.lastBlockProposer != null && Object.hasOwnProperty.call(message, "lastBlockProposer")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.lastBlockProposer); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.quorumHashes && message.quorumHashes.length)) - message.quorumHashes = []; - message.quorumHashes.push(reader.bytes()); - break; - case 2: - message.currentQuorumHash = reader.bytes(); - break; - case 3: - if (!(message.validatorSets && message.validatorSets.length)) - message.validatorSets = []; - message.validatorSets.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.decode(reader, reader.uint32())); - break; - case 4: - message.lastBlockProposer = reader.bytes(); - break; - case 5: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCurrentQuorumsInfoResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCurrentQuorumsInfoResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorumHashes != null && message.hasOwnProperty("quorumHashes")) { - if (!Array.isArray(message.quorumHashes)) - return "quorumHashes: array expected"; - for (var i = 0; i < message.quorumHashes.length; ++i) - if (!(message.quorumHashes[i] && typeof message.quorumHashes[i].length === "number" || $util.isString(message.quorumHashes[i]))) - return "quorumHashes: buffer[] expected"; - } - if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) - if (!(message.currentQuorumHash && typeof message.currentQuorumHash.length === "number" || $util.isString(message.currentQuorumHash))) - return "currentQuorumHash: buffer expected"; - if (message.validatorSets != null && message.hasOwnProperty("validatorSets")) { - if (!Array.isArray(message.validatorSets)) - return "validatorSets: array expected"; - for (var i = 0; i < message.validatorSets.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify(message.validatorSets[i]); - if (error) - return "validatorSets." + error; - } - } - if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) - if (!(message.lastBlockProposer && typeof message.lastBlockProposer.length === "number" || $util.isString(message.lastBlockProposer))) - return "lastBlockProposer: buffer expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetCurrentQuorumsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 - */ - GetCurrentQuorumsInfoResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); - if (object.quorumHashes) { - if (!Array.isArray(object.quorumHashes)) - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.quorumHashes: array expected"); - message.quorumHashes = []; - for (var i = 0; i < object.quorumHashes.length; ++i) - if (typeof object.quorumHashes[i] === "string") - $util.base64.decode(object.quorumHashes[i], message.quorumHashes[i] = $util.newBuffer($util.base64.length(object.quorumHashes[i])), 0); - else if (object.quorumHashes[i].length >= 0) - message.quorumHashes[i] = object.quorumHashes[i]; - } - if (object.currentQuorumHash != null) - if (typeof object.currentQuorumHash === "string") - $util.base64.decode(object.currentQuorumHash, message.currentQuorumHash = $util.newBuffer($util.base64.length(object.currentQuorumHash)), 0); - else if (object.currentQuorumHash.length >= 0) - message.currentQuorumHash = object.currentQuorumHash; - if (object.validatorSets) { - if (!Array.isArray(object.validatorSets)) - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: array expected"); - message.validatorSets = []; - for (var i = 0; i < object.validatorSets.length; ++i) { - if (typeof object.validatorSets[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: object expected"); - message.validatorSets[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.fromObject(object.validatorSets[i]); - } - } - if (object.lastBlockProposer != null) - if (typeof object.lastBlockProposer === "string") - $util.base64.decode(object.lastBlockProposer, message.lastBlockProposer = $util.newBuffer($util.base64.length(object.lastBlockProposer)), 0); - else if (object.lastBlockProposer.length >= 0) - message.lastBlockProposer = object.lastBlockProposer; - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetCurrentQuorumsInfoResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCurrentQuorumsInfoResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.quorumHashes = []; - object.validatorSets = []; - } - if (options.defaults) { - if (options.bytes === String) - object.currentQuorumHash = ""; - else { - object.currentQuorumHash = []; - if (options.bytes !== Array) - object.currentQuorumHash = $util.newBuffer(object.currentQuorumHash); - } - if (options.bytes === String) - object.lastBlockProposer = ""; - else { - object.lastBlockProposer = []; - if (options.bytes !== Array) - object.lastBlockProposer = $util.newBuffer(object.lastBlockProposer); - } - object.metadata = null; - } - if (message.quorumHashes && message.quorumHashes.length) { - object.quorumHashes = []; - for (var j = 0; j < message.quorumHashes.length; ++j) - object.quorumHashes[j] = options.bytes === String ? $util.base64.encode(message.quorumHashes[j], 0, message.quorumHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHashes[j]) : message.quorumHashes[j]; - } - if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) - object.currentQuorumHash = options.bytes === String ? $util.base64.encode(message.currentQuorumHash, 0, message.currentQuorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.currentQuorumHash) : message.currentQuorumHash; - if (message.validatorSets && message.validatorSets.length) { - object.validatorSets = []; - for (var j = 0; j < message.validatorSets.length; ++j) - object.validatorSets[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject(message.validatorSets[j], options); - } - if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) - object.lastBlockProposer = options.bytes === String ? $util.base64.encode(message.lastBlockProposer, 0, message.lastBlockProposer.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockProposer) : message.lastBlockProposer; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetCurrentQuorumsInfoResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetCurrentQuorumsInfoResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetCurrentQuorumsInfoResponseV0; - })(); - - return GetCurrentQuorumsInfoResponse; - })(); - - v0.GetIdentityTokenBalancesRequest = (function() { - - /** - * Properties of a GetIdentityTokenBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityTokenBalancesRequest - * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null} [v0] GetIdentityTokenBalancesRequest v0 - */ - - /** - * Constructs a new GetIdentityTokenBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityTokenBalancesRequest. - * @implements IGetIdentityTokenBalancesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set - */ - function GetIdentityTokenBalancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenBalancesRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @instance - */ - GetIdentityTokenBalancesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenBalancesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @instance - */ - Object.defineProperty(GetIdentityTokenBalancesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenBalancesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest instance - */ - GetIdentityTokenBalancesRequest.create = function create(properties) { - return new GetIdentityTokenBalancesRequest(properties); - }; - - /** - * Encodes the specified GetIdentityTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenBalancesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenBalancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest - */ - GetIdentityTokenBalancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenBalancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenBalancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityTokenBalancesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenBalancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 = (function() { - - /** - * Properties of a GetIdentityTokenBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @interface IGetIdentityTokenBalancesRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityTokenBalancesRequestV0 identityId - * @property {Array.|null} [tokenIds] GetIdentityTokenBalancesRequestV0 tokenIds - * @property {boolean|null} [prove] GetIdentityTokenBalancesRequestV0 prove - */ - - /** - * Constructs a new GetIdentityTokenBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @classdesc Represents a GetIdentityTokenBalancesRequestV0. - * @implements IGetIdentityTokenBalancesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set - */ - function GetIdentityTokenBalancesRequestV0(properties) { - this.tokenIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenBalancesRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @instance - */ - GetIdentityTokenBalancesRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityTokenBalancesRequestV0 tokenIds. - * @member {Array.} tokenIds - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @instance - */ - GetIdentityTokenBalancesRequestV0.prototype.tokenIds = $util.emptyArray; - - /** - * GetIdentityTokenBalancesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @instance - */ - GetIdentityTokenBalancesRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityTokenBalancesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 instance - */ - GetIdentityTokenBalancesRequestV0.create = function create(properties) { - return new GetIdentityTokenBalancesRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.tokenIds != null && message.tokenIds.length) - for (var i = 0; i < message.tokenIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - if (!(message.tokenIds && message.tokenIds.length)) - message.tokenIds = []; - message.tokenIds.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenBalancesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenBalancesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { - if (!Array.isArray(message.tokenIds)) - return "tokenIds: array expected"; - for (var i = 0; i < message.tokenIds.length; ++i) - if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) - return "tokenIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 - */ - GetIdentityTokenBalancesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.tokenIds) { - if (!Array.isArray(object.tokenIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.tokenIds: array expected"); - message.tokenIds = []; - for (var i = 0; i < object.tokenIds.length; ++i) - if (typeof object.tokenIds[i] === "string") - $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); - else if (object.tokenIds[i].length >= 0) - message.tokenIds[i] = object.tokenIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenBalancesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenBalancesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenIds = []; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.tokenIds && message.tokenIds.length) { - object.tokenIds = []; - for (var j = 0; j < message.tokenIds.length; ++j) - object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityTokenBalancesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenBalancesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityTokenBalancesRequestV0; - })(); - - return GetIdentityTokenBalancesRequest; - })(); - - v0.GetIdentityTokenBalancesResponse = (function() { - - /** - * Properties of a GetIdentityTokenBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityTokenBalancesResponse - * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null} [v0] GetIdentityTokenBalancesResponse v0 - */ - - /** - * Constructs a new GetIdentityTokenBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityTokenBalancesResponse. - * @implements IGetIdentityTokenBalancesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set - */ - function GetIdentityTokenBalancesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenBalancesResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @instance - */ - GetIdentityTokenBalancesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenBalancesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @instance - */ - Object.defineProperty(GetIdentityTokenBalancesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenBalancesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse instance - */ - GetIdentityTokenBalancesResponse.create = function create(properties) { - return new GetIdentityTokenBalancesResponse(properties); - }; - - /** - * Encodes the specified GetIdentityTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenBalancesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenBalancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse - */ - GetIdentityTokenBalancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenBalancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenBalancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityTokenBalancesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenBalancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 = (function() { - - /** - * Properties of a GetIdentityTokenBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @interface IGetIdentityTokenBalancesResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null} [tokenBalances] GetIdentityTokenBalancesResponseV0 tokenBalances - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenBalancesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenBalancesResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityTokenBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @classdesc Represents a GetIdentityTokenBalancesResponseV0. - * @implements IGetIdentityTokenBalancesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set - */ - function GetIdentityTokenBalancesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenBalancesResponseV0 tokenBalances. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null|undefined} tokenBalances - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - */ - GetIdentityTokenBalancesResponseV0.prototype.tokenBalances = null; - - /** - * GetIdentityTokenBalancesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - */ - GetIdentityTokenBalancesResponseV0.prototype.proof = null; - - /** - * GetIdentityTokenBalancesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - */ - GetIdentityTokenBalancesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenBalancesResponseV0 result. - * @member {"tokenBalances"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityTokenBalancesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenBalances", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenBalancesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 instance - */ - GetIdentityTokenBalancesResponseV0.create = function create(properties) { - return new GetIdentityTokenBalancesResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenBalances != null && Object.hasOwnProperty.call(message, "tokenBalances")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.encode(message.tokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenBalancesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenBalancesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify(message.tokenBalances); - if (error) - return "tokenBalances." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 - */ - GetIdentityTokenBalancesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); - if (object.tokenBalances != null) { - if (typeof object.tokenBalances !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.tokenBalances: object expected"); - message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.fromObject(object.tokenBalances); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenBalancesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenBalancesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { - object.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.toObject(message.tokenBalances, options); - if (options.oneofs) - object.result = "tokenBalances"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityTokenBalancesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenBalancesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenBalancesResponseV0.TokenBalanceEntry = (function() { - - /** - * Properties of a TokenBalanceEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @interface ITokenBalanceEntry - * @property {Uint8Array|null} [tokenId] TokenBalanceEntry tokenId - * @property {number|Long|null} [balance] TokenBalanceEntry balance - */ - - /** - * Constructs a new TokenBalanceEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @classdesc Represents a TokenBalanceEntry. - * @implements ITokenBalanceEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set - */ - function TokenBalanceEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenBalanceEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @instance - */ - TokenBalanceEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenBalanceEntry balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @instance - */ - TokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new TokenBalanceEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry instance - */ - TokenBalanceEntry.create = function create(properties) { - return new TokenBalanceEntry(properties); - }; - - /** - * Encodes the specified TokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenBalanceEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); - return writer; - }; - - /** - * Encodes the specified TokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenBalanceEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenBalanceEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.balance = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenBalanceEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenBalanceEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenBalanceEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.balance != null && message.hasOwnProperty("balance")) - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - return null; - }; - - /** - * Creates a TokenBalanceEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry - */ - TokenBalanceEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TokenBalanceEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} message TokenBalanceEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenBalanceEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.balance = options.longs === String ? "0" : 0; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.balance != null && message.hasOwnProperty("balance")) - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - return object; - }; - - /** - * Converts this TokenBalanceEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @instance - * @returns {Object.} JSON object - */ - TokenBalanceEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenBalanceEntry; - })(); - - GetIdentityTokenBalancesResponseV0.TokenBalances = (function() { - - /** - * Properties of a TokenBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @interface ITokenBalances - * @property {Array.|null} [tokenBalances] TokenBalances tokenBalances - */ - - /** - * Constructs a new TokenBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @classdesc Represents a TokenBalances. - * @implements ITokenBalances - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set - */ - function TokenBalances(properties) { - this.tokenBalances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenBalances tokenBalances. - * @member {Array.} tokenBalances - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @instance - */ - TokenBalances.prototype.tokenBalances = $util.emptyArray; - - /** - * Creates a new TokenBalances instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances instance - */ - TokenBalances.create = function create(properties) { - return new TokenBalances(properties); - }; - - /** - * Encodes the specified TokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenBalances.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenBalances != null && message.tokenBalances.length) - for (var i = 0; i < message.tokenBalances.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.encode(message.tokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenBalances.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenBalances message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenBalances.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenBalances && message.tokenBalances.length)) - message.tokenBalances = []; - message.tokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenBalances message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenBalances.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenBalances message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenBalances.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { - if (!Array.isArray(message.tokenBalances)) - return "tokenBalances: array expected"; - for (var i = 0; i < message.tokenBalances.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify(message.tokenBalances[i]); - if (error) - return "tokenBalances." + error; - } - } - return null; - }; - - /** - * Creates a TokenBalances message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances - */ - TokenBalances.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); - if (object.tokenBalances) { - if (!Array.isArray(object.tokenBalances)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: array expected"); - message.tokenBalances = []; - for (var i = 0; i < object.tokenBalances.length; ++i) { - if (typeof object.tokenBalances[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: object expected"); - message.tokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.fromObject(object.tokenBalances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenBalances message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} message TokenBalances - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenBalances.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenBalances = []; - if (message.tokenBalances && message.tokenBalances.length) { - object.tokenBalances = []; - for (var j = 0; j < message.tokenBalances.length; ++j) - object.tokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.toObject(message.tokenBalances[j], options); - } - return object; - }; - - /** - * Converts this TokenBalances to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @instance - * @returns {Object.} JSON object - */ - TokenBalances.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenBalances; - })(); - - return GetIdentityTokenBalancesResponseV0; - })(); - - return GetIdentityTokenBalancesResponse; - })(); - - v0.GetIdentitiesTokenBalancesRequest = (function() { - - /** - * Properties of a GetIdentitiesTokenBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesTokenBalancesRequest - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null} [v0] GetIdentitiesTokenBalancesRequest v0 - */ - - /** - * Constructs a new GetIdentitiesTokenBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesTokenBalancesRequest. - * @implements IGetIdentitiesTokenBalancesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set - */ - function GetIdentitiesTokenBalancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenBalancesRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @instance - */ - GetIdentitiesTokenBalancesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenBalancesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @instance - */ - Object.defineProperty(GetIdentitiesTokenBalancesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenBalancesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest instance - */ - GetIdentitiesTokenBalancesRequest.create = function create(properties) { - return new GetIdentitiesTokenBalancesRequest(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenBalancesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenBalancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest - */ - GetIdentitiesTokenBalancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenBalancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenBalancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesTokenBalancesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenBalancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 = (function() { - - /** - * Properties of a GetIdentitiesTokenBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @interface IGetIdentitiesTokenBalancesRequestV0 - * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenBalancesRequestV0 tokenId - * @property {Array.|null} [identityIds] GetIdentitiesTokenBalancesRequestV0 identityIds - * @property {boolean|null} [prove] GetIdentitiesTokenBalancesRequestV0 prove - */ - - /** - * Constructs a new GetIdentitiesTokenBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @classdesc Represents a GetIdentitiesTokenBalancesRequestV0. - * @implements IGetIdentitiesTokenBalancesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set - */ - function GetIdentitiesTokenBalancesRequestV0(properties) { - this.identityIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenBalancesRequestV0 tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @instance - */ - GetIdentitiesTokenBalancesRequestV0.prototype.tokenId = $util.newBuffer([]); - - /** - * GetIdentitiesTokenBalancesRequestV0 identityIds. - * @member {Array.} identityIds - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @instance - */ - GetIdentitiesTokenBalancesRequestV0.prototype.identityIds = $util.emptyArray; - - /** - * GetIdentitiesTokenBalancesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @instance - */ - GetIdentitiesTokenBalancesRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentitiesTokenBalancesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 instance - */ - GetIdentitiesTokenBalancesRequestV0.create = function create(properties) { - return new GetIdentitiesTokenBalancesRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.identityIds != null && message.identityIds.length) - for (var i = 0; i < message.identityIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - if (!(message.identityIds && message.identityIds.length)) - message.identityIds = []; - message.identityIds.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenBalancesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenBalancesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.identityIds != null && message.hasOwnProperty("identityIds")) { - if (!Array.isArray(message.identityIds)) - return "identityIds: array expected"; - for (var i = 0; i < message.identityIds.length; ++i) - if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) - return "identityIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentitiesTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 - */ - GetIdentitiesTokenBalancesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.identityIds) { - if (!Array.isArray(object.identityIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.identityIds: array expected"); - message.identityIds = []; - for (var i = 0; i < object.identityIds.length; ++i) - if (typeof object.identityIds[i] === "string") - $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); - else if (object.identityIds[i].length >= 0) - message.identityIds[i] = object.identityIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenBalancesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenBalancesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.identityIds = []; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.prove = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.identityIds && message.identityIds.length) { - object.identityIds = []; - for (var j = 0; j < message.identityIds.length; ++j) - object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentitiesTokenBalancesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenBalancesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesTokenBalancesRequestV0; - })(); - - return GetIdentitiesTokenBalancesRequest; - })(); - - v0.GetIdentitiesTokenBalancesResponse = (function() { - - /** - * Properties of a GetIdentitiesTokenBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesTokenBalancesResponse - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null} [v0] GetIdentitiesTokenBalancesResponse v0 - */ - - /** - * Constructs a new GetIdentitiesTokenBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesTokenBalancesResponse. - * @implements IGetIdentitiesTokenBalancesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set - */ - function GetIdentitiesTokenBalancesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenBalancesResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @instance - */ - GetIdentitiesTokenBalancesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenBalancesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @instance - */ - Object.defineProperty(GetIdentitiesTokenBalancesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenBalancesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse instance - */ - GetIdentitiesTokenBalancesResponse.create = function create(properties) { - return new GetIdentitiesTokenBalancesResponse(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenBalancesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenBalancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse - */ - GetIdentitiesTokenBalancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenBalancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenBalancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesTokenBalancesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenBalancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 = (function() { - - /** - * Properties of a GetIdentitiesTokenBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @interface IGetIdentitiesTokenBalancesResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null} [identityTokenBalances] GetIdentitiesTokenBalancesResponseV0 identityTokenBalances - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenBalancesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenBalancesResponseV0 metadata - */ - - /** - * Constructs a new GetIdentitiesTokenBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @classdesc Represents a GetIdentitiesTokenBalancesResponseV0. - * @implements IGetIdentitiesTokenBalancesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set - */ - function GetIdentitiesTokenBalancesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenBalancesResponseV0 identityTokenBalances. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null|undefined} identityTokenBalances - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - */ - GetIdentitiesTokenBalancesResponseV0.prototype.identityTokenBalances = null; - - /** - * GetIdentitiesTokenBalancesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - */ - GetIdentitiesTokenBalancesResponseV0.prototype.proof = null; - - /** - * GetIdentitiesTokenBalancesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - */ - GetIdentitiesTokenBalancesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenBalancesResponseV0 result. - * @member {"identityTokenBalances"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - */ - Object.defineProperty(GetIdentitiesTokenBalancesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identityTokenBalances", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenBalancesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 instance - */ - GetIdentitiesTokenBalancesResponseV0.create = function create(properties) { - return new GetIdentitiesTokenBalancesResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityTokenBalances != null && Object.hasOwnProperty.call(message, "identityTokenBalances")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.encode(message.identityTokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenBalancesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenBalancesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify(message.identityTokenBalances); - if (error) - return "identityTokenBalances." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 - */ - GetIdentitiesTokenBalancesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); - if (object.identityTokenBalances != null) { - if (typeof object.identityTokenBalances !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.identityTokenBalances: object expected"); - message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.fromObject(object.identityTokenBalances); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenBalancesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenBalancesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { - object.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.toObject(message.identityTokenBalances, options); - if (options.oneofs) - object.result = "identityTokenBalances"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentitiesTokenBalancesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenBalancesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry = (function() { - - /** - * Properties of an IdentityTokenBalanceEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @interface IIdentityTokenBalanceEntry - * @property {Uint8Array|null} [identityId] IdentityTokenBalanceEntry identityId - * @property {number|Long|null} [balance] IdentityTokenBalanceEntry balance - */ - - /** - * Constructs a new IdentityTokenBalanceEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @classdesc Represents an IdentityTokenBalanceEntry. - * @implements IIdentityTokenBalanceEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set - */ - function IdentityTokenBalanceEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityTokenBalanceEntry identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @instance - */ - IdentityTokenBalanceEntry.prototype.identityId = $util.newBuffer([]); - - /** - * IdentityTokenBalanceEntry balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @instance - */ - IdentityTokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new IdentityTokenBalanceEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry instance - */ - IdentityTokenBalanceEntry.create = function create(properties) { - return new IdentityTokenBalanceEntry(properties); - }; - - /** - * Encodes the specified IdentityTokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalanceEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); - return writer; - }; - - /** - * Encodes the specified IdentityTokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalanceEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.balance = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityTokenBalanceEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityTokenBalanceEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.balance != null && message.hasOwnProperty("balance")) - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - return null; - }; - - /** - * Creates an IdentityTokenBalanceEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry - */ - IdentityTokenBalanceEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an IdentityTokenBalanceEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} message IdentityTokenBalanceEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityTokenBalanceEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.balance = options.longs === String ? "0" : 0; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.balance != null && message.hasOwnProperty("balance")) - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - return object; - }; - - /** - * Converts this IdentityTokenBalanceEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @instance - * @returns {Object.} JSON object - */ - IdentityTokenBalanceEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityTokenBalanceEntry; - })(); - - GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances = (function() { - - /** - * Properties of an IdentityTokenBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @interface IIdentityTokenBalances - * @property {Array.|null} [identityTokenBalances] IdentityTokenBalances identityTokenBalances - */ - - /** - * Constructs a new IdentityTokenBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @classdesc Represents an IdentityTokenBalances. - * @implements IIdentityTokenBalances - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set - */ - function IdentityTokenBalances(properties) { - this.identityTokenBalances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityTokenBalances identityTokenBalances. - * @member {Array.} identityTokenBalances - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @instance - */ - IdentityTokenBalances.prototype.identityTokenBalances = $util.emptyArray; - - /** - * Creates a new IdentityTokenBalances instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances instance - */ - IdentityTokenBalances.create = function create(properties) { - return new IdentityTokenBalances(properties); - }; - - /** - * Encodes the specified IdentityTokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalances.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityTokenBalances != null && message.identityTokenBalances.length) - for (var i = 0; i < message.identityTokenBalances.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.encode(message.identityTokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentityTokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalances.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityTokenBalances message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalances.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.identityTokenBalances && message.identityTokenBalances.length)) - message.identityTokenBalances = []; - message.identityTokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityTokenBalances message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalances.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityTokenBalances message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityTokenBalances.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { - if (!Array.isArray(message.identityTokenBalances)) - return "identityTokenBalances: array expected"; - for (var i = 0; i < message.identityTokenBalances.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify(message.identityTokenBalances[i]); - if (error) - return "identityTokenBalances." + error; - } - } - return null; - }; - - /** - * Creates an IdentityTokenBalances message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances - */ - IdentityTokenBalances.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); - if (object.identityTokenBalances) { - if (!Array.isArray(object.identityTokenBalances)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: array expected"); - message.identityTokenBalances = []; - for (var i = 0; i < object.identityTokenBalances.length; ++i) { - if (typeof object.identityTokenBalances[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: object expected"); - message.identityTokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.fromObject(object.identityTokenBalances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentityTokenBalances message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} message IdentityTokenBalances - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityTokenBalances.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.identityTokenBalances = []; - if (message.identityTokenBalances && message.identityTokenBalances.length) { - object.identityTokenBalances = []; - for (var j = 0; j < message.identityTokenBalances.length; ++j) - object.identityTokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.toObject(message.identityTokenBalances[j], options); - } - return object; - }; - - /** - * Converts this IdentityTokenBalances to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @instance - * @returns {Object.} JSON object - */ - IdentityTokenBalances.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityTokenBalances; - })(); - - return GetIdentitiesTokenBalancesResponseV0; - })(); - - return GetIdentitiesTokenBalancesResponse; - })(); - - v0.GetIdentityTokenInfosRequest = (function() { - - /** - * Properties of a GetIdentityTokenInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityTokenInfosRequest - * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null} [v0] GetIdentityTokenInfosRequest v0 - */ - - /** - * Constructs a new GetIdentityTokenInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityTokenInfosRequest. - * @implements IGetIdentityTokenInfosRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set - */ - function GetIdentityTokenInfosRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenInfosRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @instance - */ - GetIdentityTokenInfosRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenInfosRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @instance - */ - Object.defineProperty(GetIdentityTokenInfosRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenInfosRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest instance - */ - GetIdentityTokenInfosRequest.create = function create(properties) { - return new GetIdentityTokenInfosRequest(properties); - }; - - /** - * Encodes the specified GetIdentityTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenInfosRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenInfosRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityTokenInfosRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest - */ - GetIdentityTokenInfosRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenInfosRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenInfosRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityTokenInfosRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenInfosRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 = (function() { - - /** - * Properties of a GetIdentityTokenInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @interface IGetIdentityTokenInfosRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityTokenInfosRequestV0 identityId - * @property {Array.|null} [tokenIds] GetIdentityTokenInfosRequestV0 tokenIds - * @property {boolean|null} [prove] GetIdentityTokenInfosRequestV0 prove - */ - - /** - * Constructs a new GetIdentityTokenInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @classdesc Represents a GetIdentityTokenInfosRequestV0. - * @implements IGetIdentityTokenInfosRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set - */ - function GetIdentityTokenInfosRequestV0(properties) { - this.tokenIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenInfosRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @instance - */ - GetIdentityTokenInfosRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityTokenInfosRequestV0 tokenIds. - * @member {Array.} tokenIds - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @instance - */ - GetIdentityTokenInfosRequestV0.prototype.tokenIds = $util.emptyArray; - - /** - * GetIdentityTokenInfosRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @instance - */ - GetIdentityTokenInfosRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityTokenInfosRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 instance - */ - GetIdentityTokenInfosRequestV0.create = function create(properties) { - return new GetIdentityTokenInfosRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.tokenIds != null && message.tokenIds.length) - for (var i = 0; i < message.tokenIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - if (!(message.tokenIds && message.tokenIds.length)) - message.tokenIds = []; - message.tokenIds.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenInfosRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenInfosRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { - if (!Array.isArray(message.tokenIds)) - return "tokenIds: array expected"; - for (var i = 0; i < message.tokenIds.length; ++i) - if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) - return "tokenIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 - */ - GetIdentityTokenInfosRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.tokenIds) { - if (!Array.isArray(object.tokenIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.tokenIds: array expected"); - message.tokenIds = []; - for (var i = 0; i < object.tokenIds.length; ++i) - if (typeof object.tokenIds[i] === "string") - $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); - else if (object.tokenIds[i].length >= 0) - message.tokenIds[i] = object.tokenIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenInfosRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenInfosRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenIds = []; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.tokenIds && message.tokenIds.length) { - object.tokenIds = []; - for (var j = 0; j < message.tokenIds.length; ++j) - object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityTokenInfosRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenInfosRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityTokenInfosRequestV0; - })(); - - return GetIdentityTokenInfosRequest; - })(); - - v0.GetIdentityTokenInfosResponse = (function() { - - /** - * Properties of a GetIdentityTokenInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityTokenInfosResponse - * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null} [v0] GetIdentityTokenInfosResponse v0 - */ - - /** - * Constructs a new GetIdentityTokenInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityTokenInfosResponse. - * @implements IGetIdentityTokenInfosResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set - */ - function GetIdentityTokenInfosResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenInfosResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @instance - */ - GetIdentityTokenInfosResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenInfosResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @instance - */ - Object.defineProperty(GetIdentityTokenInfosResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenInfosResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse instance - */ - GetIdentityTokenInfosResponse.create = function create(properties) { - return new GetIdentityTokenInfosResponse(properties); - }; - - /** - * Encodes the specified GetIdentityTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenInfosResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenInfosResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityTokenInfosResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse - */ - GetIdentityTokenInfosResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenInfosResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenInfosResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityTokenInfosResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenInfosResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 = (function() { - - /** - * Properties of a GetIdentityTokenInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @interface IGetIdentityTokenInfosResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null} [tokenInfos] GetIdentityTokenInfosResponseV0 tokenInfos - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenInfosResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenInfosResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityTokenInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @classdesc Represents a GetIdentityTokenInfosResponseV0. - * @implements IGetIdentityTokenInfosResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set - */ - function GetIdentityTokenInfosResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenInfosResponseV0 tokenInfos. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null|undefined} tokenInfos - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - */ - GetIdentityTokenInfosResponseV0.prototype.tokenInfos = null; - - /** - * GetIdentityTokenInfosResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - */ - GetIdentityTokenInfosResponseV0.prototype.proof = null; - - /** - * GetIdentityTokenInfosResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - */ - GetIdentityTokenInfosResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenInfosResponseV0 result. - * @member {"tokenInfos"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityTokenInfosResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenInfos", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenInfosResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 instance - */ - GetIdentityTokenInfosResponseV0.create = function create(properties) { - return new GetIdentityTokenInfosResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenInfos != null && Object.hasOwnProperty.call(message, "tokenInfos")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.encode(message.tokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenInfosResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenInfosResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify(message.tokenInfos); - if (error) - return "tokenInfos." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 - */ - GetIdentityTokenInfosResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); - if (object.tokenInfos != null) { - if (typeof object.tokenInfos !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.tokenInfos: object expected"); - message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.fromObject(object.tokenInfos); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenInfosResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenInfosResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { - object.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.toObject(message.tokenInfos, options); - if (options.oneofs) - object.result = "tokenInfos"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityTokenInfosResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenInfosResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { - - /** - * Properties of a TokenIdentityInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @interface ITokenIdentityInfoEntry - * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen - */ - - /** - * Constructs a new TokenIdentityInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @classdesc Represents a TokenIdentityInfoEntry. - * @implements ITokenIdentityInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set - */ - function TokenIdentityInfoEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenIdentityInfoEntry frozen. - * @member {boolean} frozen - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @instance - */ - TokenIdentityInfoEntry.prototype.frozen = false; - - /** - * Creates a new TokenIdentityInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance - */ - TokenIdentityInfoEntry.create = function create(properties) { - return new TokenIdentityInfoEntry(properties); - }; - - /** - * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenIdentityInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); - return writer; - }; - - /** - * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenIdentityInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozen = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenIdentityInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenIdentityInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozen != null && message.hasOwnProperty("frozen")) - if (typeof message.frozen !== "boolean") - return "frozen: boolean expected"; - return null; - }; - - /** - * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - */ - TokenIdentityInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); - if (object.frozen != null) - message.frozen = Boolean(object.frozen); - return message; - }; - - /** - * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenIdentityInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.frozen = false; - if (message.frozen != null && message.hasOwnProperty("frozen")) - object.frozen = message.frozen; - return object; - }; - - /** - * Converts this TokenIdentityInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @instance - * @returns {Object.} JSON object - */ - TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenIdentityInfoEntry; - })(); - - GetIdentityTokenInfosResponseV0.TokenInfoEntry = (function() { - - /** - * Properties of a TokenInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @interface ITokenInfoEntry - * @property {Uint8Array|null} [tokenId] TokenInfoEntry tokenId - * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info - */ - - /** - * Constructs a new TokenInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @classdesc Represents a TokenInfoEntry. - * @implements ITokenInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set - */ - function TokenInfoEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenInfoEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @instance - */ - TokenInfoEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenInfoEntry info. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @instance - */ - TokenInfoEntry.prototype.info = null; - - /** - * Creates a new TokenInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance - */ - TokenInfoEntry.create = function create(properties) { - return new TokenInfoEntry(properties); - }; - - /** - * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.info != null && message.hasOwnProperty("info")) { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); - if (error) - return "info." + error; - } - return null; - }; - - /** - * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - */ - TokenInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.info: object expected"); - message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); - } - return message; - }; - - /** - * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.info = null; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); - return object; - }; - - /** - * Converts this TokenInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @instance - * @returns {Object.} JSON object - */ - TokenInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenInfoEntry; - })(); - - GetIdentityTokenInfosResponseV0.TokenInfos = (function() { - - /** - * Properties of a TokenInfos. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @interface ITokenInfos - * @property {Array.|null} [tokenInfos] TokenInfos tokenInfos - */ - - /** - * Constructs a new TokenInfos. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @classdesc Represents a TokenInfos. - * @implements ITokenInfos - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set - */ - function TokenInfos(properties) { - this.tokenInfos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenInfos tokenInfos. - * @member {Array.} tokenInfos - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @instance - */ - TokenInfos.prototype.tokenInfos = $util.emptyArray; - - /** - * Creates a new TokenInfos instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos instance - */ - TokenInfos.create = function create(properties) { - return new TokenInfos(properties); - }; - - /** - * Encodes the specified TokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfos.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenInfos != null && message.tokenInfos.length) - for (var i = 0; i < message.tokenInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfos.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenInfos message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfos.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenInfos && message.tokenInfos.length)) - message.tokenInfos = []; - message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenInfos message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfos.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenInfos message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenInfos.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { - if (!Array.isArray(message.tokenInfos)) - return "tokenInfos: array expected"; - for (var i = 0; i < message.tokenInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); - if (error) - return "tokenInfos." + error; - } - } - return null; - }; - - /** - * Creates a TokenInfos message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos - */ - TokenInfos.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); - if (object.tokenInfos) { - if (!Array.isArray(object.tokenInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: array expected"); - message.tokenInfos = []; - for (var i = 0; i < object.tokenInfos.length; ++i) { - if (typeof object.tokenInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: object expected"); - message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenInfos message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} message TokenInfos - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenInfos.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenInfos = []; - if (message.tokenInfos && message.tokenInfos.length) { - object.tokenInfos = []; - for (var j = 0; j < message.tokenInfos.length; ++j) - object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); - } - return object; - }; - - /** - * Converts this TokenInfos to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @instance - * @returns {Object.} JSON object - */ - TokenInfos.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenInfos; - })(); - - return GetIdentityTokenInfosResponseV0; - })(); - - return GetIdentityTokenInfosResponse; - })(); - - v0.GetIdentitiesTokenInfosRequest = (function() { - - /** - * Properties of a GetIdentitiesTokenInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesTokenInfosRequest - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null} [v0] GetIdentitiesTokenInfosRequest v0 - */ - - /** - * Constructs a new GetIdentitiesTokenInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesTokenInfosRequest. - * @implements IGetIdentitiesTokenInfosRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set - */ - function GetIdentitiesTokenInfosRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenInfosRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @instance - */ - GetIdentitiesTokenInfosRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenInfosRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @instance - */ - Object.defineProperty(GetIdentitiesTokenInfosRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenInfosRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest instance - */ - GetIdentitiesTokenInfosRequest.create = function create(properties) { - return new GetIdentitiesTokenInfosRequest(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenInfosRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenInfosRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenInfosRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest - */ - GetIdentitiesTokenInfosRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenInfosRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenInfosRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesTokenInfosRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenInfosRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 = (function() { - - /** - * Properties of a GetIdentitiesTokenInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @interface IGetIdentitiesTokenInfosRequestV0 - * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenInfosRequestV0 tokenId - * @property {Array.|null} [identityIds] GetIdentitiesTokenInfosRequestV0 identityIds - * @property {boolean|null} [prove] GetIdentitiesTokenInfosRequestV0 prove - */ - - /** - * Constructs a new GetIdentitiesTokenInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @classdesc Represents a GetIdentitiesTokenInfosRequestV0. - * @implements IGetIdentitiesTokenInfosRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set - */ - function GetIdentitiesTokenInfosRequestV0(properties) { - this.identityIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenInfosRequestV0 tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @instance - */ - GetIdentitiesTokenInfosRequestV0.prototype.tokenId = $util.newBuffer([]); - - /** - * GetIdentitiesTokenInfosRequestV0 identityIds. - * @member {Array.} identityIds - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @instance - */ - GetIdentitiesTokenInfosRequestV0.prototype.identityIds = $util.emptyArray; - - /** - * GetIdentitiesTokenInfosRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @instance - */ - GetIdentitiesTokenInfosRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentitiesTokenInfosRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 instance - */ - GetIdentitiesTokenInfosRequestV0.create = function create(properties) { - return new GetIdentitiesTokenInfosRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.identityIds != null && message.identityIds.length) - for (var i = 0; i < message.identityIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - if (!(message.identityIds && message.identityIds.length)) - message.identityIds = []; - message.identityIds.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenInfosRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenInfosRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.identityIds != null && message.hasOwnProperty("identityIds")) { - if (!Array.isArray(message.identityIds)) - return "identityIds: array expected"; - for (var i = 0; i < message.identityIds.length; ++i) - if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) - return "identityIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentitiesTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 - */ - GetIdentitiesTokenInfosRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.identityIds) { - if (!Array.isArray(object.identityIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.identityIds: array expected"); - message.identityIds = []; - for (var i = 0; i < object.identityIds.length; ++i) - if (typeof object.identityIds[i] === "string") - $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); - else if (object.identityIds[i].length >= 0) - message.identityIds[i] = object.identityIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenInfosRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenInfosRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.identityIds = []; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.prove = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.identityIds && message.identityIds.length) { - object.identityIds = []; - for (var j = 0; j < message.identityIds.length; ++j) - object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentitiesTokenInfosRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenInfosRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesTokenInfosRequestV0; - })(); - - return GetIdentitiesTokenInfosRequest; - })(); - - v0.GetIdentitiesTokenInfosResponse = (function() { - - /** - * Properties of a GetIdentitiesTokenInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesTokenInfosResponse - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null} [v0] GetIdentitiesTokenInfosResponse v0 - */ - - /** - * Constructs a new GetIdentitiesTokenInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesTokenInfosResponse. - * @implements IGetIdentitiesTokenInfosResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set - */ - function GetIdentitiesTokenInfosResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenInfosResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @instance - */ - GetIdentitiesTokenInfosResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenInfosResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @instance - */ - Object.defineProperty(GetIdentitiesTokenInfosResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenInfosResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse instance - */ - GetIdentitiesTokenInfosResponse.create = function create(properties) { - return new GetIdentitiesTokenInfosResponse(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenInfosResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenInfosResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenInfosResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse - */ - GetIdentitiesTokenInfosResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenInfosResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenInfosResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesTokenInfosResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenInfosResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 = (function() { - - /** - * Properties of a GetIdentitiesTokenInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @interface IGetIdentitiesTokenInfosResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null} [identityTokenInfos] GetIdentitiesTokenInfosResponseV0 identityTokenInfos - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenInfosResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenInfosResponseV0 metadata - */ - - /** - * Constructs a new GetIdentitiesTokenInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @classdesc Represents a GetIdentitiesTokenInfosResponseV0. - * @implements IGetIdentitiesTokenInfosResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set - */ - function GetIdentitiesTokenInfosResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenInfosResponseV0 identityTokenInfos. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null|undefined} identityTokenInfos - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - */ - GetIdentitiesTokenInfosResponseV0.prototype.identityTokenInfos = null; - - /** - * GetIdentitiesTokenInfosResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - */ - GetIdentitiesTokenInfosResponseV0.prototype.proof = null; - - /** - * GetIdentitiesTokenInfosResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - */ - GetIdentitiesTokenInfosResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenInfosResponseV0 result. - * @member {"identityTokenInfos"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - */ - Object.defineProperty(GetIdentitiesTokenInfosResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identityTokenInfos", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenInfosResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 instance - */ - GetIdentitiesTokenInfosResponseV0.create = function create(properties) { - return new GetIdentitiesTokenInfosResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityTokenInfos != null && Object.hasOwnProperty.call(message, "identityTokenInfos")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.encode(message.identityTokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenInfosResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenInfosResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify(message.identityTokenInfos); - if (error) - return "identityTokenInfos." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 - */ - GetIdentitiesTokenInfosResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); - if (object.identityTokenInfos != null) { - if (typeof object.identityTokenInfos !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.identityTokenInfos: object expected"); - message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.fromObject(object.identityTokenInfos); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenInfosResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenInfosResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { - object.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.toObject(message.identityTokenInfos, options); - if (options.oneofs) - object.result = "identityTokenInfos"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentitiesTokenInfosResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenInfosResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { - - /** - * Properties of a TokenIdentityInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @interface ITokenIdentityInfoEntry - * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen - */ - - /** - * Constructs a new TokenIdentityInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @classdesc Represents a TokenIdentityInfoEntry. - * @implements ITokenIdentityInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set - */ - function TokenIdentityInfoEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenIdentityInfoEntry frozen. - * @member {boolean} frozen - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @instance - */ - TokenIdentityInfoEntry.prototype.frozen = false; - - /** - * Creates a new TokenIdentityInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance - */ - TokenIdentityInfoEntry.create = function create(properties) { - return new TokenIdentityInfoEntry(properties); - }; - - /** - * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenIdentityInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); - return writer; - }; - - /** - * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenIdentityInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozen = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenIdentityInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenIdentityInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozen != null && message.hasOwnProperty("frozen")) - if (typeof message.frozen !== "boolean") - return "frozen: boolean expected"; - return null; - }; - - /** - * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - */ - TokenIdentityInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); - if (object.frozen != null) - message.frozen = Boolean(object.frozen); - return message; - }; - - /** - * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenIdentityInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.frozen = false; - if (message.frozen != null && message.hasOwnProperty("frozen")) - object.frozen = message.frozen; - return object; - }; - - /** - * Converts this TokenIdentityInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @instance - * @returns {Object.} JSON object - */ - TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenIdentityInfoEntry; - })(); - - GetIdentitiesTokenInfosResponseV0.TokenInfoEntry = (function() { - - /** - * Properties of a TokenInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @interface ITokenInfoEntry - * @property {Uint8Array|null} [identityId] TokenInfoEntry identityId - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info - */ - - /** - * Constructs a new TokenInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @classdesc Represents a TokenInfoEntry. - * @implements ITokenInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set - */ - function TokenInfoEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenInfoEntry identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @instance - */ - TokenInfoEntry.prototype.identityId = $util.newBuffer([]); - - /** - * TokenInfoEntry info. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @instance - */ - TokenInfoEntry.prototype.info = null; - - /** - * Creates a new TokenInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance - */ - TokenInfoEntry.create = function create(properties) { - return new TokenInfoEntry(properties); - }; - - /** - * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.info != null && message.hasOwnProperty("info")) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); - if (error) - return "info." + error; - } - return null; - }; - - /** - * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - */ - TokenInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.info: object expected"); - message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); - } - return message; - }; - - /** - * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.info = null; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); - return object; - }; - - /** - * Converts this TokenInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @instance - * @returns {Object.} JSON object - */ - TokenInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenInfoEntry; - })(); - - GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos = (function() { - - /** - * Properties of an IdentityTokenInfos. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @interface IIdentityTokenInfos - * @property {Array.|null} [tokenInfos] IdentityTokenInfos tokenInfos - */ - - /** - * Constructs a new IdentityTokenInfos. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @classdesc Represents an IdentityTokenInfos. - * @implements IIdentityTokenInfos - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set - */ - function IdentityTokenInfos(properties) { - this.tokenInfos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityTokenInfos tokenInfos. - * @member {Array.} tokenInfos - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @instance - */ - IdentityTokenInfos.prototype.tokenInfos = $util.emptyArray; - - /** - * Creates a new IdentityTokenInfos instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos instance - */ - IdentityTokenInfos.create = function create(properties) { - return new IdentityTokenInfos(properties); - }; - - /** - * Encodes the specified IdentityTokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenInfos.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenInfos != null && message.tokenInfos.length) - for (var i = 0; i < message.tokenInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentityTokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenInfos.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityTokenInfos message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenInfos.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenInfos && message.tokenInfos.length)) - message.tokenInfos = []; - message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityTokenInfos message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenInfos.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityTokenInfos message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityTokenInfos.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { - if (!Array.isArray(message.tokenInfos)) - return "tokenInfos: array expected"; - for (var i = 0; i < message.tokenInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); - if (error) - return "tokenInfos." + error; - } - } - return null; - }; - - /** - * Creates an IdentityTokenInfos message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos - */ - IdentityTokenInfos.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); - if (object.tokenInfos) { - if (!Array.isArray(object.tokenInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: array expected"); - message.tokenInfos = []; - for (var i = 0; i < object.tokenInfos.length; ++i) { - if (typeof object.tokenInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: object expected"); - message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentityTokenInfos message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} message IdentityTokenInfos - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityTokenInfos.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenInfos = []; - if (message.tokenInfos && message.tokenInfos.length) { - object.tokenInfos = []; - for (var j = 0; j < message.tokenInfos.length; ++j) - object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); - } - return object; - }; - - /** - * Converts this IdentityTokenInfos to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @instance - * @returns {Object.} JSON object - */ - IdentityTokenInfos.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityTokenInfos; - })(); - - return GetIdentitiesTokenInfosResponseV0; - })(); - - return GetIdentitiesTokenInfosResponse; - })(); - - v0.GetTokenStatusesRequest = (function() { - - /** - * Properties of a GetTokenStatusesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenStatusesRequest - * @property {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null} [v0] GetTokenStatusesRequest v0 - */ - - /** - * Constructs a new GetTokenStatusesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenStatusesRequest. - * @implements IGetTokenStatusesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set - */ - function GetTokenStatusesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenStatusesRequest v0. - * @member {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @instance - */ - GetTokenStatusesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenStatusesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @instance - */ - Object.defineProperty(GetTokenStatusesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenStatusesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest instance - */ - GetTokenStatusesRequest.create = function create(properties) { - return new GetTokenStatusesRequest(properties); - }; - - /** - * Encodes the specified GetTokenStatusesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenStatusesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenStatusesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenStatusesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenStatusesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenStatusesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenStatusesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest - */ - GetTokenStatusesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenStatusesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest} message GetTokenStatusesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenStatusesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenStatusesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @instance - * @returns {Object.} JSON object - */ - GetTokenStatusesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenStatusesRequest.GetTokenStatusesRequestV0 = (function() { - - /** - * Properties of a GetTokenStatusesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @interface IGetTokenStatusesRequestV0 - * @property {Array.|null} [tokenIds] GetTokenStatusesRequestV0 tokenIds - * @property {boolean|null} [prove] GetTokenStatusesRequestV0 prove - */ - - /** - * Constructs a new GetTokenStatusesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @classdesc Represents a GetTokenStatusesRequestV0. - * @implements IGetTokenStatusesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set - */ - function GetTokenStatusesRequestV0(properties) { - this.tokenIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenStatusesRequestV0 tokenIds. - * @member {Array.} tokenIds - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @instance - */ - GetTokenStatusesRequestV0.prototype.tokenIds = $util.emptyArray; - - /** - * GetTokenStatusesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @instance - */ - GetTokenStatusesRequestV0.prototype.prove = false; - - /** - * Creates a new GetTokenStatusesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 instance - */ - GetTokenStatusesRequestV0.create = function create(properties) { - return new GetTokenStatusesRequestV0(properties); - }; - - /** - * Encodes the specified GetTokenStatusesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenIds != null && message.tokenIds.length) - for (var i = 0; i < message.tokenIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTokenStatusesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenIds && message.tokenIds.length)) - message.tokenIds = []; - message.tokenIds.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenStatusesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenStatusesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { - if (!Array.isArray(message.tokenIds)) - return "tokenIds: array expected"; - for (var i = 0; i < message.tokenIds.length; ++i) - if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) - return "tokenIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTokenStatusesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 - */ - GetTokenStatusesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); - if (object.tokenIds) { - if (!Array.isArray(object.tokenIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.tokenIds: array expected"); - message.tokenIds = []; - for (var i = 0; i < object.tokenIds.length; ++i) - if (typeof object.tokenIds[i] === "string") - $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); - else if (object.tokenIds[i].length >= 0) - message.tokenIds[i] = object.tokenIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTokenStatusesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenStatusesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenIds = []; - if (options.defaults) - object.prove = false; - if (message.tokenIds && message.tokenIds.length) { - object.tokenIds = []; - for (var j = 0; j < message.tokenIds.length; ++j) - object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTokenStatusesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenStatusesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTokenStatusesRequestV0; - })(); - - return GetTokenStatusesRequest; - })(); - - v0.GetTokenStatusesResponse = (function() { - - /** - * Properties of a GetTokenStatusesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenStatusesResponse - * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null} [v0] GetTokenStatusesResponse v0 - */ - - /** - * Constructs a new GetTokenStatusesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenStatusesResponse. - * @implements IGetTokenStatusesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set - */ - function GetTokenStatusesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenStatusesResponse v0. - * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @instance - */ - GetTokenStatusesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenStatusesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @instance - */ - Object.defineProperty(GetTokenStatusesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenStatusesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse instance - */ - GetTokenStatusesResponse.create = function create(properties) { - return new GetTokenStatusesResponse(properties); - }; - - /** - * Encodes the specified GetTokenStatusesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenStatusesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenStatusesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenStatusesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenStatusesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenStatusesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenStatusesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse - */ - GetTokenStatusesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenStatusesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} message GetTokenStatusesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenStatusesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenStatusesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @instance - * @returns {Object.} JSON object - */ - GetTokenStatusesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenStatusesResponse.GetTokenStatusesResponseV0 = (function() { - - /** - * Properties of a GetTokenStatusesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @interface IGetTokenStatusesResponseV0 - * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null} [tokenStatuses] GetTokenStatusesResponseV0 tokenStatuses - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenStatusesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenStatusesResponseV0 metadata - */ - - /** - * Constructs a new GetTokenStatusesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @classdesc Represents a GetTokenStatusesResponseV0. - * @implements IGetTokenStatusesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set - */ - function GetTokenStatusesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenStatusesResponseV0 tokenStatuses. - * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null|undefined} tokenStatuses - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - */ - GetTokenStatusesResponseV0.prototype.tokenStatuses = null; - - /** - * GetTokenStatusesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - */ - GetTokenStatusesResponseV0.prototype.proof = null; - - /** - * GetTokenStatusesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - */ - GetTokenStatusesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenStatusesResponseV0 result. - * @member {"tokenStatuses"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - */ - Object.defineProperty(GetTokenStatusesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenStatuses", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenStatusesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 instance - */ - GetTokenStatusesResponseV0.create = function create(properties) { - return new GetTokenStatusesResponseV0(properties); - }; - - /** - * Encodes the specified GetTokenStatusesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenStatuses != null && Object.hasOwnProperty.call(message, "tokenStatuses")) - $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.encode(message.tokenStatuses, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenStatusesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenStatusesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenStatusesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify(message.tokenStatuses); - if (error) - return "tokenStatuses." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTokenStatusesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 - */ - GetTokenStatusesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); - if (object.tokenStatuses != null) { - if (typeof object.tokenStatuses !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.tokenStatuses: object expected"); - message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.fromObject(object.tokenStatuses); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenStatusesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenStatusesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { - object.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.toObject(message.tokenStatuses, options); - if (options.oneofs) - object.result = "tokenStatuses"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTokenStatusesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenStatusesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenStatusesResponseV0.TokenStatusEntry = (function() { - - /** - * Properties of a TokenStatusEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @interface ITokenStatusEntry - * @property {Uint8Array|null} [tokenId] TokenStatusEntry tokenId - * @property {boolean|null} [paused] TokenStatusEntry paused - */ - - /** - * Constructs a new TokenStatusEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @classdesc Represents a TokenStatusEntry. - * @implements ITokenStatusEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set - */ - function TokenStatusEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenStatusEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @instance - */ - TokenStatusEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenStatusEntry paused. - * @member {boolean} paused - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @instance - */ - TokenStatusEntry.prototype.paused = false; - - /** - * Creates a new TokenStatusEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry instance - */ - TokenStatusEntry.create = function create(properties) { - return new TokenStatusEntry(properties); - }; - - /** - * Encodes the specified TokenStatusEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatusEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.paused != null && Object.hasOwnProperty.call(message, "paused")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.paused); - return writer; - }; - - /** - * Encodes the specified TokenStatusEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatusEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenStatusEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatusEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.paused = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenStatusEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatusEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenStatusEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenStatusEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.paused != null && message.hasOwnProperty("paused")) - if (typeof message.paused !== "boolean") - return "paused: boolean expected"; - return null; - }; - - /** - * Creates a TokenStatusEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry - */ - TokenStatusEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.paused != null) - message.paused = Boolean(object.paused); - return message; - }; - - /** - * Creates a plain object from a TokenStatusEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} message TokenStatusEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenStatusEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.paused = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.paused != null && message.hasOwnProperty("paused")) - object.paused = message.paused; - return object; - }; - - /** - * Converts this TokenStatusEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @instance - * @returns {Object.} JSON object - */ - TokenStatusEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenStatusEntry; - })(); - - GetTokenStatusesResponseV0.TokenStatuses = (function() { - - /** - * Properties of a TokenStatuses. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @interface ITokenStatuses - * @property {Array.|null} [tokenStatuses] TokenStatuses tokenStatuses - */ - - /** - * Constructs a new TokenStatuses. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @classdesc Represents a TokenStatuses. - * @implements ITokenStatuses - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set - */ - function TokenStatuses(properties) { - this.tokenStatuses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenStatuses tokenStatuses. - * @member {Array.} tokenStatuses - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @instance - */ - TokenStatuses.prototype.tokenStatuses = $util.emptyArray; - - /** - * Creates a new TokenStatuses instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses instance - */ - TokenStatuses.create = function create(properties) { - return new TokenStatuses(properties); - }; - - /** - * Encodes the specified TokenStatuses message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatuses.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenStatuses != null && message.tokenStatuses.length) - for (var i = 0; i < message.tokenStatuses.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.encode(message.tokenStatuses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenStatuses message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatuses.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenStatuses message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatuses.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenStatuses && message.tokenStatuses.length)) - message.tokenStatuses = []; - message.tokenStatuses.push($root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenStatuses message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatuses.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenStatuses message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenStatuses.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { - if (!Array.isArray(message.tokenStatuses)) - return "tokenStatuses: array expected"; - for (var i = 0; i < message.tokenStatuses.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify(message.tokenStatuses[i]); - if (error) - return "tokenStatuses." + error; - } - } - return null; - }; - - /** - * Creates a TokenStatuses message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses - */ - TokenStatuses.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); - if (object.tokenStatuses) { - if (!Array.isArray(object.tokenStatuses)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: array expected"); - message.tokenStatuses = []; - for (var i = 0; i < object.tokenStatuses.length; ++i) { - if (typeof object.tokenStatuses[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: object expected"); - message.tokenStatuses[i] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.fromObject(object.tokenStatuses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenStatuses message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} message TokenStatuses - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenStatuses.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenStatuses = []; - if (message.tokenStatuses && message.tokenStatuses.length) { - object.tokenStatuses = []; - for (var j = 0; j < message.tokenStatuses.length; ++j) - object.tokenStatuses[j] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.toObject(message.tokenStatuses[j], options); - } - return object; - }; - - /** - * Converts this TokenStatuses to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @instance - * @returns {Object.} JSON object - */ - TokenStatuses.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenStatuses; - })(); - - return GetTokenStatusesResponseV0; - })(); - - return GetTokenStatusesResponse; - })(); - - v0.GetTokenDirectPurchasePricesRequest = (function() { - - /** - * Properties of a GetTokenDirectPurchasePricesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenDirectPurchasePricesRequest - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null} [v0] GetTokenDirectPurchasePricesRequest v0 - */ - - /** - * Constructs a new GetTokenDirectPurchasePricesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenDirectPurchasePricesRequest. - * @implements IGetTokenDirectPurchasePricesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set - */ - function GetTokenDirectPurchasePricesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenDirectPurchasePricesRequest v0. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @instance - */ - GetTokenDirectPurchasePricesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenDirectPurchasePricesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @instance - */ - Object.defineProperty(GetTokenDirectPurchasePricesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenDirectPurchasePricesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest instance - */ - GetTokenDirectPurchasePricesRequest.create = function create(properties) { - return new GetTokenDirectPurchasePricesRequest(properties); - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenDirectPurchasePricesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenDirectPurchasePricesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenDirectPurchasePricesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest - */ - GetTokenDirectPurchasePricesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenDirectPurchasePricesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenDirectPurchasePricesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenDirectPurchasePricesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @instance - * @returns {Object.} JSON object - */ - GetTokenDirectPurchasePricesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = (function() { - - /** - * Properties of a GetTokenDirectPurchasePricesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @interface IGetTokenDirectPurchasePricesRequestV0 - * @property {Array.|null} [tokenIds] GetTokenDirectPurchasePricesRequestV0 tokenIds - * @property {boolean|null} [prove] GetTokenDirectPurchasePricesRequestV0 prove - */ - - /** - * Constructs a new GetTokenDirectPurchasePricesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @classdesc Represents a GetTokenDirectPurchasePricesRequestV0. - * @implements IGetTokenDirectPurchasePricesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set - */ - function GetTokenDirectPurchasePricesRequestV0(properties) { - this.tokenIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenDirectPurchasePricesRequestV0 tokenIds. - * @member {Array.} tokenIds - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @instance - */ - GetTokenDirectPurchasePricesRequestV0.prototype.tokenIds = $util.emptyArray; - - /** - * GetTokenDirectPurchasePricesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @instance - */ - GetTokenDirectPurchasePricesRequestV0.prototype.prove = false; - - /** - * Creates a new GetTokenDirectPurchasePricesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 instance - */ - GetTokenDirectPurchasePricesRequestV0.create = function create(properties) { - return new GetTokenDirectPurchasePricesRequestV0(properties); - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenIds != null && message.tokenIds.length) - for (var i = 0; i < message.tokenIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenIds && message.tokenIds.length)) - message.tokenIds = []; - message.tokenIds.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenDirectPurchasePricesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenDirectPurchasePricesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { - if (!Array.isArray(message.tokenIds)) - return "tokenIds: array expected"; - for (var i = 0; i < message.tokenIds.length; ++i) - if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) - return "tokenIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTokenDirectPurchasePricesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 - */ - GetTokenDirectPurchasePricesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); - if (object.tokenIds) { - if (!Array.isArray(object.tokenIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.tokenIds: array expected"); - message.tokenIds = []; - for (var i = 0; i < object.tokenIds.length; ++i) - if (typeof object.tokenIds[i] === "string") - $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); - else if (object.tokenIds[i].length >= 0) - message.tokenIds[i] = object.tokenIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTokenDirectPurchasePricesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenDirectPurchasePricesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenIds = []; - if (options.defaults) - object.prove = false; - if (message.tokenIds && message.tokenIds.length) { - object.tokenIds = []; - for (var j = 0; j < message.tokenIds.length; ++j) - object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTokenDirectPurchasePricesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenDirectPurchasePricesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTokenDirectPurchasePricesRequestV0; - })(); - - return GetTokenDirectPurchasePricesRequest; - })(); - - v0.GetTokenDirectPurchasePricesResponse = (function() { - - /** - * Properties of a GetTokenDirectPurchasePricesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenDirectPurchasePricesResponse - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null} [v0] GetTokenDirectPurchasePricesResponse v0 - */ - - /** - * Constructs a new GetTokenDirectPurchasePricesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenDirectPurchasePricesResponse. - * @implements IGetTokenDirectPurchasePricesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set - */ - function GetTokenDirectPurchasePricesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenDirectPurchasePricesResponse v0. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @instance - */ - GetTokenDirectPurchasePricesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenDirectPurchasePricesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @instance - */ - Object.defineProperty(GetTokenDirectPurchasePricesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenDirectPurchasePricesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse instance - */ - GetTokenDirectPurchasePricesResponse.create = function create(properties) { - return new GetTokenDirectPurchasePricesResponse(properties); - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenDirectPurchasePricesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenDirectPurchasePricesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenDirectPurchasePricesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse - */ - GetTokenDirectPurchasePricesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenDirectPurchasePricesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenDirectPurchasePricesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenDirectPurchasePricesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @instance - * @returns {Object.} JSON object - */ - GetTokenDirectPurchasePricesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = (function() { - - /** - * Properties of a GetTokenDirectPurchasePricesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @interface IGetTokenDirectPurchasePricesResponseV0 - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null} [tokenDirectPurchasePrices] GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenDirectPurchasePricesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenDirectPurchasePricesResponseV0 metadata - */ - - /** - * Constructs a new GetTokenDirectPurchasePricesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @classdesc Represents a GetTokenDirectPurchasePricesResponseV0. - * @implements IGetTokenDirectPurchasePricesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set - */ - function GetTokenDirectPurchasePricesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null|undefined} tokenDirectPurchasePrices - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - */ - GetTokenDirectPurchasePricesResponseV0.prototype.tokenDirectPurchasePrices = null; - - /** - * GetTokenDirectPurchasePricesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - */ - GetTokenDirectPurchasePricesResponseV0.prototype.proof = null; - - /** - * GetTokenDirectPurchasePricesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - */ - GetTokenDirectPurchasePricesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenDirectPurchasePricesResponseV0 result. - * @member {"tokenDirectPurchasePrices"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - */ - Object.defineProperty(GetTokenDirectPurchasePricesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenDirectPurchasePrices", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenDirectPurchasePricesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 instance - */ - GetTokenDirectPurchasePricesResponseV0.create = function create(properties) { - return new GetTokenDirectPurchasePricesResponseV0(properties); - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenDirectPurchasePrices != null && Object.hasOwnProperty.call(message, "tokenDirectPurchasePrices")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.encode(message.tokenDirectPurchasePrices, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenDirectPurchasePricesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenDirectPurchasePricesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify(message.tokenDirectPurchasePrices); - if (error) - return "tokenDirectPurchasePrices." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTokenDirectPurchasePricesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 - */ - GetTokenDirectPurchasePricesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); - if (object.tokenDirectPurchasePrices != null) { - if (typeof object.tokenDirectPurchasePrices !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.tokenDirectPurchasePrices: object expected"); - message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.fromObject(object.tokenDirectPurchasePrices); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenDirectPurchasePricesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenDirectPurchasePricesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { - object.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(message.tokenDirectPurchasePrices, options); - if (options.oneofs) - object.result = "tokenDirectPurchasePrices"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTokenDirectPurchasePricesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenDirectPurchasePricesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = (function() { - - /** - * Properties of a PriceForQuantity. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface IPriceForQuantity - * @property {number|Long|null} [quantity] PriceForQuantity quantity - * @property {number|Long|null} [price] PriceForQuantity price - */ - - /** - * Constructs a new PriceForQuantity. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a PriceForQuantity. - * @implements IPriceForQuantity - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set - */ - function PriceForQuantity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PriceForQuantity quantity. - * @member {number|Long} quantity - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @instance - */ - PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PriceForQuantity price. - * @member {number|Long} price - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @instance - */ - PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new PriceForQuantity instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity instance - */ - PriceForQuantity.create = function create(properties) { - return new PriceForQuantity(properties); - }; - - /** - * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceForQuantity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); - return writer; - }; - - /** - * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PriceForQuantity message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceForQuantity.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quantity = reader.uint64(); - break; - case 2: - message.price = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PriceForQuantity message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PriceForQuantity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quantity != null && message.hasOwnProperty("quantity")) - if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) - return "quantity: integer|Long expected"; - if (message.price != null && message.hasOwnProperty("price")) - if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) - return "price: integer|Long expected"; - return null; - }; - - /** - * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity - */ - PriceForQuantity.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); - if (object.quantity != null) - if ($util.Long) - (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; - else if (typeof object.quantity === "string") - message.quantity = parseInt(object.quantity, 10); - else if (typeof object.quantity === "number") - message.quantity = object.quantity; - else if (typeof object.quantity === "object") - message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); - if (object.price != null) - if ($util.Long) - (message.price = $util.Long.fromValue(object.price)).unsigned = true; - else if (typeof object.price === "string") - message.price = parseInt(object.price, 10); - else if (typeof object.price === "number") - message.price = object.price; - else if (typeof object.price === "object") - message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} message PriceForQuantity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PriceForQuantity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.quantity = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.price = options.longs === String ? "0" : 0; - } - if (message.quantity != null && message.hasOwnProperty("quantity")) - if (typeof message.quantity === "number") - object.quantity = options.longs === String ? String(message.quantity) : message.quantity; - else - object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; - if (message.price != null && message.hasOwnProperty("price")) - if (typeof message.price === "number") - object.price = options.longs === String ? String(message.price) : message.price; - else - object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; - return object; - }; - - /** - * Converts this PriceForQuantity to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @instance - * @returns {Object.} JSON object - */ - PriceForQuantity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PriceForQuantity; - })(); - - GetTokenDirectPurchasePricesResponseV0.PricingSchedule = (function() { - - /** - * Properties of a PricingSchedule. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface IPricingSchedule - * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity - */ - - /** - * Constructs a new PricingSchedule. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a PricingSchedule. - * @implements IPricingSchedule - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set - */ - function PricingSchedule(properties) { - this.priceForQuantity = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PricingSchedule priceForQuantity. - * @member {Array.} priceForQuantity - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @instance - */ - PricingSchedule.prototype.priceForQuantity = $util.emptyArray; - - /** - * Creates a new PricingSchedule instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule instance - */ - PricingSchedule.create = function create(properties) { - return new PricingSchedule(properties); - }; - - /** - * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PricingSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.priceForQuantity != null && message.priceForQuantity.length) - for (var i = 0; i < message.priceForQuantity.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PricingSchedule message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PricingSchedule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.priceForQuantity && message.priceForQuantity.length)) - message.priceForQuantity = []; - message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PricingSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PricingSchedule message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PricingSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { - if (!Array.isArray(message.priceForQuantity)) - return "priceForQuantity: array expected"; - for (var i = 0; i < message.priceForQuantity.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify(message.priceForQuantity[i]); - if (error) - return "priceForQuantity." + error; - } - } - return null; - }; - - /** - * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule - */ - PricingSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); - if (object.priceForQuantity) { - if (!Array.isArray(object.priceForQuantity)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: array expected"); - message.priceForQuantity = []; - for (var i = 0; i < object.priceForQuantity.length; ++i) { - if (typeof object.priceForQuantity[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: object expected"); - message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.fromObject(object.priceForQuantity[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} message PricingSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PricingSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.priceForQuantity = []; - if (message.priceForQuantity && message.priceForQuantity.length) { - object.priceForQuantity = []; - for (var j = 0; j < message.priceForQuantity.length; ++j) - object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject(message.priceForQuantity[j], options); - } - return object; - }; - - /** - * Converts this PricingSchedule to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @instance - * @returns {Object.} JSON object - */ - PricingSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PricingSchedule; - })(); - - GetTokenDirectPurchasePricesResponseV0.Price = (function() { - - /** - * Properties of a Price. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface IPrice - * @property {number|Long|null} [fixedPrice] Price fixedPrice - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null} [variablePrice] Price variablePrice - */ - - /** - * Constructs a new Price. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a Price. - * @implements IPrice - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice=} [properties] Properties to set - */ - function Price(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Price fixedPrice. - * @member {number|Long} fixedPrice - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @instance - */ - Price.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Price variablePrice. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null|undefined} variablePrice - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @instance - */ - Price.prototype.variablePrice = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Price price. - * @member {"fixedPrice"|"variablePrice"|undefined} price - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @instance - */ - Object.defineProperty(Price.prototype, "price", { - get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Price instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price instance - */ - Price.create = function create(properties) { - return new Price(properties); - }; - - /** - * Encodes the specified Price message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice} message Price message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Price.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.fixedPrice); - if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Price message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice} message Price message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Price.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Price message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Price.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fixedPrice = reader.uint64(); - break; - case 2: - message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Price message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Price.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Price message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Price.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { - properties.price = 1; - if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) - return "fixedPrice: integer|Long expected"; - } - if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { - if (properties.price === 1) - return "price: multiple values"; - properties.price = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify(message.variablePrice); - if (error) - return "variablePrice." + error; - } - } - return null; - }; - - /** - * Creates a Price message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price - */ - Price.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price(); - if (object.fixedPrice != null) - if ($util.Long) - (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; - else if (typeof object.fixedPrice === "string") - message.fixedPrice = parseInt(object.fixedPrice, 10); - else if (typeof object.fixedPrice === "number") - message.fixedPrice = object.fixedPrice; - else if (typeof object.fixedPrice === "object") - message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); - if (object.variablePrice != null) { - if (typeof object.variablePrice !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.variablePrice: object expected"); - message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.fromObject(object.variablePrice); - } - return message; - }; - - /** - * Creates a plain object from a Price message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} message Price - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Price.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { - if (typeof message.fixedPrice === "number") - object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; - else - object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; - if (options.oneofs) - object.price = "fixedPrice"; - } - if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { - object.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(message.variablePrice, options); - if (options.oneofs) - object.price = "variablePrice"; - } - return object; - }; - - /** - * Converts this Price to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @instance - * @returns {Object.} JSON object - */ - Price.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Price; - })(); - - GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = (function() { - - /** - * Properties of a TokenDirectPurchasePriceEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface ITokenDirectPurchasePriceEntry - * @property {Uint8Array|null} [tokenId] TokenDirectPurchasePriceEntry tokenId - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice|null} [price] TokenDirectPurchasePriceEntry price - */ - - /** - * Constructs a new TokenDirectPurchasePriceEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a TokenDirectPurchasePriceEntry. - * @implements ITokenDirectPurchasePriceEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set - */ - function TokenDirectPurchasePriceEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenDirectPurchasePriceEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @instance - */ - TokenDirectPurchasePriceEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenDirectPurchasePriceEntry price. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice|null|undefined} price - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @instance - */ - TokenDirectPurchasePriceEntry.prototype.price = null; - - /** - * Creates a new TokenDirectPurchasePriceEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry instance - */ - TokenDirectPurchasePriceEntry.create = function create(properties) { - return new TokenDirectPurchasePriceEntry(properties); - }; - - /** - * Encodes the specified TokenDirectPurchasePriceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDirectPurchasePriceEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.encode(message.price, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenDirectPurchasePriceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDirectPurchasePriceEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDirectPurchasePriceEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDirectPurchasePriceEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenDirectPurchasePriceEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenDirectPurchasePriceEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.price != null && message.hasOwnProperty("price")) { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify(message.price); - if (error) - return "price." + error; - } - return null; - }; - - /** - * Creates a TokenDirectPurchasePriceEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry - */ - TokenDirectPurchasePriceEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.price != null) { - if (typeof object.price !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.price: object expected"); - message.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.fromObject(object.price); - } - return message; - }; - - /** - * Creates a plain object from a TokenDirectPurchasePriceEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenDirectPurchasePriceEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.price = null; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.price != null && message.hasOwnProperty("price")) - object.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(message.price, options); - return object; - }; - - /** - * Converts this TokenDirectPurchasePriceEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @instance - * @returns {Object.} JSON object - */ - TokenDirectPurchasePriceEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenDirectPurchasePriceEntry; - })(); - - GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = (function() { - - /** - * Properties of a TokenDirectPurchasePrices. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface ITokenDirectPurchasePrices - * @property {Array.|null} [tokenDirectPurchasePrice] TokenDirectPurchasePrices tokenDirectPurchasePrice - */ - - /** - * Constructs a new TokenDirectPurchasePrices. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a TokenDirectPurchasePrices. - * @implements ITokenDirectPurchasePrices - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set - */ - function TokenDirectPurchasePrices(properties) { - this.tokenDirectPurchasePrice = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenDirectPurchasePrices tokenDirectPurchasePrice. - * @member {Array.} tokenDirectPurchasePrice - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @instance - */ - TokenDirectPurchasePrices.prototype.tokenDirectPurchasePrice = $util.emptyArray; - - /** - * Creates a new TokenDirectPurchasePrices instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices instance - */ - TokenDirectPurchasePrices.create = function create(properties) { - return new TokenDirectPurchasePrices(properties); - }; - - /** - * Encodes the specified TokenDirectPurchasePrices message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDirectPurchasePrices.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenDirectPurchasePrice != null && message.tokenDirectPurchasePrice.length) - for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.encode(message.tokenDirectPurchasePrice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenDirectPurchasePrices message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDirectPurchasePrices.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDirectPurchasePrices.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length)) - message.tokenDirectPurchasePrice = []; - message.tokenDirectPurchasePrice.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDirectPurchasePrices.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenDirectPurchasePrices message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenDirectPurchasePrices.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenDirectPurchasePrice != null && message.hasOwnProperty("tokenDirectPurchasePrice")) { - if (!Array.isArray(message.tokenDirectPurchasePrice)) - return "tokenDirectPurchasePrice: array expected"; - for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify(message.tokenDirectPurchasePrice[i]); - if (error) - return "tokenDirectPurchasePrice." + error; - } - } - return null; - }; - - /** - * Creates a TokenDirectPurchasePrices message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices - */ - TokenDirectPurchasePrices.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); - if (object.tokenDirectPurchasePrice) { - if (!Array.isArray(object.tokenDirectPurchasePrice)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: array expected"); - message.tokenDirectPurchasePrice = []; - for (var i = 0; i < object.tokenDirectPurchasePrice.length; ++i) { - if (typeof object.tokenDirectPurchasePrice[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: object expected"); - message.tokenDirectPurchasePrice[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.fromObject(object.tokenDirectPurchasePrice[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenDirectPurchasePrices message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} message TokenDirectPurchasePrices - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenDirectPurchasePrices.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenDirectPurchasePrice = []; - if (message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length) { - object.tokenDirectPurchasePrice = []; - for (var j = 0; j < message.tokenDirectPurchasePrice.length; ++j) - object.tokenDirectPurchasePrice[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject(message.tokenDirectPurchasePrice[j], options); - } - return object; - }; - - /** - * Converts this TokenDirectPurchasePrices to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @instance - * @returns {Object.} JSON object - */ - TokenDirectPurchasePrices.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenDirectPurchasePrices; - })(); - - return GetTokenDirectPurchasePricesResponseV0; - })(); - - return GetTokenDirectPurchasePricesResponse; - })(); - - v0.GetTokenPreProgrammedDistributionsRequest = (function() { - - /** - * Properties of a GetTokenPreProgrammedDistributionsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenPreProgrammedDistributionsRequest - * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null} [v0] GetTokenPreProgrammedDistributionsRequest v0 - */ - - /** - * Constructs a new GetTokenPreProgrammedDistributionsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenPreProgrammedDistributionsRequest. - * @implements IGetTokenPreProgrammedDistributionsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set - */ - function GetTokenPreProgrammedDistributionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenPreProgrammedDistributionsRequest v0. - * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @instance - */ - GetTokenPreProgrammedDistributionsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenPreProgrammedDistributionsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @instance - */ - Object.defineProperty(GetTokenPreProgrammedDistributionsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenPreProgrammedDistributionsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest instance - */ - GetTokenPreProgrammedDistributionsRequest.create = function create(properties) { - return new GetTokenPreProgrammedDistributionsRequest(properties); - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenPreProgrammedDistributionsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenPreProgrammedDistributionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenPreProgrammedDistributionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest - */ - GetTokenPreProgrammedDistributionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenPreProgrammedDistributionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenPreProgrammedDistributionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenPreProgrammedDistributionsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @instance - * @returns {Object.} JSON object - */ - GetTokenPreProgrammedDistributionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 = (function() { - - /** - * Properties of a GetTokenPreProgrammedDistributionsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @interface IGetTokenPreProgrammedDistributionsRequestV0 - * @property {Uint8Array|null} [tokenId] GetTokenPreProgrammedDistributionsRequestV0 tokenId - * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null} [startAtInfo] GetTokenPreProgrammedDistributionsRequestV0 startAtInfo - * @property {number|null} [limit] GetTokenPreProgrammedDistributionsRequestV0 limit - * @property {boolean|null} [prove] GetTokenPreProgrammedDistributionsRequestV0 prove - */ - - /** - * Constructs a new GetTokenPreProgrammedDistributionsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @classdesc Represents a GetTokenPreProgrammedDistributionsRequestV0. - * @implements IGetTokenPreProgrammedDistributionsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set - */ - function GetTokenPreProgrammedDistributionsRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenPreProgrammedDistributionsRequestV0 tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.tokenId = $util.newBuffer([]); - - /** - * GetTokenPreProgrammedDistributionsRequestV0 startAtInfo. - * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null|undefined} startAtInfo - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.startAtInfo = null; - - /** - * GetTokenPreProgrammedDistributionsRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.limit = 0; - - /** - * GetTokenPreProgrammedDistributionsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.prove = false; - - /** - * Creates a new GetTokenPreProgrammedDistributionsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 instance - */ - GetTokenPreProgrammedDistributionsRequestV0.create = function create(properties) { - return new GetTokenPreProgrammedDistributionsRequestV0(properties); - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.startAtInfo != null && Object.hasOwnProperty.call(message, "startAtInfo")) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.encode(message.startAtInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.decode(reader, reader.uint32()); - break; - case 3: - message.limit = reader.uint32(); - break; - case 4: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenPreProgrammedDistributionsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenPreProgrammedDistributionsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify(message.startAtInfo); - if (error) - return "startAtInfo." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTokenPreProgrammedDistributionsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 - */ - GetTokenPreProgrammedDistributionsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.startAtInfo != null) { - if (typeof object.startAtInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.startAtInfo: object expected"); - message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.fromObject(object.startAtInfo); - } - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTokenPreProgrammedDistributionsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenPreProgrammedDistributionsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.startAtInfo = null; - object.limit = 0; - object.prove = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) - object.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.toObject(message.startAtInfo, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTokenPreProgrammedDistributionsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo = (function() { - - /** - * Properties of a StartAtInfo. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @interface IStartAtInfo - * @property {number|Long|null} [startTimeMs] StartAtInfo startTimeMs - * @property {Uint8Array|null} [startRecipient] StartAtInfo startRecipient - * @property {boolean|null} [startRecipientIncluded] StartAtInfo startRecipientIncluded - */ - - /** - * Constructs a new StartAtInfo. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @classdesc Represents a StartAtInfo. - * @implements IStartAtInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set - */ - function StartAtInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtInfo startTimeMs. - * @member {number|Long} startTimeMs - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @instance - */ - StartAtInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StartAtInfo startRecipient. - * @member {Uint8Array} startRecipient - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @instance - */ - StartAtInfo.prototype.startRecipient = $util.newBuffer([]); - - /** - * StartAtInfo startRecipientIncluded. - * @member {boolean} startRecipientIncluded - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @instance - */ - StartAtInfo.prototype.startRecipientIncluded = false; - - /** - * Creates a new StartAtInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo instance - */ - StartAtInfo.create = function create(properties) { - return new StartAtInfo(properties); - }; - - /** - * Encodes the specified StartAtInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); - if (message.startRecipient != null && Object.hasOwnProperty.call(message, "startRecipient")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startRecipient); - if (message.startRecipientIncluded != null && Object.hasOwnProperty.call(message, "startRecipientIncluded")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.startRecipientIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTimeMs = reader.uint64(); - break; - case 2: - message.startRecipient = reader.bytes(); - break; - case 3: - message.startRecipientIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) - if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) - return "startTimeMs: integer|Long expected"; - if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) - if (!(message.startRecipient && typeof message.startRecipient.length === "number" || $util.isString(message.startRecipient))) - return "startRecipient: buffer expected"; - if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) - if (typeof message.startRecipientIncluded !== "boolean") - return "startRecipientIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo - */ - StartAtInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); - if (object.startTimeMs != null) - if ($util.Long) - (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; - else if (typeof object.startTimeMs === "string") - message.startTimeMs = parseInt(object.startTimeMs, 10); - else if (typeof object.startTimeMs === "number") - message.startTimeMs = object.startTimeMs; - else if (typeof object.startTimeMs === "object") - message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); - if (object.startRecipient != null) - if (typeof object.startRecipient === "string") - $util.base64.decode(object.startRecipient, message.startRecipient = $util.newBuffer($util.base64.length(object.startRecipient)), 0); - else if (object.startRecipient.length >= 0) - message.startRecipient = object.startRecipient; - if (object.startRecipientIncluded != null) - message.startRecipientIncluded = Boolean(object.startRecipientIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} message StartAtInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startTimeMs = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.startRecipient = ""; - else { - object.startRecipient = []; - if (options.bytes !== Array) - object.startRecipient = $util.newBuffer(object.startRecipient); - } - object.startRecipientIncluded = false; - } - if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) - if (typeof message.startTimeMs === "number") - object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; - else - object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; - if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) - object.startRecipient = options.bytes === String ? $util.base64.encode(message.startRecipient, 0, message.startRecipient.length) : options.bytes === Array ? Array.prototype.slice.call(message.startRecipient) : message.startRecipient; - if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) - object.startRecipientIncluded = message.startRecipientIncluded; - return object; - }; - - /** - * Converts this StartAtInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtInfo; - })(); - - return GetTokenPreProgrammedDistributionsRequestV0; - })(); - - return GetTokenPreProgrammedDistributionsRequest; - })(); - - v0.GetTokenPreProgrammedDistributionsResponse = (function() { - - /** - * Properties of a GetTokenPreProgrammedDistributionsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenPreProgrammedDistributionsResponse - * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null} [v0] GetTokenPreProgrammedDistributionsResponse v0 - */ - - /** - * Constructs a new GetTokenPreProgrammedDistributionsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenPreProgrammedDistributionsResponse. - * @implements IGetTokenPreProgrammedDistributionsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set - */ - function GetTokenPreProgrammedDistributionsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenPreProgrammedDistributionsResponse v0. - * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @instance - */ - GetTokenPreProgrammedDistributionsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenPreProgrammedDistributionsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @instance - */ - Object.defineProperty(GetTokenPreProgrammedDistributionsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenPreProgrammedDistributionsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse instance - */ - GetTokenPreProgrammedDistributionsResponse.create = function create(properties) { - return new GetTokenPreProgrammedDistributionsResponse(properties); - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenPreProgrammedDistributionsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenPreProgrammedDistributionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenPreProgrammedDistributionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse - */ - GetTokenPreProgrammedDistributionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenPreProgrammedDistributionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenPreProgrammedDistributionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenPreProgrammedDistributionsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @instance - * @returns {Object.} JSON object - */ - GetTokenPreProgrammedDistributionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 = (function() { - - /** - * Properties of a GetTokenPreProgrammedDistributionsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @interface IGetTokenPreProgrammedDistributionsResponseV0 - * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null} [tokenDistributions] GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenPreProgrammedDistributionsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenPreProgrammedDistributionsResponseV0 metadata - */ - - /** - * Constructs a new GetTokenPreProgrammedDistributionsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @classdesc Represents a GetTokenPreProgrammedDistributionsResponseV0. - * @implements IGetTokenPreProgrammedDistributionsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set - */ - function GetTokenPreProgrammedDistributionsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions. - * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null|undefined} tokenDistributions - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - */ - GetTokenPreProgrammedDistributionsResponseV0.prototype.tokenDistributions = null; - - /** - * GetTokenPreProgrammedDistributionsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - */ - GetTokenPreProgrammedDistributionsResponseV0.prototype.proof = null; - - /** - * GetTokenPreProgrammedDistributionsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - */ - GetTokenPreProgrammedDistributionsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenPreProgrammedDistributionsResponseV0 result. - * @member {"tokenDistributions"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - */ - Object.defineProperty(GetTokenPreProgrammedDistributionsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenDistributions", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenPreProgrammedDistributionsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 instance - */ - GetTokenPreProgrammedDistributionsResponseV0.create = function create(properties) { - return new GetTokenPreProgrammedDistributionsResponseV0(properties); - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenDistributions != null && Object.hasOwnProperty.call(message, "tokenDistributions")) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.encode(message.tokenDistributions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenPreProgrammedDistributionsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenPreProgrammedDistributionsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify(message.tokenDistributions); - if (error) - return "tokenDistributions." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTokenPreProgrammedDistributionsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 - */ - GetTokenPreProgrammedDistributionsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); - if (object.tokenDistributions != null) { - if (typeof object.tokenDistributions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.tokenDistributions: object expected"); - message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.fromObject(object.tokenDistributions); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenPreProgrammedDistributionsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenPreProgrammedDistributionsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { - object.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.toObject(message.tokenDistributions, options); - if (options.oneofs) - object.result = "tokenDistributions"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTokenPreProgrammedDistributionsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenPreProgrammedDistributionsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry = (function() { - - /** - * Properties of a TokenDistributionEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @interface ITokenDistributionEntry - * @property {Uint8Array|null} [recipientId] TokenDistributionEntry recipientId - * @property {number|Long|null} [amount] TokenDistributionEntry amount - */ - - /** - * Constructs a new TokenDistributionEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @classdesc Represents a TokenDistributionEntry. - * @implements ITokenDistributionEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set - */ - function TokenDistributionEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenDistributionEntry recipientId. - * @member {Uint8Array} recipientId - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @instance - */ - TokenDistributionEntry.prototype.recipientId = $util.newBuffer([]); - - /** - * TokenDistributionEntry amount. - * @member {number|Long} amount - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @instance - */ - TokenDistributionEntry.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new TokenDistributionEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry instance - */ - TokenDistributionEntry.create = function create(properties) { - return new TokenDistributionEntry(properties); - }; - - /** - * Encodes the specified TokenDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDistributionEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.recipientId); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); - return writer; - }; - - /** - * Encodes the specified TokenDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenDistributionEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDistributionEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.recipientId = reader.bytes(); - break; - case 2: - message.amount = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenDistributionEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDistributionEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenDistributionEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenDistributionEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recipientId != null && message.hasOwnProperty("recipientId")) - if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) - return "recipientId: buffer expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - return null; - }; - - /** - * Creates a TokenDistributionEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry - */ - TokenDistributionEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); - if (object.recipientId != null) - if (typeof object.recipientId === "string") - $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); - else if (object.recipientId.length >= 0) - message.recipientId = object.recipientId; - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TokenDistributionEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} message TokenDistributionEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenDistributionEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.recipientId = ""; - else { - object.recipientId = []; - if (options.bytes !== Array) - object.recipientId = $util.newBuffer(object.recipientId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - } - if (message.recipientId != null && message.hasOwnProperty("recipientId")) - object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - return object; - }; - - /** - * Converts this TokenDistributionEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @instance - * @returns {Object.} JSON object - */ - TokenDistributionEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenDistributionEntry; - })(); - - GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry = (function() { - - /** - * Properties of a TokenTimedDistributionEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @interface ITokenTimedDistributionEntry - * @property {number|Long|null} [timestamp] TokenTimedDistributionEntry timestamp - * @property {Array.|null} [distributions] TokenTimedDistributionEntry distributions - */ - - /** - * Constructs a new TokenTimedDistributionEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @classdesc Represents a TokenTimedDistributionEntry. - * @implements ITokenTimedDistributionEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set - */ - function TokenTimedDistributionEntry(properties) { - this.distributions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenTimedDistributionEntry timestamp. - * @member {number|Long} timestamp - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @instance - */ - TokenTimedDistributionEntry.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * TokenTimedDistributionEntry distributions. - * @member {Array.} distributions - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @instance - */ - TokenTimedDistributionEntry.prototype.distributions = $util.emptyArray; - - /** - * Creates a new TokenTimedDistributionEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry instance - */ - TokenTimedDistributionEntry.create = function create(properties) { - return new TokenTimedDistributionEntry(properties); - }; - - /** - * Encodes the specified TokenTimedDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenTimedDistributionEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); - if (message.distributions != null && message.distributions.length) - for (var i = 0; i < message.distributions.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.encode(message.distributions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenTimedDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenTimedDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenTimedDistributionEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.timestamp = reader.uint64(); - break; - case 2: - if (!(message.distributions && message.distributions.length)) - message.distributions = []; - message.distributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenTimedDistributionEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenTimedDistributionEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenTimedDistributionEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.distributions != null && message.hasOwnProperty("distributions")) { - if (!Array.isArray(message.distributions)) - return "distributions: array expected"; - for (var i = 0; i < message.distributions.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify(message.distributions[i]); - if (error) - return "distributions." + error; - } - } - return null; - }; - - /** - * Creates a TokenTimedDistributionEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry - */ - TokenTimedDistributionEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.distributions) { - if (!Array.isArray(object.distributions)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: array expected"); - message.distributions = []; - for (var i = 0; i < object.distributions.length; ++i) { - if (typeof object.distributions[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: object expected"); - message.distributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.fromObject(object.distributions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenTimedDistributionEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} message TokenTimedDistributionEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenTimedDistributionEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.distributions = []; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.distributions && message.distributions.length) { - object.distributions = []; - for (var j = 0; j < message.distributions.length; ++j) - object.distributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.toObject(message.distributions[j], options); - } - return object; - }; - - /** - * Converts this TokenTimedDistributionEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @instance - * @returns {Object.} JSON object - */ - TokenTimedDistributionEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenTimedDistributionEntry; - })(); - - GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions = (function() { - - /** - * Properties of a TokenDistributions. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @interface ITokenDistributions - * @property {Array.|null} [tokenDistributions] TokenDistributions tokenDistributions - */ - - /** - * Constructs a new TokenDistributions. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @classdesc Represents a TokenDistributions. - * @implements ITokenDistributions - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set - */ - function TokenDistributions(properties) { - this.tokenDistributions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenDistributions tokenDistributions. - * @member {Array.} tokenDistributions - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @instance - */ - TokenDistributions.prototype.tokenDistributions = $util.emptyArray; - - /** - * Creates a new TokenDistributions instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions instance - */ - TokenDistributions.create = function create(properties) { - return new TokenDistributions(properties); - }; - - /** - * Encodes the specified TokenDistributions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDistributions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenDistributions != null && message.tokenDistributions.length) - for (var i = 0; i < message.tokenDistributions.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.encode(message.tokenDistributions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenDistributions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDistributions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenDistributions message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDistributions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenDistributions && message.tokenDistributions.length)) - message.tokenDistributions = []; - message.tokenDistributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenDistributions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDistributions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenDistributions message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenDistributions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { - if (!Array.isArray(message.tokenDistributions)) - return "tokenDistributions: array expected"; - for (var i = 0; i < message.tokenDistributions.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify(message.tokenDistributions[i]); - if (error) - return "tokenDistributions." + error; - } - } - return null; - }; - - /** - * Creates a TokenDistributions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions - */ - TokenDistributions.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); - if (object.tokenDistributions) { - if (!Array.isArray(object.tokenDistributions)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: array expected"); - message.tokenDistributions = []; - for (var i = 0; i < object.tokenDistributions.length; ++i) { - if (typeof object.tokenDistributions[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: object expected"); - message.tokenDistributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.fromObject(object.tokenDistributions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenDistributions message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} message TokenDistributions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenDistributions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenDistributions = []; - if (message.tokenDistributions && message.tokenDistributions.length) { - object.tokenDistributions = []; - for (var j = 0; j < message.tokenDistributions.length; ++j) - object.tokenDistributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.toObject(message.tokenDistributions[j], options); - } - return object; - }; - - /** - * Converts this TokenDistributions to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @instance - * @returns {Object.} JSON object - */ - TokenDistributions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenDistributions; - })(); - - return GetTokenPreProgrammedDistributionsResponseV0; - })(); - - return GetTokenPreProgrammedDistributionsResponse; - })(); - - v0.GetTokenTotalSupplyRequest = (function() { - - /** - * Properties of a GetTokenTotalSupplyRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenTotalSupplyRequest - * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null} [v0] GetTokenTotalSupplyRequest v0 - */ - - /** - * Constructs a new GetTokenTotalSupplyRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenTotalSupplyRequest. - * @implements IGetTokenTotalSupplyRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set - */ - function GetTokenTotalSupplyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenTotalSupplyRequest v0. - * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @instance - */ - GetTokenTotalSupplyRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenTotalSupplyRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @instance - */ - Object.defineProperty(GetTokenTotalSupplyRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenTotalSupplyRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest instance - */ - GetTokenTotalSupplyRequest.create = function create(properties) { - return new GetTokenTotalSupplyRequest(properties); - }; - - /** - * Encodes the specified GetTokenTotalSupplyRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenTotalSupplyRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenTotalSupplyRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenTotalSupplyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenTotalSupplyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest - */ - GetTokenTotalSupplyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenTotalSupplyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenTotalSupplyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenTotalSupplyRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @instance - * @returns {Object.} JSON object - */ - GetTokenTotalSupplyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 = (function() { - - /** - * Properties of a GetTokenTotalSupplyRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @interface IGetTokenTotalSupplyRequestV0 - * @property {Uint8Array|null} [tokenId] GetTokenTotalSupplyRequestV0 tokenId - * @property {boolean|null} [prove] GetTokenTotalSupplyRequestV0 prove - */ - - /** - * Constructs a new GetTokenTotalSupplyRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @classdesc Represents a GetTokenTotalSupplyRequestV0. - * @implements IGetTokenTotalSupplyRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set - */ - function GetTokenTotalSupplyRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenTotalSupplyRequestV0 tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @instance - */ - GetTokenTotalSupplyRequestV0.prototype.tokenId = $util.newBuffer([]); - - /** - * GetTokenTotalSupplyRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @instance - */ - GetTokenTotalSupplyRequestV0.prototype.prove = false; - - /** - * Creates a new GetTokenTotalSupplyRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 instance - */ - GetTokenTotalSupplyRequestV0.create = function create(properties) { - return new GetTokenTotalSupplyRequestV0(properties); - }; - - /** - * Encodes the specified GetTokenTotalSupplyRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTokenTotalSupplyRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenTotalSupplyRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenTotalSupplyRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTokenTotalSupplyRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 - */ - GetTokenTotalSupplyRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTokenTotalSupplyRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenTotalSupplyRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.prove = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTokenTotalSupplyRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenTotalSupplyRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTokenTotalSupplyRequestV0; - })(); - - return GetTokenTotalSupplyRequest; - })(); - - v0.GetTokenTotalSupplyResponse = (function() { - - /** - * Properties of a GetTokenTotalSupplyResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenTotalSupplyResponse - * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null} [v0] GetTokenTotalSupplyResponse v0 - */ - - /** - * Constructs a new GetTokenTotalSupplyResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenTotalSupplyResponse. - * @implements IGetTokenTotalSupplyResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set - */ - function GetTokenTotalSupplyResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenTotalSupplyResponse v0. - * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @instance - */ - GetTokenTotalSupplyResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenTotalSupplyResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @instance - */ - Object.defineProperty(GetTokenTotalSupplyResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenTotalSupplyResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse instance - */ - GetTokenTotalSupplyResponse.create = function create(properties) { - return new GetTokenTotalSupplyResponse(properties); - }; - - /** - * Encodes the specified GetTokenTotalSupplyResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenTotalSupplyResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenTotalSupplyResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenTotalSupplyResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenTotalSupplyResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse - */ - GetTokenTotalSupplyResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenTotalSupplyResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenTotalSupplyResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenTotalSupplyResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @instance - * @returns {Object.} JSON object - */ - GetTokenTotalSupplyResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 = (function() { - - /** - * Properties of a GetTokenTotalSupplyResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @interface IGetTokenTotalSupplyResponseV0 - * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null} [tokenTotalSupply] GetTokenTotalSupplyResponseV0 tokenTotalSupply - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenTotalSupplyResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenTotalSupplyResponseV0 metadata - */ - - /** - * Constructs a new GetTokenTotalSupplyResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @classdesc Represents a GetTokenTotalSupplyResponseV0. - * @implements IGetTokenTotalSupplyResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set - */ - function GetTokenTotalSupplyResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenTotalSupplyResponseV0 tokenTotalSupply. - * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null|undefined} tokenTotalSupply - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - */ - GetTokenTotalSupplyResponseV0.prototype.tokenTotalSupply = null; - - /** - * GetTokenTotalSupplyResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - */ - GetTokenTotalSupplyResponseV0.prototype.proof = null; - - /** - * GetTokenTotalSupplyResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - */ - GetTokenTotalSupplyResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenTotalSupplyResponseV0 result. - * @member {"tokenTotalSupply"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - */ - Object.defineProperty(GetTokenTotalSupplyResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenTotalSupply", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenTotalSupplyResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 instance - */ - GetTokenTotalSupplyResponseV0.create = function create(properties) { - return new GetTokenTotalSupplyResponseV0(properties); - }; - - /** - * Encodes the specified GetTokenTotalSupplyResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenTotalSupply != null && Object.hasOwnProperty.call(message, "tokenTotalSupply")) - $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.encode(message.tokenTotalSupply, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenTotalSupplyResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenTotalSupplyResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenTotalSupplyResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify(message.tokenTotalSupply); - if (error) - return "tokenTotalSupply." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTokenTotalSupplyResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 - */ - GetTokenTotalSupplyResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); - if (object.tokenTotalSupply != null) { - if (typeof object.tokenTotalSupply !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.tokenTotalSupply: object expected"); - message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.fromObject(object.tokenTotalSupply); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenTotalSupplyResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenTotalSupplyResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { - object.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.toObject(message.tokenTotalSupply, options); - if (options.oneofs) - object.result = "tokenTotalSupply"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTokenTotalSupplyResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenTotalSupplyResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry = (function() { - - /** - * Properties of a TokenTotalSupplyEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @interface ITokenTotalSupplyEntry - * @property {Uint8Array|null} [tokenId] TokenTotalSupplyEntry tokenId - * @property {number|Long|null} [totalAggregatedAmountInUserAccounts] TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts - * @property {number|Long|null} [totalSystemAmount] TokenTotalSupplyEntry totalSystemAmount - */ - - /** - * Constructs a new TokenTotalSupplyEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @classdesc Represents a TokenTotalSupplyEntry. - * @implements ITokenTotalSupplyEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set - */ - function TokenTotalSupplyEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenTotalSupplyEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @instance - */ - TokenTotalSupplyEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts. - * @member {number|Long} totalAggregatedAmountInUserAccounts - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @instance - */ - TokenTotalSupplyEntry.prototype.totalAggregatedAmountInUserAccounts = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * TokenTotalSupplyEntry totalSystemAmount. - * @member {number|Long} totalSystemAmount - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @instance - */ - TokenTotalSupplyEntry.prototype.totalSystemAmount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new TokenTotalSupplyEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry instance - */ - TokenTotalSupplyEntry.create = function create(properties) { - return new TokenTotalSupplyEntry(properties); - }; - - /** - * Encodes the specified TokenTotalSupplyEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenTotalSupplyEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.totalAggregatedAmountInUserAccounts != null && Object.hasOwnProperty.call(message, "totalAggregatedAmountInUserAccounts")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.totalAggregatedAmountInUserAccounts); - if (message.totalSystemAmount != null && Object.hasOwnProperty.call(message, "totalSystemAmount")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.totalSystemAmount); - return writer; - }; - - /** - * Encodes the specified TokenTotalSupplyEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenTotalSupplyEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenTotalSupplyEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.totalAggregatedAmountInUserAccounts = reader.uint64(); - break; - case 3: - message.totalSystemAmount = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenTotalSupplyEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenTotalSupplyEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenTotalSupplyEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) - if (!$util.isInteger(message.totalAggregatedAmountInUserAccounts) && !(message.totalAggregatedAmountInUserAccounts && $util.isInteger(message.totalAggregatedAmountInUserAccounts.low) && $util.isInteger(message.totalAggregatedAmountInUserAccounts.high))) - return "totalAggregatedAmountInUserAccounts: integer|Long expected"; - if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) - if (!$util.isInteger(message.totalSystemAmount) && !(message.totalSystemAmount && $util.isInteger(message.totalSystemAmount.low) && $util.isInteger(message.totalSystemAmount.high))) - return "totalSystemAmount: integer|Long expected"; - return null; - }; - - /** - * Creates a TokenTotalSupplyEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry - */ - TokenTotalSupplyEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.totalAggregatedAmountInUserAccounts != null) - if ($util.Long) - (message.totalAggregatedAmountInUserAccounts = $util.Long.fromValue(object.totalAggregatedAmountInUserAccounts)).unsigned = true; - else if (typeof object.totalAggregatedAmountInUserAccounts === "string") - message.totalAggregatedAmountInUserAccounts = parseInt(object.totalAggregatedAmountInUserAccounts, 10); - else if (typeof object.totalAggregatedAmountInUserAccounts === "number") - message.totalAggregatedAmountInUserAccounts = object.totalAggregatedAmountInUserAccounts; - else if (typeof object.totalAggregatedAmountInUserAccounts === "object") - message.totalAggregatedAmountInUserAccounts = new $util.LongBits(object.totalAggregatedAmountInUserAccounts.low >>> 0, object.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true); - if (object.totalSystemAmount != null) - if ($util.Long) - (message.totalSystemAmount = $util.Long.fromValue(object.totalSystemAmount)).unsigned = true; - else if (typeof object.totalSystemAmount === "string") - message.totalSystemAmount = parseInt(object.totalSystemAmount, 10); - else if (typeof object.totalSystemAmount === "number") - message.totalSystemAmount = object.totalSystemAmount; - else if (typeof object.totalSystemAmount === "object") - message.totalSystemAmount = new $util.LongBits(object.totalSystemAmount.low >>> 0, object.totalSystemAmount.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TokenTotalSupplyEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} message TokenTotalSupplyEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenTotalSupplyEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.totalAggregatedAmountInUserAccounts = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalAggregatedAmountInUserAccounts = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.totalSystemAmount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalSystemAmount = options.longs === String ? "0" : 0; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) - if (typeof message.totalAggregatedAmountInUserAccounts === "number") - object.totalAggregatedAmountInUserAccounts = options.longs === String ? String(message.totalAggregatedAmountInUserAccounts) : message.totalAggregatedAmountInUserAccounts; - else - object.totalAggregatedAmountInUserAccounts = options.longs === String ? $util.Long.prototype.toString.call(message.totalAggregatedAmountInUserAccounts) : options.longs === Number ? new $util.LongBits(message.totalAggregatedAmountInUserAccounts.low >>> 0, message.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true) : message.totalAggregatedAmountInUserAccounts; - if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) - if (typeof message.totalSystemAmount === "number") - object.totalSystemAmount = options.longs === String ? String(message.totalSystemAmount) : message.totalSystemAmount; - else - object.totalSystemAmount = options.longs === String ? $util.Long.prototype.toString.call(message.totalSystemAmount) : options.longs === Number ? new $util.LongBits(message.totalSystemAmount.low >>> 0, message.totalSystemAmount.high >>> 0).toNumber(true) : message.totalSystemAmount; - return object; - }; - - /** - * Converts this TokenTotalSupplyEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @instance - * @returns {Object.} JSON object - */ - TokenTotalSupplyEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenTotalSupplyEntry; - })(); - - return GetTokenTotalSupplyResponseV0; - })(); - - return GetTokenTotalSupplyResponse; - })(); - - v0.GetGroupInfoRequest = (function() { - - /** - * Properties of a GetGroupInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupInfoRequest - * @property {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null} [v0] GetGroupInfoRequest v0 - */ - - /** - * Constructs a new GetGroupInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupInfoRequest. - * @implements IGetGroupInfoRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set - */ - function GetGroupInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfoRequest v0. - * @member {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @instance - */ - GetGroupInfoRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfoRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @instance - */ - Object.defineProperty(GetGroupInfoRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfoRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest instance - */ - GetGroupInfoRequest.create = function create(properties) { - return new GetGroupInfoRequest(properties); - }; - - /** - * Encodes the specified GetGroupInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfoRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest - */ - GetGroupInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest} message GetGroupInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupInfoRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfoRequest.GetGroupInfoRequestV0 = (function() { - - /** - * Properties of a GetGroupInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @interface IGetGroupInfoRequestV0 - * @property {Uint8Array|null} [contractId] GetGroupInfoRequestV0 contractId - * @property {number|null} [groupContractPosition] GetGroupInfoRequestV0 groupContractPosition - * @property {boolean|null} [prove] GetGroupInfoRequestV0 prove - */ - - /** - * Constructs a new GetGroupInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @classdesc Represents a GetGroupInfoRequestV0. - * @implements IGetGroupInfoRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set - */ - function GetGroupInfoRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfoRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @instance - */ - GetGroupInfoRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetGroupInfoRequestV0 groupContractPosition. - * @member {number} groupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @instance - */ - GetGroupInfoRequestV0.prototype.groupContractPosition = 0; - - /** - * GetGroupInfoRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @instance - */ - GetGroupInfoRequestV0.prototype.prove = false; - - /** - * Creates a new GetGroupInfoRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 instance - */ - GetGroupInfoRequestV0.create = function create(properties) { - return new GetGroupInfoRequestV0(properties); - }; - - /** - * Encodes the specified GetGroupInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetGroupInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.groupContractPosition = reader.uint32(); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfoRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfoRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - if (!$util.isInteger(message.groupContractPosition)) - return "groupContractPosition: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetGroupInfoRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 - */ - GetGroupInfoRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.groupContractPosition != null) - message.groupContractPosition = object.groupContractPosition >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetGroupInfoRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} message GetGroupInfoRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfoRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.groupContractPosition = 0; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - object.groupContractPosition = message.groupContractPosition; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetGroupInfoRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfoRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetGroupInfoRequestV0; - })(); - - return GetGroupInfoRequest; - })(); - - v0.GetGroupInfoResponse = (function() { - - /** - * Properties of a GetGroupInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupInfoResponse - * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null} [v0] GetGroupInfoResponse v0 - */ - - /** - * Constructs a new GetGroupInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupInfoResponse. - * @implements IGetGroupInfoResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set - */ - function GetGroupInfoResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfoResponse v0. - * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @instance - */ - GetGroupInfoResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfoResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @instance - */ - Object.defineProperty(GetGroupInfoResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfoResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse instance - */ - GetGroupInfoResponse.create = function create(properties) { - return new GetGroupInfoResponse(properties); - }; - - /** - * Encodes the specified GetGroupInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfoResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfoResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfoResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfoResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupInfoResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse - */ - GetGroupInfoResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfoResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} message GetGroupInfoResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfoResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupInfoResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfoResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfoResponse.GetGroupInfoResponseV0 = (function() { - - /** - * Properties of a GetGroupInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @interface IGetGroupInfoResponseV0 - * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null} [groupInfo] GetGroupInfoResponseV0 groupInfo - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfoResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfoResponseV0 metadata - */ - - /** - * Constructs a new GetGroupInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @classdesc Represents a GetGroupInfoResponseV0. - * @implements IGetGroupInfoResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set - */ - function GetGroupInfoResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfoResponseV0 groupInfo. - * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null|undefined} groupInfo - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - */ - GetGroupInfoResponseV0.prototype.groupInfo = null; - - /** - * GetGroupInfoResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - */ - GetGroupInfoResponseV0.prototype.proof = null; - - /** - * GetGroupInfoResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - */ - GetGroupInfoResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfoResponseV0 result. - * @member {"groupInfo"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - */ - Object.defineProperty(GetGroupInfoResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["groupInfo", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfoResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 instance - */ - GetGroupInfoResponseV0.create = function create(properties) { - return new GetGroupInfoResponseV0(properties); - }; - - /** - * Encodes the specified GetGroupInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) - $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 4: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfoResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfoResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify(message.groupInfo); - if (error) - return "groupInfo." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetGroupInfoResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 - */ - GetGroupInfoResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); - if (object.groupInfo != null) { - if (typeof object.groupInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.groupInfo: object expected"); - message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.fromObject(object.groupInfo); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfoResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} message GetGroupInfoResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfoResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { - object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.toObject(message.groupInfo, options); - if (options.oneofs) - object.result = "groupInfo"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetGroupInfoResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfoResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfoResponseV0.GroupMemberEntry = (function() { - - /** - * Properties of a GroupMemberEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @interface IGroupMemberEntry - * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId - * @property {number|null} [power] GroupMemberEntry power - */ - - /** - * Constructs a new GroupMemberEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @classdesc Represents a GroupMemberEntry. - * @implements IGroupMemberEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set - */ - function GroupMemberEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupMemberEntry memberId. - * @member {Uint8Array} memberId - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @instance - */ - GroupMemberEntry.prototype.memberId = $util.newBuffer([]); - - /** - * GroupMemberEntry power. - * @member {number} power - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @instance - */ - GroupMemberEntry.prototype.power = 0; - - /** - * Creates a new GroupMemberEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry instance - */ - GroupMemberEntry.create = function create(properties) { - return new GroupMemberEntry(properties); - }; - - /** - * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMemberEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); - if (message.power != null && Object.hasOwnProperty.call(message, "power")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); - return writer; - }; - - /** - * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupMemberEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMemberEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.memberId = reader.bytes(); - break; - case 2: - message.power = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupMemberEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupMemberEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.memberId != null && message.hasOwnProperty("memberId")) - if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) - return "memberId: buffer expected"; - if (message.power != null && message.hasOwnProperty("power")) - if (!$util.isInteger(message.power)) - return "power: integer expected"; - return null; - }; - - /** - * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry - */ - GroupMemberEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); - if (object.memberId != null) - if (typeof object.memberId === "string") - $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); - else if (object.memberId.length >= 0) - message.memberId = object.memberId; - if (object.power != null) - message.power = object.power >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} message GroupMemberEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupMemberEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.memberId = ""; - else { - object.memberId = []; - if (options.bytes !== Array) - object.memberId = $util.newBuffer(object.memberId); - } - object.power = 0; - } - if (message.memberId != null && message.hasOwnProperty("memberId")) - object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; - if (message.power != null && message.hasOwnProperty("power")) - object.power = message.power; - return object; - }; - - /** - * Converts this GroupMemberEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @instance - * @returns {Object.} JSON object - */ - GroupMemberEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupMemberEntry; - })(); - - GetGroupInfoResponseV0.GroupInfoEntry = (function() { - - /** - * Properties of a GroupInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @interface IGroupInfoEntry - * @property {Array.|null} [members] GroupInfoEntry members - * @property {number|null} [groupRequiredPower] GroupInfoEntry groupRequiredPower - */ - - /** - * Constructs a new GroupInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @classdesc Represents a GroupInfoEntry. - * @implements IGroupInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set - */ - function GroupInfoEntry(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupInfoEntry members. - * @member {Array.} members - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @instance - */ - GroupInfoEntry.prototype.members = $util.emptyArray; - - /** - * GroupInfoEntry groupRequiredPower. - * @member {number} groupRequiredPower - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @instance - */ - GroupInfoEntry.prototype.groupRequiredPower = 0; - - /** - * Creates a new GroupInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry instance - */ - GroupInfoEntry.create = function create(properties) { - return new GroupInfoEntry(properties); - }; - - /** - * Encodes the specified GroupInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupRequiredPower); - return writer; - }; - - /** - * Encodes the specified GroupInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); - break; - case 2: - message.groupRequiredPower = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify(message.members[i]); - if (error) - return "members." + error; - } - } - if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) - if (!$util.isInteger(message.groupRequiredPower)) - return "groupRequiredPower: integer expected"; - return null; - }; - - /** - * Creates a GroupInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry - */ - GroupInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) { - if (typeof object.members[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: object expected"); - message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.fromObject(object.members[i]); - } - } - if (object.groupRequiredPower != null) - message.groupRequiredPower = object.groupRequiredPower >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} message GroupInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) - object.groupRequiredPower = 0; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.toObject(message.members[j], options); - } - if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) - object.groupRequiredPower = message.groupRequiredPower; - return object; - }; - - /** - * Converts this GroupInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @instance - * @returns {Object.} JSON object - */ - GroupInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupInfoEntry; - })(); - - GetGroupInfoResponseV0.GroupInfo = (function() { - - /** - * Properties of a GroupInfo. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @interface IGroupInfo - * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null} [groupInfo] GroupInfo groupInfo - */ - - /** - * Constructs a new GroupInfo. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @classdesc Represents a GroupInfo. - * @implements IGroupInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set - */ - function GroupInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupInfo groupInfo. - * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null|undefined} groupInfo - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @instance - */ - GroupInfo.prototype.groupInfo = null; - - /** - * Creates a new GroupInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo instance - */ - GroupInfo.create = function create(properties) { - return new GroupInfo(properties); - }; - - /** - * Encodes the specified GroupInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) - $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify(message.groupInfo); - if (error) - return "groupInfo." + error; - } - return null; - }; - - /** - * Creates a GroupInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo - */ - GroupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); - if (object.groupInfo != null) { - if (typeof object.groupInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.groupInfo: object expected"); - message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.fromObject(object.groupInfo); - } - return message; - }; - - /** - * Creates a plain object from a GroupInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} message GroupInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.groupInfo = null; - if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) - object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.toObject(message.groupInfo, options); - return object; - }; - - /** - * Converts this GroupInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @instance - * @returns {Object.} JSON object - */ - GroupInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupInfo; - })(); - - return GetGroupInfoResponseV0; - })(); - - return GetGroupInfoResponse; - })(); - - v0.GetGroupInfosRequest = (function() { - - /** - * Properties of a GetGroupInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupInfosRequest - * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null} [v0] GetGroupInfosRequest v0 - */ - - /** - * Constructs a new GetGroupInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupInfosRequest. - * @implements IGetGroupInfosRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set - */ - function GetGroupInfosRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfosRequest v0. - * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @instance - */ - GetGroupInfosRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfosRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @instance - */ - Object.defineProperty(GetGroupInfosRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfosRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest instance - */ - GetGroupInfosRequest.create = function create(properties) { - return new GetGroupInfosRequest(properties); - }; - - /** - * Encodes the specified GetGroupInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfosRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfosRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfosRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfosRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupInfosRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest - */ - GetGroupInfosRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfosRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest} message GetGroupInfosRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfosRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupInfosRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfosRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfosRequest.StartAtGroupContractPosition = (function() { - - /** - * Properties of a StartAtGroupContractPosition. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @interface IStartAtGroupContractPosition - * @property {number|null} [startGroupContractPosition] StartAtGroupContractPosition startGroupContractPosition - * @property {boolean|null} [startGroupContractPositionIncluded] StartAtGroupContractPosition startGroupContractPositionIncluded - */ - - /** - * Constructs a new StartAtGroupContractPosition. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @classdesc Represents a StartAtGroupContractPosition. - * @implements IStartAtGroupContractPosition - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set - */ - function StartAtGroupContractPosition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtGroupContractPosition startGroupContractPosition. - * @member {number} startGroupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @instance - */ - StartAtGroupContractPosition.prototype.startGroupContractPosition = 0; - - /** - * StartAtGroupContractPosition startGroupContractPositionIncluded. - * @member {boolean} startGroupContractPositionIncluded - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @instance - */ - StartAtGroupContractPosition.prototype.startGroupContractPositionIncluded = false; - - /** - * Creates a new StartAtGroupContractPosition instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition instance - */ - StartAtGroupContractPosition.create = function create(properties) { - return new StartAtGroupContractPosition(properties); - }; - - /** - * Encodes the specified StartAtGroupContractPosition message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtGroupContractPosition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startGroupContractPosition != null && Object.hasOwnProperty.call(message, "startGroupContractPosition")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.startGroupContractPosition); - if (message.startGroupContractPositionIncluded != null && Object.hasOwnProperty.call(message, "startGroupContractPositionIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startGroupContractPositionIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtGroupContractPosition message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtGroupContractPosition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtGroupContractPosition message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtGroupContractPosition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startGroupContractPosition = reader.uint32(); - break; - case 2: - message.startGroupContractPositionIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtGroupContractPosition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtGroupContractPosition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtGroupContractPosition message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtGroupContractPosition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) - if (!$util.isInteger(message.startGroupContractPosition)) - return "startGroupContractPosition: integer expected"; - if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) - if (typeof message.startGroupContractPositionIncluded !== "boolean") - return "startGroupContractPositionIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtGroupContractPosition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition - */ - StartAtGroupContractPosition.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); - if (object.startGroupContractPosition != null) - message.startGroupContractPosition = object.startGroupContractPosition >>> 0; - if (object.startGroupContractPositionIncluded != null) - message.startGroupContractPositionIncluded = Boolean(object.startGroupContractPositionIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtGroupContractPosition message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} message StartAtGroupContractPosition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtGroupContractPosition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startGroupContractPosition = 0; - object.startGroupContractPositionIncluded = false; - } - if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) - object.startGroupContractPosition = message.startGroupContractPosition; - if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) - object.startGroupContractPositionIncluded = message.startGroupContractPositionIncluded; - return object; - }; - - /** - * Converts this StartAtGroupContractPosition to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @instance - * @returns {Object.} JSON object - */ - StartAtGroupContractPosition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtGroupContractPosition; - })(); - - GetGroupInfosRequest.GetGroupInfosRequestV0 = (function() { - - /** - * Properties of a GetGroupInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @interface IGetGroupInfosRequestV0 - * @property {Uint8Array|null} [contractId] GetGroupInfosRequestV0 contractId - * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null} [startAtGroupContractPosition] GetGroupInfosRequestV0 startAtGroupContractPosition - * @property {number|null} [count] GetGroupInfosRequestV0 count - * @property {boolean|null} [prove] GetGroupInfosRequestV0 prove - */ - - /** - * Constructs a new GetGroupInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @classdesc Represents a GetGroupInfosRequestV0. - * @implements IGetGroupInfosRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set - */ - function GetGroupInfosRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfosRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - */ - GetGroupInfosRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetGroupInfosRequestV0 startAtGroupContractPosition. - * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null|undefined} startAtGroupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - */ - GetGroupInfosRequestV0.prototype.startAtGroupContractPosition = null; - - /** - * GetGroupInfosRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - */ - GetGroupInfosRequestV0.prototype.count = 0; - - /** - * GetGroupInfosRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - */ - GetGroupInfosRequestV0.prototype.prove = false; - - /** - * Creates a new GetGroupInfosRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 instance - */ - GetGroupInfosRequestV0.create = function create(properties) { - return new GetGroupInfosRequestV0(properties); - }; - - /** - * Encodes the specified GetGroupInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.startAtGroupContractPosition != null && Object.hasOwnProperty.call(message, "startAtGroupContractPosition")) - $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.encode(message.startAtGroupContractPosition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.count); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetGroupInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.decode(reader, reader.uint32()); - break; - case 3: - message.count = reader.uint32(); - break; - case 4: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfosRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfosRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify(message.startAtGroupContractPosition); - if (error) - return "startAtGroupContractPosition." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetGroupInfosRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 - */ - GetGroupInfosRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.startAtGroupContractPosition != null) { - if (typeof object.startAtGroupContractPosition !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.startAtGroupContractPosition: object expected"); - message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.fromObject(object.startAtGroupContractPosition); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetGroupInfosRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} message GetGroupInfosRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfosRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.startAtGroupContractPosition = null; - object.count = 0; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) - object.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.toObject(message.startAtGroupContractPosition, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetGroupInfosRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfosRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetGroupInfosRequestV0; - })(); - - return GetGroupInfosRequest; - })(); - - v0.GetGroupInfosResponse = (function() { - - /** - * Properties of a GetGroupInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupInfosResponse - * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null} [v0] GetGroupInfosResponse v0 - */ - - /** - * Constructs a new GetGroupInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupInfosResponse. - * @implements IGetGroupInfosResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set - */ - function GetGroupInfosResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfosResponse v0. - * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @instance - */ - GetGroupInfosResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfosResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @instance - */ - Object.defineProperty(GetGroupInfosResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfosResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse instance - */ - GetGroupInfosResponse.create = function create(properties) { - return new GetGroupInfosResponse(properties); - }; - - /** - * Encodes the specified GetGroupInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfosResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfosResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfosResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfosResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupInfosResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse - */ - GetGroupInfosResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfosResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} message GetGroupInfosResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfosResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupInfosResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfosResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfosResponse.GetGroupInfosResponseV0 = (function() { - - /** - * Properties of a GetGroupInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @interface IGetGroupInfosResponseV0 - * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null} [groupInfos] GetGroupInfosResponseV0 groupInfos - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfosResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfosResponseV0 metadata - */ - - /** - * Constructs a new GetGroupInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @classdesc Represents a GetGroupInfosResponseV0. - * @implements IGetGroupInfosResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set - */ - function GetGroupInfosResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfosResponseV0 groupInfos. - * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null|undefined} groupInfos - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - */ - GetGroupInfosResponseV0.prototype.groupInfos = null; - - /** - * GetGroupInfosResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - */ - GetGroupInfosResponseV0.prototype.proof = null; - - /** - * GetGroupInfosResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - */ - GetGroupInfosResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfosResponseV0 result. - * @member {"groupInfos"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - */ - Object.defineProperty(GetGroupInfosResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["groupInfos", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfosResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 instance - */ - GetGroupInfosResponseV0.create = function create(properties) { - return new GetGroupInfosResponseV0(properties); - }; - - /** - * Encodes the specified GetGroupInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupInfos != null && Object.hasOwnProperty.call(message, "groupInfos")) - $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.encode(message.groupInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 4: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfosResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfosResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify(message.groupInfos); - if (error) - return "groupInfos." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetGroupInfosResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 - */ - GetGroupInfosResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); - if (object.groupInfos != null) { - if (typeof object.groupInfos !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.groupInfos: object expected"); - message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.fromObject(object.groupInfos); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfosResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} message GetGroupInfosResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfosResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { - object.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.toObject(message.groupInfos, options); - if (options.oneofs) - object.result = "groupInfos"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetGroupInfosResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfosResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfosResponseV0.GroupMemberEntry = (function() { - - /** - * Properties of a GroupMemberEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @interface IGroupMemberEntry - * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId - * @property {number|null} [power] GroupMemberEntry power - */ - - /** - * Constructs a new GroupMemberEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @classdesc Represents a GroupMemberEntry. - * @implements IGroupMemberEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set - */ - function GroupMemberEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupMemberEntry memberId. - * @member {Uint8Array} memberId - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @instance - */ - GroupMemberEntry.prototype.memberId = $util.newBuffer([]); - - /** - * GroupMemberEntry power. - * @member {number} power - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @instance - */ - GroupMemberEntry.prototype.power = 0; - - /** - * Creates a new GroupMemberEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry instance - */ - GroupMemberEntry.create = function create(properties) { - return new GroupMemberEntry(properties); - }; - - /** - * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMemberEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); - if (message.power != null && Object.hasOwnProperty.call(message, "power")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); - return writer; - }; - - /** - * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupMemberEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMemberEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.memberId = reader.bytes(); - break; - case 2: - message.power = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupMemberEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupMemberEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.memberId != null && message.hasOwnProperty("memberId")) - if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) - return "memberId: buffer expected"; - if (message.power != null && message.hasOwnProperty("power")) - if (!$util.isInteger(message.power)) - return "power: integer expected"; - return null; - }; - - /** - * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry - */ - GroupMemberEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); - if (object.memberId != null) - if (typeof object.memberId === "string") - $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); - else if (object.memberId.length >= 0) - message.memberId = object.memberId; - if (object.power != null) - message.power = object.power >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} message GroupMemberEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupMemberEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.memberId = ""; - else { - object.memberId = []; - if (options.bytes !== Array) - object.memberId = $util.newBuffer(object.memberId); - } - object.power = 0; - } - if (message.memberId != null && message.hasOwnProperty("memberId")) - object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; - if (message.power != null && message.hasOwnProperty("power")) - object.power = message.power; - return object; - }; - - /** - * Converts this GroupMemberEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @instance - * @returns {Object.} JSON object - */ - GroupMemberEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupMemberEntry; - })(); - - GetGroupInfosResponseV0.GroupPositionInfoEntry = (function() { - - /** - * Properties of a GroupPositionInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @interface IGroupPositionInfoEntry - * @property {number|null} [groupContractPosition] GroupPositionInfoEntry groupContractPosition - * @property {Array.|null} [members] GroupPositionInfoEntry members - * @property {number|null} [groupRequiredPower] GroupPositionInfoEntry groupRequiredPower - */ - - /** - * Constructs a new GroupPositionInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @classdesc Represents a GroupPositionInfoEntry. - * @implements IGroupPositionInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set - */ - function GroupPositionInfoEntry(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupPositionInfoEntry groupContractPosition. - * @member {number} groupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @instance - */ - GroupPositionInfoEntry.prototype.groupContractPosition = 0; - - /** - * GroupPositionInfoEntry members. - * @member {Array.} members - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @instance - */ - GroupPositionInfoEntry.prototype.members = $util.emptyArray; - - /** - * GroupPositionInfoEntry groupRequiredPower. - * @member {number} groupRequiredPower - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @instance - */ - GroupPositionInfoEntry.prototype.groupRequiredPower = 0; - - /** - * Creates a new GroupPositionInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry instance - */ - GroupPositionInfoEntry.create = function create(properties) { - return new GroupPositionInfoEntry(properties); - }; - - /** - * Encodes the specified GroupPositionInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupPositionInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.groupContractPosition); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.groupRequiredPower); - return writer; - }; - - /** - * Encodes the specified GroupPositionInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupPositionInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupPositionInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupPositionInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupContractPosition = reader.uint32(); - break; - case 2: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); - break; - case 3: - message.groupRequiredPower = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupPositionInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupPositionInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupPositionInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupPositionInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - if (!$util.isInteger(message.groupContractPosition)) - return "groupContractPosition: integer expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify(message.members[i]); - if (error) - return "members." + error; - } - } - if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) - if (!$util.isInteger(message.groupRequiredPower)) - return "groupRequiredPower: integer expected"; - return null; - }; - - /** - * Creates a GroupPositionInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry - */ - GroupPositionInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); - if (object.groupContractPosition != null) - message.groupContractPosition = object.groupContractPosition >>> 0; - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) { - if (typeof object.members[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: object expected"); - message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.fromObject(object.members[i]); - } - } - if (object.groupRequiredPower != null) - message.groupRequiredPower = object.groupRequiredPower >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupPositionInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} message GroupPositionInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupPositionInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.groupContractPosition = 0; - object.groupRequiredPower = 0; - } - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - object.groupContractPosition = message.groupContractPosition; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.toObject(message.members[j], options); - } - if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) - object.groupRequiredPower = message.groupRequiredPower; - return object; - }; - - /** - * Converts this GroupPositionInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @instance - * @returns {Object.} JSON object - */ - GroupPositionInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupPositionInfoEntry; - })(); - - GetGroupInfosResponseV0.GroupInfos = (function() { - - /** - * Properties of a GroupInfos. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @interface IGroupInfos - * @property {Array.|null} [groupInfos] GroupInfos groupInfos - */ - - /** - * Constructs a new GroupInfos. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @classdesc Represents a GroupInfos. - * @implements IGroupInfos - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set - */ - function GroupInfos(properties) { - this.groupInfos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupInfos groupInfos. - * @member {Array.} groupInfos - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @instance - */ - GroupInfos.prototype.groupInfos = $util.emptyArray; - - /** - * Creates a new GroupInfos instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos instance - */ - GroupInfos.create = function create(properties) { - return new GroupInfos(properties); - }; - - /** - * Encodes the specified GroupInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfos.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupInfos != null && message.groupInfos.length) - for (var i = 0; i < message.groupInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.encode(message.groupInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfos.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupInfos message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfos.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.groupInfos && message.groupInfos.length)) - message.groupInfos = []; - message.groupInfos.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupInfos message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfos.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupInfos message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupInfos.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { - if (!Array.isArray(message.groupInfos)) - return "groupInfos: array expected"; - for (var i = 0; i < message.groupInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify(message.groupInfos[i]); - if (error) - return "groupInfos." + error; - } - } - return null; - }; - - /** - * Creates a GroupInfos message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos - */ - GroupInfos.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); - if (object.groupInfos) { - if (!Array.isArray(object.groupInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: array expected"); - message.groupInfos = []; - for (var i = 0; i < object.groupInfos.length; ++i) { - if (typeof object.groupInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: object expected"); - message.groupInfos[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.fromObject(object.groupInfos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GroupInfos message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} message GroupInfos - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupInfos.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupInfos = []; - if (message.groupInfos && message.groupInfos.length) { - object.groupInfos = []; - for (var j = 0; j < message.groupInfos.length; ++j) - object.groupInfos[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.toObject(message.groupInfos[j], options); - } - return object; - }; - - /** - * Converts this GroupInfos to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @instance - * @returns {Object.} JSON object - */ - GroupInfos.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupInfos; - })(); - - return GetGroupInfosResponseV0; - })(); - - return GetGroupInfosResponse; - })(); - - v0.GetGroupActionsRequest = (function() { - - /** - * Properties of a GetGroupActionsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupActionsRequest - * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null} [v0] GetGroupActionsRequest v0 - */ - - /** - * Constructs a new GetGroupActionsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupActionsRequest. - * @implements IGetGroupActionsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set - */ - function GetGroupActionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionsRequest v0. - * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @instance - */ - GetGroupActionsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @instance - */ - Object.defineProperty(GetGroupActionsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest instance - */ - GetGroupActionsRequest.create = function create(properties) { - return new GetGroupActionsRequest(properties); - }; - - /** - * Encodes the specified GetGroupActionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupActionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest - */ - GetGroupActionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest} message GetGroupActionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupActionsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * ActionStatus enum. - * @name org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus - * @enum {number} - * @property {number} ACTIVE=0 ACTIVE value - * @property {number} CLOSED=1 CLOSED value - */ - GetGroupActionsRequest.ActionStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTIVE"] = 0; - values[valuesById[1] = "CLOSED"] = 1; - return values; - })(); - - GetGroupActionsRequest.StartAtActionId = (function() { - - /** - * Properties of a StartAtActionId. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @interface IStartAtActionId - * @property {Uint8Array|null} [startActionId] StartAtActionId startActionId - * @property {boolean|null} [startActionIdIncluded] StartAtActionId startActionIdIncluded - */ - - /** - * Constructs a new StartAtActionId. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @classdesc Represents a StartAtActionId. - * @implements IStartAtActionId - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set - */ - function StartAtActionId(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtActionId startActionId. - * @member {Uint8Array} startActionId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @instance - */ - StartAtActionId.prototype.startActionId = $util.newBuffer([]); - - /** - * StartAtActionId startActionIdIncluded. - * @member {boolean} startActionIdIncluded - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @instance - */ - StartAtActionId.prototype.startActionIdIncluded = false; - - /** - * Creates a new StartAtActionId instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId instance - */ - StartAtActionId.create = function create(properties) { - return new StartAtActionId(properties); - }; - - /** - * Encodes the specified StartAtActionId message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtActionId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startActionId != null && Object.hasOwnProperty.call(message, "startActionId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startActionId); - if (message.startActionIdIncluded != null && Object.hasOwnProperty.call(message, "startActionIdIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startActionIdIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtActionId message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtActionId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtActionId message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtActionId.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startActionId = reader.bytes(); - break; - case 2: - message.startActionIdIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtActionId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtActionId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtActionId message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtActionId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startActionId != null && message.hasOwnProperty("startActionId")) - if (!(message.startActionId && typeof message.startActionId.length === "number" || $util.isString(message.startActionId))) - return "startActionId: buffer expected"; - if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) - if (typeof message.startActionIdIncluded !== "boolean") - return "startActionIdIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtActionId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId - */ - StartAtActionId.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); - if (object.startActionId != null) - if (typeof object.startActionId === "string") - $util.base64.decode(object.startActionId, message.startActionId = $util.newBuffer($util.base64.length(object.startActionId)), 0); - else if (object.startActionId.length >= 0) - message.startActionId = object.startActionId; - if (object.startActionIdIncluded != null) - message.startActionIdIncluded = Boolean(object.startActionIdIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtActionId message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} message StartAtActionId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtActionId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startActionId = ""; - else { - object.startActionId = []; - if (options.bytes !== Array) - object.startActionId = $util.newBuffer(object.startActionId); - } - object.startActionIdIncluded = false; - } - if (message.startActionId != null && message.hasOwnProperty("startActionId")) - object.startActionId = options.bytes === String ? $util.base64.encode(message.startActionId, 0, message.startActionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.startActionId) : message.startActionId; - if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) - object.startActionIdIncluded = message.startActionIdIncluded; - return object; - }; - - /** - * Converts this StartAtActionId to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @instance - * @returns {Object.} JSON object - */ - StartAtActionId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtActionId; - })(); - - GetGroupActionsRequest.GetGroupActionsRequestV0 = (function() { - - /** - * Properties of a GetGroupActionsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @interface IGetGroupActionsRequestV0 - * @property {Uint8Array|null} [contractId] GetGroupActionsRequestV0 contractId - * @property {number|null} [groupContractPosition] GetGroupActionsRequestV0 groupContractPosition - * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus|null} [status] GetGroupActionsRequestV0 status - * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null} [startAtActionId] GetGroupActionsRequestV0 startAtActionId - * @property {number|null} [count] GetGroupActionsRequestV0 count - * @property {boolean|null} [prove] GetGroupActionsRequestV0 prove - */ - - /** - * Constructs a new GetGroupActionsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @classdesc Represents a GetGroupActionsRequestV0. - * @implements IGetGroupActionsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set - */ - function GetGroupActionsRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionsRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetGroupActionsRequestV0 groupContractPosition. - * @member {number} groupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.groupContractPosition = 0; - - /** - * GetGroupActionsRequestV0 status. - * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus} status - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.status = 0; - - /** - * GetGroupActionsRequestV0 startAtActionId. - * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null|undefined} startAtActionId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.startAtActionId = null; - - /** - * GetGroupActionsRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.count = 0; - - /** - * GetGroupActionsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.prove = false; - - /** - * Creates a new GetGroupActionsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 instance - */ - GetGroupActionsRequestV0.create = function create(properties) { - return new GetGroupActionsRequestV0(properties); - }; - - /** - * Encodes the specified GetGroupActionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.startAtActionId != null && Object.hasOwnProperty.call(message, "startAtActionId")) - $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.encode(message.startAtActionId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.count); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetGroupActionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.groupContractPosition = reader.uint32(); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.decode(reader, reader.uint32()); - break; - case 5: - message.count = reader.uint32(); - break; - case 6: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - if (!$util.isInteger(message.groupContractPosition)) - return "groupContractPosition: integer expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - break; - } - if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify(message.startAtActionId); - if (error) - return "startAtActionId." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetGroupActionsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 - */ - GetGroupActionsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.groupContractPosition != null) - message.groupContractPosition = object.groupContractPosition >>> 0; - switch (object.status) { - case "ACTIVE": - case 0: - message.status = 0; - break; - case "CLOSED": - case 1: - message.status = 1; - break; - } - if (object.startAtActionId != null) { - if (typeof object.startAtActionId !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.startAtActionId: object expected"); - message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.fromObject(object.startAtActionId); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetGroupActionsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} message GetGroupActionsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.groupContractPosition = 0; - object.status = options.enums === String ? "ACTIVE" : 0; - object.startAtActionId = null; - object.count = 0; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - object.groupContractPosition = message.groupContractPosition; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus[message.status] : message.status; - if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) - object.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.toObject(message.startAtActionId, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetGroupActionsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetGroupActionsRequestV0; - })(); - - return GetGroupActionsRequest; - })(); - - v0.GetGroupActionsResponse = (function() { - - /** - * Properties of a GetGroupActionsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupActionsResponse - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null} [v0] GetGroupActionsResponse v0 - */ - - /** - * Constructs a new GetGroupActionsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupActionsResponse. - * @implements IGetGroupActionsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set - */ - function GetGroupActionsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionsResponse v0. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @instance - */ - GetGroupActionsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @instance - */ - Object.defineProperty(GetGroupActionsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse instance - */ - GetGroupActionsResponse.create = function create(properties) { - return new GetGroupActionsResponse(properties); - }; - - /** - * Encodes the specified GetGroupActionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupActionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse - */ - GetGroupActionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} message GetGroupActionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupActionsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupActionsResponse.GetGroupActionsResponseV0 = (function() { - - /** - * Properties of a GetGroupActionsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @interface IGetGroupActionsResponseV0 - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null} [groupActions] GetGroupActionsResponseV0 groupActions - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionsResponseV0 metadata - */ - - /** - * Constructs a new GetGroupActionsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @classdesc Represents a GetGroupActionsResponseV0. - * @implements IGetGroupActionsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set - */ - function GetGroupActionsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionsResponseV0 groupActions. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null|undefined} groupActions - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - */ - GetGroupActionsResponseV0.prototype.groupActions = null; - - /** - * GetGroupActionsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - */ - GetGroupActionsResponseV0.prototype.proof = null; - - /** - * GetGroupActionsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - */ - GetGroupActionsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionsResponseV0 result. - * @member {"groupActions"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - */ - Object.defineProperty(GetGroupActionsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["groupActions", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 instance - */ - GetGroupActionsResponseV0.create = function create(properties) { - return new GetGroupActionsResponseV0(properties); - }; - - /** - * Encodes the specified GetGroupActionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupActions != null && Object.hasOwnProperty.call(message, "groupActions")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.encode(message.groupActions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.groupActions != null && message.hasOwnProperty("groupActions")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify(message.groupActions); - if (error) - return "groupActions." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetGroupActionsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 - */ - GetGroupActionsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); - if (object.groupActions != null) { - if (typeof object.groupActions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.groupActions: object expected"); - message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.fromObject(object.groupActions); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} message GetGroupActionsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.groupActions != null && message.hasOwnProperty("groupActions")) { - object.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.toObject(message.groupActions, options); - if (options.oneofs) - object.result = "groupActions"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetGroupActionsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupActionsResponseV0.MintEvent = (function() { - - /** - * Properties of a MintEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IMintEvent - * @property {number|Long|null} [amount] MintEvent amount - * @property {Uint8Array|null} [recipientId] MintEvent recipientId - * @property {string|null} [publicNote] MintEvent publicNote - */ - - /** - * Constructs a new MintEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a MintEvent. - * @implements IMintEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set - */ - function MintEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MintEvent amount. - * @member {number|Long} amount - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @instance - */ - MintEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MintEvent recipientId. - * @member {Uint8Array} recipientId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @instance - */ - MintEvent.prototype.recipientId = $util.newBuffer([]); - - /** - * MintEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @instance - */ - MintEvent.prototype.publicNote = ""; - - /** - * Creates a new MintEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent instance - */ - MintEvent.create = function create(properties) { - return new MintEvent(properties); - }; - - /** - * Encodes the specified MintEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MintEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); - if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.recipientId); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified MintEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MintEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MintEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MintEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount = reader.uint64(); - break; - case 2: - message.recipientId = reader.bytes(); - break; - case 3: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MintEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MintEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MintEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MintEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - if (message.recipientId != null && message.hasOwnProperty("recipientId")) - if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) - return "recipientId: buffer expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a MintEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent - */ - MintEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - if (object.recipientId != null) - if (typeof object.recipientId === "string") - $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); - else if (object.recipientId.length >= 0) - message.recipientId = object.recipientId; - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a MintEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} message MintEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MintEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.recipientId = ""; - else { - object.recipientId = []; - if (options.bytes !== Array) - object.recipientId = $util.newBuffer(object.recipientId); - } - object.publicNote = ""; - } - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - if (message.recipientId != null && message.hasOwnProperty("recipientId")) - object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this MintEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @instance - * @returns {Object.} JSON object - */ - MintEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MintEvent; - })(); - - GetGroupActionsResponseV0.BurnEvent = (function() { - - /** - * Properties of a BurnEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IBurnEvent - * @property {number|Long|null} [amount] BurnEvent amount - * @property {string|null} [publicNote] BurnEvent publicNote - */ - - /** - * Constructs a new BurnEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a BurnEvent. - * @implements IBurnEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set - */ - function BurnEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BurnEvent amount. - * @member {number|Long} amount - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @instance - */ - BurnEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BurnEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @instance - */ - BurnEvent.prototype.publicNote = ""; - - /** - * Creates a new BurnEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent instance - */ - BurnEvent.create = function create(properties) { - return new BurnEvent(properties); - }; - - /** - * Encodes the specified BurnEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BurnEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified BurnEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BurnEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BurnEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BurnEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount = reader.uint64(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BurnEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BurnEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BurnEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BurnEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a BurnEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent - */ - BurnEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a BurnEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} message BurnEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BurnEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - object.publicNote = ""; - } - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this BurnEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @instance - * @returns {Object.} JSON object - */ - BurnEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BurnEvent; - })(); - - GetGroupActionsResponseV0.FreezeEvent = (function() { - - /** - * Properties of a FreezeEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IFreezeEvent - * @property {Uint8Array|null} [frozenId] FreezeEvent frozenId - * @property {string|null} [publicNote] FreezeEvent publicNote - */ - - /** - * Constructs a new FreezeEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a FreezeEvent. - * @implements IFreezeEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set - */ - function FreezeEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FreezeEvent frozenId. - * @member {Uint8Array} frozenId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @instance - */ - FreezeEvent.prototype.frozenId = $util.newBuffer([]); - - /** - * FreezeEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @instance - */ - FreezeEvent.prototype.publicNote = ""; - - /** - * Creates a new FreezeEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent instance - */ - FreezeEvent.create = function create(properties) { - return new FreezeEvent(properties); - }; - - /** - * Encodes the specified FreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FreezeEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified FreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FreezeEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FreezeEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozenId = reader.bytes(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FreezeEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FreezeEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FreezeEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FreezeEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) - return "frozenId: buffer expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a FreezeEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent - */ - FreezeEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); - if (object.frozenId != null) - if (typeof object.frozenId === "string") - $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); - else if (object.frozenId.length >= 0) - message.frozenId = object.frozenId; - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a FreezeEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} message FreezeEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FreezeEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.frozenId = ""; - else { - object.frozenId = []; - if (options.bytes !== Array) - object.frozenId = $util.newBuffer(object.frozenId); - } - object.publicNote = ""; - } - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this FreezeEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @instance - * @returns {Object.} JSON object - */ - FreezeEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FreezeEvent; - })(); - - GetGroupActionsResponseV0.UnfreezeEvent = (function() { - - /** - * Properties of an UnfreezeEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IUnfreezeEvent - * @property {Uint8Array|null} [frozenId] UnfreezeEvent frozenId - * @property {string|null} [publicNote] UnfreezeEvent publicNote - */ - - /** - * Constructs a new UnfreezeEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents an UnfreezeEvent. - * @implements IUnfreezeEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set - */ - function UnfreezeEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UnfreezeEvent frozenId. - * @member {Uint8Array} frozenId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @instance - */ - UnfreezeEvent.prototype.frozenId = $util.newBuffer([]); - - /** - * UnfreezeEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @instance - */ - UnfreezeEvent.prototype.publicNote = ""; - - /** - * Creates a new UnfreezeEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent instance - */ - UnfreezeEvent.create = function create(properties) { - return new UnfreezeEvent(properties); - }; - - /** - * Encodes the specified UnfreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnfreezeEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified UnfreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnfreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UnfreezeEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnfreezeEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozenId = reader.bytes(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UnfreezeEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnfreezeEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UnfreezeEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UnfreezeEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) - return "frozenId: buffer expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates an UnfreezeEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent - */ - UnfreezeEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); - if (object.frozenId != null) - if (typeof object.frozenId === "string") - $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); - else if (object.frozenId.length >= 0) - message.frozenId = object.frozenId; - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from an UnfreezeEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} message UnfreezeEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UnfreezeEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.frozenId = ""; - else { - object.frozenId = []; - if (options.bytes !== Array) - object.frozenId = $util.newBuffer(object.frozenId); - } - object.publicNote = ""; - } - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this UnfreezeEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @instance - * @returns {Object.} JSON object - */ - UnfreezeEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UnfreezeEvent; - })(); - - GetGroupActionsResponseV0.DestroyFrozenFundsEvent = (function() { - - /** - * Properties of a DestroyFrozenFundsEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IDestroyFrozenFundsEvent - * @property {Uint8Array|null} [frozenId] DestroyFrozenFundsEvent frozenId - * @property {number|Long|null} [amount] DestroyFrozenFundsEvent amount - * @property {string|null} [publicNote] DestroyFrozenFundsEvent publicNote - */ - - /** - * Constructs a new DestroyFrozenFundsEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a DestroyFrozenFundsEvent. - * @implements IDestroyFrozenFundsEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set - */ - function DestroyFrozenFundsEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DestroyFrozenFundsEvent frozenId. - * @member {Uint8Array} frozenId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @instance - */ - DestroyFrozenFundsEvent.prototype.frozenId = $util.newBuffer([]); - - /** - * DestroyFrozenFundsEvent amount. - * @member {number|Long} amount - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @instance - */ - DestroyFrozenFundsEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DestroyFrozenFundsEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @instance - */ - DestroyFrozenFundsEvent.prototype.publicNote = ""; - - /** - * Creates a new DestroyFrozenFundsEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent instance - */ - DestroyFrozenFundsEvent.create = function create(properties) { - return new DestroyFrozenFundsEvent(properties); - }; - - /** - * Encodes the specified DestroyFrozenFundsEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DestroyFrozenFundsEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified DestroyFrozenFundsEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DestroyFrozenFundsEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DestroyFrozenFundsEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozenId = reader.bytes(); - break; - case 2: - message.amount = reader.uint64(); - break; - case 3: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DestroyFrozenFundsEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DestroyFrozenFundsEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DestroyFrozenFundsEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) - return "frozenId: buffer expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a DestroyFrozenFundsEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent - */ - DestroyFrozenFundsEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); - if (object.frozenId != null) - if (typeof object.frozenId === "string") - $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); - else if (object.frozenId.length >= 0) - message.frozenId = object.frozenId; - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a DestroyFrozenFundsEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} message DestroyFrozenFundsEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DestroyFrozenFundsEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.frozenId = ""; - else { - object.frozenId = []; - if (options.bytes !== Array) - object.frozenId = $util.newBuffer(object.frozenId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - object.publicNote = ""; - } - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this DestroyFrozenFundsEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @instance - * @returns {Object.} JSON object - */ - DestroyFrozenFundsEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DestroyFrozenFundsEvent; - })(); - - GetGroupActionsResponseV0.SharedEncryptedNote = (function() { - - /** - * Properties of a SharedEncryptedNote. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface ISharedEncryptedNote - * @property {number|null} [senderKeyIndex] SharedEncryptedNote senderKeyIndex - * @property {number|null} [recipientKeyIndex] SharedEncryptedNote recipientKeyIndex - * @property {Uint8Array|null} [encryptedData] SharedEncryptedNote encryptedData - */ - - /** - * Constructs a new SharedEncryptedNote. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a SharedEncryptedNote. - * @implements ISharedEncryptedNote - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set - */ - function SharedEncryptedNote(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SharedEncryptedNote senderKeyIndex. - * @member {number} senderKeyIndex - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @instance - */ - SharedEncryptedNote.prototype.senderKeyIndex = 0; - - /** - * SharedEncryptedNote recipientKeyIndex. - * @member {number} recipientKeyIndex - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @instance - */ - SharedEncryptedNote.prototype.recipientKeyIndex = 0; - - /** - * SharedEncryptedNote encryptedData. - * @member {Uint8Array} encryptedData - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @instance - */ - SharedEncryptedNote.prototype.encryptedData = $util.newBuffer([]); - - /** - * Creates a new SharedEncryptedNote instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote instance - */ - SharedEncryptedNote.create = function create(properties) { - return new SharedEncryptedNote(properties); - }; - - /** - * Encodes the specified SharedEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SharedEncryptedNote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.senderKeyIndex != null && Object.hasOwnProperty.call(message, "senderKeyIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.senderKeyIndex); - if (message.recipientKeyIndex != null && Object.hasOwnProperty.call(message, "recipientKeyIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.recipientKeyIndex); - if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); - return writer; - }; - - /** - * Encodes the specified SharedEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SharedEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SharedEncryptedNote message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SharedEncryptedNote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.senderKeyIndex = reader.uint32(); - break; - case 2: - message.recipientKeyIndex = reader.uint32(); - break; - case 3: - message.encryptedData = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SharedEncryptedNote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SharedEncryptedNote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SharedEncryptedNote message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SharedEncryptedNote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) - if (!$util.isInteger(message.senderKeyIndex)) - return "senderKeyIndex: integer expected"; - if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) - if (!$util.isInteger(message.recipientKeyIndex)) - return "recipientKeyIndex: integer expected"; - if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) - if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) - return "encryptedData: buffer expected"; - return null; - }; - - /** - * Creates a SharedEncryptedNote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote - */ - SharedEncryptedNote.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); - if (object.senderKeyIndex != null) - message.senderKeyIndex = object.senderKeyIndex >>> 0; - if (object.recipientKeyIndex != null) - message.recipientKeyIndex = object.recipientKeyIndex >>> 0; - if (object.encryptedData != null) - if (typeof object.encryptedData === "string") - $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); - else if (object.encryptedData.length >= 0) - message.encryptedData = object.encryptedData; - return message; - }; - - /** - * Creates a plain object from a SharedEncryptedNote message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} message SharedEncryptedNote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SharedEncryptedNote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.senderKeyIndex = 0; - object.recipientKeyIndex = 0; - if (options.bytes === String) - object.encryptedData = ""; - else { - object.encryptedData = []; - if (options.bytes !== Array) - object.encryptedData = $util.newBuffer(object.encryptedData); - } - } - if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) - object.senderKeyIndex = message.senderKeyIndex; - if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) - object.recipientKeyIndex = message.recipientKeyIndex; - if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) - object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; - return object; - }; - - /** - * Converts this SharedEncryptedNote to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @instance - * @returns {Object.} JSON object - */ - SharedEncryptedNote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SharedEncryptedNote; - })(); - - GetGroupActionsResponseV0.PersonalEncryptedNote = (function() { - - /** - * Properties of a PersonalEncryptedNote. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IPersonalEncryptedNote - * @property {number|null} [rootEncryptionKeyIndex] PersonalEncryptedNote rootEncryptionKeyIndex - * @property {number|null} [derivationEncryptionKeyIndex] PersonalEncryptedNote derivationEncryptionKeyIndex - * @property {Uint8Array|null} [encryptedData] PersonalEncryptedNote encryptedData - */ - - /** - * Constructs a new PersonalEncryptedNote. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a PersonalEncryptedNote. - * @implements IPersonalEncryptedNote - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set - */ - function PersonalEncryptedNote(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PersonalEncryptedNote rootEncryptionKeyIndex. - * @member {number} rootEncryptionKeyIndex - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @instance - */ - PersonalEncryptedNote.prototype.rootEncryptionKeyIndex = 0; - - /** - * PersonalEncryptedNote derivationEncryptionKeyIndex. - * @member {number} derivationEncryptionKeyIndex - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @instance - */ - PersonalEncryptedNote.prototype.derivationEncryptionKeyIndex = 0; - - /** - * PersonalEncryptedNote encryptedData. - * @member {Uint8Array} encryptedData - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @instance - */ - PersonalEncryptedNote.prototype.encryptedData = $util.newBuffer([]); - - /** - * Creates a new PersonalEncryptedNote instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote instance - */ - PersonalEncryptedNote.create = function create(properties) { - return new PersonalEncryptedNote(properties); - }; - - /** - * Encodes the specified PersonalEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonalEncryptedNote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rootEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "rootEncryptionKeyIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rootEncryptionKeyIndex); - if (message.derivationEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "derivationEncryptionKeyIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.derivationEncryptionKeyIndex); - if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); - return writer; - }; - - /** - * Encodes the specified PersonalEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonalEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PersonalEncryptedNote message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonalEncryptedNote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rootEncryptionKeyIndex = reader.uint32(); - break; - case 2: - message.derivationEncryptionKeyIndex = reader.uint32(); - break; - case 3: - message.encryptedData = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PersonalEncryptedNote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonalEncryptedNote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PersonalEncryptedNote message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PersonalEncryptedNote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) - if (!$util.isInteger(message.rootEncryptionKeyIndex)) - return "rootEncryptionKeyIndex: integer expected"; - if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) - if (!$util.isInteger(message.derivationEncryptionKeyIndex)) - return "derivationEncryptionKeyIndex: integer expected"; - if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) - if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) - return "encryptedData: buffer expected"; - return null; - }; - - /** - * Creates a PersonalEncryptedNote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote - */ - PersonalEncryptedNote.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); - if (object.rootEncryptionKeyIndex != null) - message.rootEncryptionKeyIndex = object.rootEncryptionKeyIndex >>> 0; - if (object.derivationEncryptionKeyIndex != null) - message.derivationEncryptionKeyIndex = object.derivationEncryptionKeyIndex >>> 0; - if (object.encryptedData != null) - if (typeof object.encryptedData === "string") - $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); - else if (object.encryptedData.length >= 0) - message.encryptedData = object.encryptedData; - return message; - }; - - /** - * Creates a plain object from a PersonalEncryptedNote message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} message PersonalEncryptedNote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PersonalEncryptedNote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.rootEncryptionKeyIndex = 0; - object.derivationEncryptionKeyIndex = 0; - if (options.bytes === String) - object.encryptedData = ""; - else { - object.encryptedData = []; - if (options.bytes !== Array) - object.encryptedData = $util.newBuffer(object.encryptedData); - } - } - if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) - object.rootEncryptionKeyIndex = message.rootEncryptionKeyIndex; - if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) - object.derivationEncryptionKeyIndex = message.derivationEncryptionKeyIndex; - if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) - object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; - return object; - }; - - /** - * Converts this PersonalEncryptedNote to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @instance - * @returns {Object.} JSON object - */ - PersonalEncryptedNote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PersonalEncryptedNote; - })(); - - GetGroupActionsResponseV0.EmergencyActionEvent = (function() { - - /** - * Properties of an EmergencyActionEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IEmergencyActionEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType|null} [actionType] EmergencyActionEvent actionType - * @property {string|null} [publicNote] EmergencyActionEvent publicNote - */ - - /** - * Constructs a new EmergencyActionEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents an EmergencyActionEvent. - * @implements IEmergencyActionEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set - */ - function EmergencyActionEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EmergencyActionEvent actionType. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType} actionType - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @instance - */ - EmergencyActionEvent.prototype.actionType = 0; - - /** - * EmergencyActionEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @instance - */ - EmergencyActionEvent.prototype.publicNote = ""; - - /** - * Creates a new EmergencyActionEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent instance - */ - EmergencyActionEvent.create = function create(properties) { - return new EmergencyActionEvent(properties); - }; - - /** - * Encodes the specified EmergencyActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmergencyActionEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.actionType != null && Object.hasOwnProperty.call(message, "actionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionType); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified EmergencyActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmergencyActionEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EmergencyActionEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmergencyActionEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.actionType = reader.int32(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EmergencyActionEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmergencyActionEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EmergencyActionEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EmergencyActionEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionType != null && message.hasOwnProperty("actionType")) - switch (message.actionType) { - default: - return "actionType: enum value expected"; - case 0: - case 1: - break; - } - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates an EmergencyActionEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent - */ - EmergencyActionEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); - switch (object.actionType) { - case "PAUSE": - case 0: - message.actionType = 0; - break; - case "RESUME": - case 1: - message.actionType = 1; - break; - } - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from an EmergencyActionEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} message EmergencyActionEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EmergencyActionEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.actionType = options.enums === String ? "PAUSE" : 0; - object.publicNote = ""; - } - if (message.actionType != null && message.hasOwnProperty("actionType")) - object.actionType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType[message.actionType] : message.actionType; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this EmergencyActionEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @instance - * @returns {Object.} JSON object - */ - EmergencyActionEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * ActionType enum. - * @name org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType - * @enum {number} - * @property {number} PAUSE=0 PAUSE value - * @property {number} RESUME=1 RESUME value - */ - EmergencyActionEvent.ActionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PAUSE"] = 0; - values[valuesById[1] = "RESUME"] = 1; - return values; - })(); - - return EmergencyActionEvent; - })(); - - GetGroupActionsResponseV0.TokenConfigUpdateEvent = (function() { - - /** - * Properties of a TokenConfigUpdateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface ITokenConfigUpdateEvent - * @property {Uint8Array|null} [tokenConfigUpdateItem] TokenConfigUpdateEvent tokenConfigUpdateItem - * @property {string|null} [publicNote] TokenConfigUpdateEvent publicNote - */ - - /** - * Constructs a new TokenConfigUpdateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a TokenConfigUpdateEvent. - * @implements ITokenConfigUpdateEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set - */ - function TokenConfigUpdateEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenConfigUpdateEvent tokenConfigUpdateItem. - * @member {Uint8Array} tokenConfigUpdateItem - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @instance - */ - TokenConfigUpdateEvent.prototype.tokenConfigUpdateItem = $util.newBuffer([]); - - /** - * TokenConfigUpdateEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @instance - */ - TokenConfigUpdateEvent.prototype.publicNote = ""; - - /** - * Creates a new TokenConfigUpdateEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent instance - */ - TokenConfigUpdateEvent.create = function create(properties) { - return new TokenConfigUpdateEvent(properties); - }; - - /** - * Encodes the specified TokenConfigUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenConfigUpdateEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenConfigUpdateItem != null && Object.hasOwnProperty.call(message, "tokenConfigUpdateItem")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenConfigUpdateItem); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified TokenConfigUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenConfigUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenConfigUpdateEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenConfigUpdateItem = reader.bytes(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenConfigUpdateEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenConfigUpdateEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenConfigUpdateEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) - if (!(message.tokenConfigUpdateItem && typeof message.tokenConfigUpdateItem.length === "number" || $util.isString(message.tokenConfigUpdateItem))) - return "tokenConfigUpdateItem: buffer expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a TokenConfigUpdateEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent - */ - TokenConfigUpdateEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); - if (object.tokenConfigUpdateItem != null) - if (typeof object.tokenConfigUpdateItem === "string") - $util.base64.decode(object.tokenConfigUpdateItem, message.tokenConfigUpdateItem = $util.newBuffer($util.base64.length(object.tokenConfigUpdateItem)), 0); - else if (object.tokenConfigUpdateItem.length >= 0) - message.tokenConfigUpdateItem = object.tokenConfigUpdateItem; - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a TokenConfigUpdateEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} message TokenConfigUpdateEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenConfigUpdateEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenConfigUpdateItem = ""; - else { - object.tokenConfigUpdateItem = []; - if (options.bytes !== Array) - object.tokenConfigUpdateItem = $util.newBuffer(object.tokenConfigUpdateItem); - } - object.publicNote = ""; - } - if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) - object.tokenConfigUpdateItem = options.bytes === String ? $util.base64.encode(message.tokenConfigUpdateItem, 0, message.tokenConfigUpdateItem.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenConfigUpdateItem) : message.tokenConfigUpdateItem; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this TokenConfigUpdateEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @instance - * @returns {Object.} JSON object - */ - TokenConfigUpdateEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenConfigUpdateEvent; - })(); - - GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent = (function() { - - /** - * Properties of an UpdateDirectPurchasePriceEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IUpdateDirectPurchasePriceEvent - * @property {number|Long|null} [fixedPrice] UpdateDirectPurchasePriceEvent fixedPrice - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null} [variablePrice] UpdateDirectPurchasePriceEvent variablePrice - * @property {string|null} [publicNote] UpdateDirectPurchasePriceEvent publicNote - */ - - /** - * Constructs a new UpdateDirectPurchasePriceEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents an UpdateDirectPurchasePriceEvent. - * @implements IUpdateDirectPurchasePriceEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set - */ - function UpdateDirectPurchasePriceEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDirectPurchasePriceEvent fixedPrice. - * @member {number|Long} fixedPrice - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - */ - UpdateDirectPurchasePriceEvent.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UpdateDirectPurchasePriceEvent variablePrice. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null|undefined} variablePrice - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - */ - UpdateDirectPurchasePriceEvent.prototype.variablePrice = null; - - /** - * UpdateDirectPurchasePriceEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - */ - UpdateDirectPurchasePriceEvent.prototype.publicNote = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * UpdateDirectPurchasePriceEvent price. - * @member {"fixedPrice"|"variablePrice"|undefined} price - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - */ - Object.defineProperty(UpdateDirectPurchasePriceEvent.prototype, "price", { - get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new UpdateDirectPurchasePriceEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent instance - */ - UpdateDirectPurchasePriceEvent.create = function create(properties) { - return new UpdateDirectPurchasePriceEvent(properties); - }; - - /** - * Encodes the specified UpdateDirectPurchasePriceEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDirectPurchasePriceEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.fixedPrice); - if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified UpdateDirectPurchasePriceEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDirectPurchasePriceEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDirectPurchasePriceEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fixedPrice = reader.uint64(); - break; - case 2: - message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.decode(reader, reader.uint32()); - break; - case 3: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDirectPurchasePriceEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDirectPurchasePriceEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDirectPurchasePriceEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { - properties.price = 1; - if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) - return "fixedPrice: integer|Long expected"; - } - if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { - if (properties.price === 1) - return "price: multiple values"; - properties.price = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify(message.variablePrice); - if (error) - return "variablePrice." + error; - } - } - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates an UpdateDirectPurchasePriceEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent - */ - UpdateDirectPurchasePriceEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); - if (object.fixedPrice != null) - if ($util.Long) - (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; - else if (typeof object.fixedPrice === "string") - message.fixedPrice = parseInt(object.fixedPrice, 10); - else if (typeof object.fixedPrice === "number") - message.fixedPrice = object.fixedPrice; - else if (typeof object.fixedPrice === "object") - message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); - if (object.variablePrice != null) { - if (typeof object.variablePrice !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.variablePrice: object expected"); - message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.fromObject(object.variablePrice); - } - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from an UpdateDirectPurchasePriceEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDirectPurchasePriceEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.publicNote = ""; - if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { - if (typeof message.fixedPrice === "number") - object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; - else - object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; - if (options.oneofs) - object.price = "fixedPrice"; - } - if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { - object.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(message.variablePrice, options); - if (options.oneofs) - object.price = "variablePrice"; - } - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this UpdateDirectPurchasePriceEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - * @returns {Object.} JSON object - */ - UpdateDirectPurchasePriceEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UpdateDirectPurchasePriceEvent.PriceForQuantity = (function() { - - /** - * Properties of a PriceForQuantity. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @interface IPriceForQuantity - * @property {number|Long|null} [quantity] PriceForQuantity quantity - * @property {number|Long|null} [price] PriceForQuantity price - */ - - /** - * Constructs a new PriceForQuantity. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @classdesc Represents a PriceForQuantity. - * @implements IPriceForQuantity - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set - */ - function PriceForQuantity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PriceForQuantity quantity. - * @member {number|Long} quantity - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @instance - */ - PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PriceForQuantity price. - * @member {number|Long} price - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @instance - */ - PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new PriceForQuantity instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity instance - */ - PriceForQuantity.create = function create(properties) { - return new PriceForQuantity(properties); - }; - - /** - * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceForQuantity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); - return writer; - }; - - /** - * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PriceForQuantity message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceForQuantity.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quantity = reader.uint64(); - break; - case 2: - message.price = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PriceForQuantity message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PriceForQuantity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quantity != null && message.hasOwnProperty("quantity")) - if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) - return "quantity: integer|Long expected"; - if (message.price != null && message.hasOwnProperty("price")) - if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) - return "price: integer|Long expected"; - return null; - }; - - /** - * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity - */ - PriceForQuantity.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); - if (object.quantity != null) - if ($util.Long) - (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; - else if (typeof object.quantity === "string") - message.quantity = parseInt(object.quantity, 10); - else if (typeof object.quantity === "number") - message.quantity = object.quantity; - else if (typeof object.quantity === "object") - message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); - if (object.price != null) - if ($util.Long) - (message.price = $util.Long.fromValue(object.price)).unsigned = true; - else if (typeof object.price === "string") - message.price = parseInt(object.price, 10); - else if (typeof object.price === "number") - message.price = object.price; - else if (typeof object.price === "object") - message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} message PriceForQuantity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PriceForQuantity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.quantity = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.price = options.longs === String ? "0" : 0; - } - if (message.quantity != null && message.hasOwnProperty("quantity")) - if (typeof message.quantity === "number") - object.quantity = options.longs === String ? String(message.quantity) : message.quantity; - else - object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; - if (message.price != null && message.hasOwnProperty("price")) - if (typeof message.price === "number") - object.price = options.longs === String ? String(message.price) : message.price; - else - object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; - return object; - }; - - /** - * Converts this PriceForQuantity to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @instance - * @returns {Object.} JSON object - */ - PriceForQuantity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PriceForQuantity; - })(); - - UpdateDirectPurchasePriceEvent.PricingSchedule = (function() { - - /** - * Properties of a PricingSchedule. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @interface IPricingSchedule - * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity - */ - - /** - * Constructs a new PricingSchedule. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @classdesc Represents a PricingSchedule. - * @implements IPricingSchedule - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set - */ - function PricingSchedule(properties) { - this.priceForQuantity = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PricingSchedule priceForQuantity. - * @member {Array.} priceForQuantity - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @instance - */ - PricingSchedule.prototype.priceForQuantity = $util.emptyArray; - - /** - * Creates a new PricingSchedule instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule instance - */ - PricingSchedule.create = function create(properties) { - return new PricingSchedule(properties); - }; - - /** - * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PricingSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.priceForQuantity != null && message.priceForQuantity.length) - for (var i = 0; i < message.priceForQuantity.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PricingSchedule message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PricingSchedule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.priceForQuantity && message.priceForQuantity.length)) - message.priceForQuantity = []; - message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PricingSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PricingSchedule message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PricingSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { - if (!Array.isArray(message.priceForQuantity)) - return "priceForQuantity: array expected"; - for (var i = 0; i < message.priceForQuantity.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify(message.priceForQuantity[i]); - if (error) - return "priceForQuantity." + error; - } - } - return null; - }; - - /** - * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule - */ - PricingSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); - if (object.priceForQuantity) { - if (!Array.isArray(object.priceForQuantity)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: array expected"); - message.priceForQuantity = []; - for (var i = 0; i < object.priceForQuantity.length; ++i) { - if (typeof object.priceForQuantity[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: object expected"); - message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.fromObject(object.priceForQuantity[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} message PricingSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PricingSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.priceForQuantity = []; - if (message.priceForQuantity && message.priceForQuantity.length) { - object.priceForQuantity = []; - for (var j = 0; j < message.priceForQuantity.length; ++j) - object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject(message.priceForQuantity[j], options); - } - return object; - }; - - /** - * Converts this PricingSchedule to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @instance - * @returns {Object.} JSON object - */ - PricingSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PricingSchedule; - })(); - - return UpdateDirectPurchasePriceEvent; - })(); - - GetGroupActionsResponseV0.GroupActionEvent = (function() { - - /** - * Properties of a GroupActionEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IGroupActionEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null} [tokenEvent] GroupActionEvent tokenEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null} [documentEvent] GroupActionEvent documentEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null} [contractEvent] GroupActionEvent contractEvent - */ - - /** - * Constructs a new GroupActionEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a GroupActionEvent. - * @implements IGroupActionEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set - */ - function GroupActionEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActionEvent tokenEvent. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null|undefined} tokenEvent - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - */ - GroupActionEvent.prototype.tokenEvent = null; - - /** - * GroupActionEvent documentEvent. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null|undefined} documentEvent - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - */ - GroupActionEvent.prototype.documentEvent = null; - - /** - * GroupActionEvent contractEvent. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null|undefined} contractEvent - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - */ - GroupActionEvent.prototype.contractEvent = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GroupActionEvent eventType. - * @member {"tokenEvent"|"documentEvent"|"contractEvent"|undefined} eventType - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - */ - Object.defineProperty(GroupActionEvent.prototype, "eventType", { - get: $util.oneOfGetter($oneOfFields = ["tokenEvent", "documentEvent", "contractEvent"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GroupActionEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent instance - */ - GroupActionEvent.create = function create(properties) { - return new GroupActionEvent(properties); - }; - - /** - * Encodes the specified GroupActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenEvent != null && Object.hasOwnProperty.call(message, "tokenEvent")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.encode(message.tokenEvent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.documentEvent != null && Object.hasOwnProperty.call(message, "documentEvent")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.encode(message.documentEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contractEvent != null && Object.hasOwnProperty.call(message, "contractEvent")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.encode(message.contractEvent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActionEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.decode(reader, reader.uint32()); - break; - case 2: - message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.decode(reader, reader.uint32()); - break; - case 3: - message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActionEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActionEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActionEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { - properties.eventType = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify(message.tokenEvent); - if (error) - return "tokenEvent." + error; - } - } - if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { - if (properties.eventType === 1) - return "eventType: multiple values"; - properties.eventType = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify(message.documentEvent); - if (error) - return "documentEvent." + error; - } - } - if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { - if (properties.eventType === 1) - return "eventType: multiple values"; - properties.eventType = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify(message.contractEvent); - if (error) - return "contractEvent." + error; - } - } - return null; - }; - - /** - * Creates a GroupActionEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent - */ - GroupActionEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); - if (object.tokenEvent != null) { - if (typeof object.tokenEvent !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.tokenEvent: object expected"); - message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.fromObject(object.tokenEvent); - } - if (object.documentEvent != null) { - if (typeof object.documentEvent !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.documentEvent: object expected"); - message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.fromObject(object.documentEvent); - } - if (object.contractEvent != null) { - if (typeof object.contractEvent !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.contractEvent: object expected"); - message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.fromObject(object.contractEvent); - } - return message; - }; - - /** - * Creates a plain object from a GroupActionEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} message GroupActionEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActionEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { - object.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.toObject(message.tokenEvent, options); - if (options.oneofs) - object.eventType = "tokenEvent"; - } - if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { - object.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.toObject(message.documentEvent, options); - if (options.oneofs) - object.eventType = "documentEvent"; - } - if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { - object.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.toObject(message.contractEvent, options); - if (options.oneofs) - object.eventType = "contractEvent"; - } - return object; - }; - - /** - * Converts this GroupActionEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - * @returns {Object.} JSON object - */ - GroupActionEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActionEvent; - })(); - - GetGroupActionsResponseV0.DocumentEvent = (function() { - - /** - * Properties of a DocumentEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IDocumentEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null} [create] DocumentEvent create - */ - - /** - * Constructs a new DocumentEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a DocumentEvent. - * @implements IDocumentEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set - */ - function DocumentEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentEvent create. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null|undefined} create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @instance - */ - DocumentEvent.prototype.create = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DocumentEvent type. - * @member {"create"|undefined} type - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @instance - */ - Object.defineProperty(DocumentEvent.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["create"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DocumentEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent instance - */ - DocumentEvent.create = function create(properties) { - return new DocumentEvent(properties); - }; - - /** - * Encodes the specified DocumentEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.create != null && Object.hasOwnProperty.call(message, "create")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.encode(message.create, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.create != null && message.hasOwnProperty("create")) { - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify(message.create); - if (error) - return "create." + error; - } - } - return null; - }; - - /** - * Creates a DocumentEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent - */ - DocumentEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); - if (object.create != null) { - if (typeof object.create !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.create: object expected"); - message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.fromObject(object.create); - } - return message; - }; - - /** - * Creates a plain object from a DocumentEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} message DocumentEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.create != null && message.hasOwnProperty("create")) { - object.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.toObject(message.create, options); - if (options.oneofs) - object.type = "create"; - } - return object; - }; - - /** - * Converts this DocumentEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @instance - * @returns {Object.} JSON object - */ - DocumentEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DocumentEvent; - })(); - - GetGroupActionsResponseV0.DocumentCreateEvent = (function() { - - /** - * Properties of a DocumentCreateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IDocumentCreateEvent - * @property {Uint8Array|null} [createdDocument] DocumentCreateEvent createdDocument - */ - - /** - * Constructs a new DocumentCreateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a DocumentCreateEvent. - * @implements IDocumentCreateEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set - */ - function DocumentCreateEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentCreateEvent createdDocument. - * @member {Uint8Array} createdDocument - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @instance - */ - DocumentCreateEvent.prototype.createdDocument = $util.newBuffer([]); - - /** - * Creates a new DocumentCreateEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent instance - */ - DocumentCreateEvent.create = function create(properties) { - return new DocumentCreateEvent(properties); - }; - - /** - * Encodes the specified DocumentCreateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentCreateEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createdDocument != null && Object.hasOwnProperty.call(message, "createdDocument")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.createdDocument); - return writer; - }; - - /** - * Encodes the specified DocumentCreateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentCreateEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentCreateEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentCreateEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.createdDocument = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentCreateEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentCreateEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentCreateEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentCreateEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) - if (!(message.createdDocument && typeof message.createdDocument.length === "number" || $util.isString(message.createdDocument))) - return "createdDocument: buffer expected"; - return null; - }; - - /** - * Creates a DocumentCreateEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent - */ - DocumentCreateEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); - if (object.createdDocument != null) - if (typeof object.createdDocument === "string") - $util.base64.decode(object.createdDocument, message.createdDocument = $util.newBuffer($util.base64.length(object.createdDocument)), 0); - else if (object.createdDocument.length >= 0) - message.createdDocument = object.createdDocument; - return message; - }; - - /** - * Creates a plain object from a DocumentCreateEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} message DocumentCreateEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentCreateEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.createdDocument = ""; - else { - object.createdDocument = []; - if (options.bytes !== Array) - object.createdDocument = $util.newBuffer(object.createdDocument); - } - if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) - object.createdDocument = options.bytes === String ? $util.base64.encode(message.createdDocument, 0, message.createdDocument.length) : options.bytes === Array ? Array.prototype.slice.call(message.createdDocument) : message.createdDocument; - return object; - }; - - /** - * Converts this DocumentCreateEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @instance - * @returns {Object.} JSON object - */ - DocumentCreateEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DocumentCreateEvent; - })(); - - GetGroupActionsResponseV0.ContractUpdateEvent = (function() { - - /** - * Properties of a ContractUpdateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IContractUpdateEvent - * @property {Uint8Array|null} [updatedContract] ContractUpdateEvent updatedContract - */ - - /** - * Constructs a new ContractUpdateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a ContractUpdateEvent. - * @implements IContractUpdateEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set - */ - function ContractUpdateEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContractUpdateEvent updatedContract. - * @member {Uint8Array} updatedContract - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @instance - */ - ContractUpdateEvent.prototype.updatedContract = $util.newBuffer([]); - - /** - * Creates a new ContractUpdateEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent instance - */ - ContractUpdateEvent.create = function create(properties) { - return new ContractUpdateEvent(properties); - }; - - /** - * Encodes the specified ContractUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractUpdateEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updatedContract != null && Object.hasOwnProperty.call(message, "updatedContract")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.updatedContract); - return writer; - }; - - /** - * Encodes the specified ContractUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContractUpdateEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractUpdateEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.updatedContract = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContractUpdateEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractUpdateEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContractUpdateEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContractUpdateEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) - if (!(message.updatedContract && typeof message.updatedContract.length === "number" || $util.isString(message.updatedContract))) - return "updatedContract: buffer expected"; - return null; - }; - - /** - * Creates a ContractUpdateEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent - */ - ContractUpdateEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); - if (object.updatedContract != null) - if (typeof object.updatedContract === "string") - $util.base64.decode(object.updatedContract, message.updatedContract = $util.newBuffer($util.base64.length(object.updatedContract)), 0); - else if (object.updatedContract.length >= 0) - message.updatedContract = object.updatedContract; - return message; - }; - - /** - * Creates a plain object from a ContractUpdateEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} message ContractUpdateEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContractUpdateEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.updatedContract = ""; - else { - object.updatedContract = []; - if (options.bytes !== Array) - object.updatedContract = $util.newBuffer(object.updatedContract); - } - if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) - object.updatedContract = options.bytes === String ? $util.base64.encode(message.updatedContract, 0, message.updatedContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.updatedContract) : message.updatedContract; - return object; - }; - - /** - * Converts this ContractUpdateEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @instance - * @returns {Object.} JSON object - */ - ContractUpdateEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContractUpdateEvent; - })(); - - GetGroupActionsResponseV0.ContractEvent = (function() { - - /** - * Properties of a ContractEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IContractEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null} [update] ContractEvent update - */ - - /** - * Constructs a new ContractEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a ContractEvent. - * @implements IContractEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set - */ - function ContractEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContractEvent update. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null|undefined} update - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @instance - */ - ContractEvent.prototype.update = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ContractEvent type. - * @member {"update"|undefined} type - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @instance - */ - Object.defineProperty(ContractEvent.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["update"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ContractEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent instance - */ - ContractEvent.create = function create(properties) { - return new ContractEvent(properties); - }; - - /** - * Encodes the specified ContractEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContractEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContractEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContractEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContractEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContractEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.update != null && message.hasOwnProperty("update")) { - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify(message.update); - if (error) - return "update." + error; - } - } - return null; - }; - - /** - * Creates a ContractEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent - */ - ContractEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.update: object expected"); - message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.fromObject(object.update); - } - return message; - }; - - /** - * Creates a plain object from a ContractEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} message ContractEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContractEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.update != null && message.hasOwnProperty("update")) { - object.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.toObject(message.update, options); - if (options.oneofs) - object.type = "update"; - } - return object; - }; - - /** - * Converts this ContractEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @instance - * @returns {Object.} JSON object - */ - ContractEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContractEvent; - })(); - - GetGroupActionsResponseV0.TokenEvent = (function() { - - /** - * Properties of a TokenEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface ITokenEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null} [mint] TokenEvent mint - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null} [burn] TokenEvent burn - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null} [freeze] TokenEvent freeze - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null} [unfreeze] TokenEvent unfreeze - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null} [destroyFrozenFunds] TokenEvent destroyFrozenFunds - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null} [emergencyAction] TokenEvent emergencyAction - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null} [tokenConfigUpdate] TokenEvent tokenConfigUpdate - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null} [updatePrice] TokenEvent updatePrice - */ - - /** - * Constructs a new TokenEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a TokenEvent. - * @implements ITokenEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set - */ - function TokenEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenEvent mint. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null|undefined} mint - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.mint = null; - - /** - * TokenEvent burn. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null|undefined} burn - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.burn = null; - - /** - * TokenEvent freeze. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null|undefined} freeze - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.freeze = null; - - /** - * TokenEvent unfreeze. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null|undefined} unfreeze - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.unfreeze = null; - - /** - * TokenEvent destroyFrozenFunds. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null|undefined} destroyFrozenFunds - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.destroyFrozenFunds = null; - - /** - * TokenEvent emergencyAction. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null|undefined} emergencyAction - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.emergencyAction = null; - - /** - * TokenEvent tokenConfigUpdate. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null|undefined} tokenConfigUpdate - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.tokenConfigUpdate = null; - - /** - * TokenEvent updatePrice. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null|undefined} updatePrice - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.updatePrice = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TokenEvent type. - * @member {"mint"|"burn"|"freeze"|"unfreeze"|"destroyFrozenFunds"|"emergencyAction"|"tokenConfigUpdate"|"updatePrice"|undefined} type - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - Object.defineProperty(TokenEvent.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["mint", "burn", "freeze", "unfreeze", "destroyFrozenFunds", "emergencyAction", "tokenConfigUpdate", "updatePrice"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TokenEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent instance - */ - TokenEvent.create = function create(properties) { - return new TokenEvent(properties); - }; - - /** - * Encodes the specified TokenEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mint != null && Object.hasOwnProperty.call(message, "mint")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.encode(message.mint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.burn != null && Object.hasOwnProperty.call(message, "burn")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.encode(message.burn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.freeze != null && Object.hasOwnProperty.call(message, "freeze")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.encode(message.freeze, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.unfreeze != null && Object.hasOwnProperty.call(message, "unfreeze")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.encode(message.unfreeze, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.destroyFrozenFunds != null && Object.hasOwnProperty.call(message, "destroyFrozenFunds")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.encode(message.destroyFrozenFunds, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.emergencyAction != null && Object.hasOwnProperty.call(message, "emergencyAction")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.encode(message.emergencyAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.tokenConfigUpdate != null && Object.hasOwnProperty.call(message, "tokenConfigUpdate")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.encode(message.tokenConfigUpdate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updatePrice != null && Object.hasOwnProperty.call(message, "updatePrice")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.encode(message.updatePrice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.decode(reader, reader.uint32()); - break; - case 2: - message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.decode(reader, reader.uint32()); - break; - case 3: - message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.decode(reader, reader.uint32()); - break; - case 4: - message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.decode(reader, reader.uint32()); - break; - case 5: - message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.decode(reader, reader.uint32()); - break; - case 6: - message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.decode(reader, reader.uint32()); - break; - case 7: - message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.decode(reader, reader.uint32()); - break; - case 8: - message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.mint != null && message.hasOwnProperty("mint")) { - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify(message.mint); - if (error) - return "mint." + error; - } - } - if (message.burn != null && message.hasOwnProperty("burn")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify(message.burn); - if (error) - return "burn." + error; - } - } - if (message.freeze != null && message.hasOwnProperty("freeze")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify(message.freeze); - if (error) - return "freeze." + error; - } - } - if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify(message.unfreeze); - if (error) - return "unfreeze." + error; - } - } - if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify(message.destroyFrozenFunds); - if (error) - return "destroyFrozenFunds." + error; - } - } - if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify(message.emergencyAction); - if (error) - return "emergencyAction." + error; - } - } - if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify(message.tokenConfigUpdate); - if (error) - return "tokenConfigUpdate." + error; - } - } - if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify(message.updatePrice); - if (error) - return "updatePrice." + error; - } - } - return null; - }; - - /** - * Creates a TokenEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent - */ - TokenEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); - if (object.mint != null) { - if (typeof object.mint !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.mint: object expected"); - message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.fromObject(object.mint); - } - if (object.burn != null) { - if (typeof object.burn !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.burn: object expected"); - message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.fromObject(object.burn); - } - if (object.freeze != null) { - if (typeof object.freeze !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.freeze: object expected"); - message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.fromObject(object.freeze); - } - if (object.unfreeze != null) { - if (typeof object.unfreeze !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.unfreeze: object expected"); - message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.fromObject(object.unfreeze); - } - if (object.destroyFrozenFunds != null) { - if (typeof object.destroyFrozenFunds !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.destroyFrozenFunds: object expected"); - message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.fromObject(object.destroyFrozenFunds); - } - if (object.emergencyAction != null) { - if (typeof object.emergencyAction !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.emergencyAction: object expected"); - message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.fromObject(object.emergencyAction); - } - if (object.tokenConfigUpdate != null) { - if (typeof object.tokenConfigUpdate !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.tokenConfigUpdate: object expected"); - message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.fromObject(object.tokenConfigUpdate); - } - if (object.updatePrice != null) { - if (typeof object.updatePrice !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.updatePrice: object expected"); - message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.fromObject(object.updatePrice); - } - return message; - }; - - /** - * Creates a plain object from a TokenEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} message TokenEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.mint != null && message.hasOwnProperty("mint")) { - object.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.toObject(message.mint, options); - if (options.oneofs) - object.type = "mint"; - } - if (message.burn != null && message.hasOwnProperty("burn")) { - object.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.toObject(message.burn, options); - if (options.oneofs) - object.type = "burn"; - } - if (message.freeze != null && message.hasOwnProperty("freeze")) { - object.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.toObject(message.freeze, options); - if (options.oneofs) - object.type = "freeze"; - } - if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { - object.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.toObject(message.unfreeze, options); - if (options.oneofs) - object.type = "unfreeze"; - } - if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { - object.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.toObject(message.destroyFrozenFunds, options); - if (options.oneofs) - object.type = "destroyFrozenFunds"; - } - if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { - object.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.toObject(message.emergencyAction, options); - if (options.oneofs) - object.type = "emergencyAction"; - } - if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { - object.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(message.tokenConfigUpdate, options); - if (options.oneofs) - object.type = "tokenConfigUpdate"; - } - if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { - object.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(message.updatePrice, options); - if (options.oneofs) - object.type = "updatePrice"; - } - return object; - }; - - /** - * Converts this TokenEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - * @returns {Object.} JSON object - */ - TokenEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenEvent; - })(); - - GetGroupActionsResponseV0.GroupActionEntry = (function() { - - /** - * Properties of a GroupActionEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IGroupActionEntry - * @property {Uint8Array|null} [actionId] GroupActionEntry actionId - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null} [event] GroupActionEntry event - */ - - /** - * Constructs a new GroupActionEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a GroupActionEntry. - * @implements IGroupActionEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set - */ - function GroupActionEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActionEntry actionId. - * @member {Uint8Array} actionId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @instance - */ - GroupActionEntry.prototype.actionId = $util.newBuffer([]); - - /** - * GroupActionEntry event. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null|undefined} event - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @instance - */ - GroupActionEntry.prototype.event = null; - - /** - * Creates a new GroupActionEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry instance - */ - GroupActionEntry.create = function create(properties) { - return new GroupActionEntry(properties); - }; - - /** - * Encodes the specified GroupActionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.actionId); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupActionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActionEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.actionId = reader.bytes(); - break; - case 2: - message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActionEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActionEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActionEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionId != null && message.hasOwnProperty("actionId")) - if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) - return "actionId: buffer expected"; - if (message.event != null && message.hasOwnProperty("event")) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify(message.event); - if (error) - return "event." + error; - } - return null; - }; - - /** - * Creates a GroupActionEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry - */ - GroupActionEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); - if (object.actionId != null) - if (typeof object.actionId === "string") - $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); - else if (object.actionId.length >= 0) - message.actionId = object.actionId; - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.event: object expected"); - message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.fromObject(object.event); - } - return message; - }; - - /** - * Creates a plain object from a GroupActionEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} message GroupActionEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActionEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.actionId = ""; - else { - object.actionId = []; - if (options.bytes !== Array) - object.actionId = $util.newBuffer(object.actionId); - } - object.event = null; - } - if (message.actionId != null && message.hasOwnProperty("actionId")) - object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; - if (message.event != null && message.hasOwnProperty("event")) - object.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.toObject(message.event, options); - return object; - }; - - /** - * Converts this GroupActionEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @instance - * @returns {Object.} JSON object - */ - GroupActionEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActionEntry; - })(); - - GetGroupActionsResponseV0.GroupActions = (function() { - - /** - * Properties of a GroupActions. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IGroupActions - * @property {Array.|null} [groupActions] GroupActions groupActions - */ - - /** - * Constructs a new GroupActions. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a GroupActions. - * @implements IGroupActions - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set - */ - function GroupActions(properties) { - this.groupActions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActions groupActions. - * @member {Array.} groupActions - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @instance - */ - GroupActions.prototype.groupActions = $util.emptyArray; - - /** - * Creates a new GroupActions instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions instance - */ - GroupActions.create = function create(properties) { - return new GroupActions(properties); - }; - - /** - * Encodes the specified GroupActions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupActions != null && message.groupActions.length) - for (var i = 0; i < message.groupActions.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.encode(message.groupActions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupActions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActions message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.groupActions && message.groupActions.length)) - message.groupActions = []; - message.groupActions.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActions message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupActions != null && message.hasOwnProperty("groupActions")) { - if (!Array.isArray(message.groupActions)) - return "groupActions: array expected"; - for (var i = 0; i < message.groupActions.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify(message.groupActions[i]); - if (error) - return "groupActions." + error; - } - } - return null; - }; - - /** - * Creates a GroupActions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions - */ - GroupActions.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); - if (object.groupActions) { - if (!Array.isArray(object.groupActions)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: array expected"); - message.groupActions = []; - for (var i = 0; i < object.groupActions.length; ++i) { - if (typeof object.groupActions[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: object expected"); - message.groupActions[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.fromObject(object.groupActions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GroupActions message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} message GroupActions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupActions = []; - if (message.groupActions && message.groupActions.length) { - object.groupActions = []; - for (var j = 0; j < message.groupActions.length; ++j) - object.groupActions[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.toObject(message.groupActions[j], options); - } - return object; - }; - - /** - * Converts this GroupActions to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @instance - * @returns {Object.} JSON object - */ - GroupActions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActions; - })(); - - return GetGroupActionsResponseV0; - })(); - - return GetGroupActionsResponse; - })(); - - v0.GetGroupActionSignersRequest = (function() { - - /** - * Properties of a GetGroupActionSignersRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupActionSignersRequest - * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null} [v0] GetGroupActionSignersRequest v0 - */ - - /** - * Constructs a new GetGroupActionSignersRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupActionSignersRequest. - * @implements IGetGroupActionSignersRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set - */ - function GetGroupActionSignersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionSignersRequest v0. - * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @instance - */ - GetGroupActionSignersRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionSignersRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @instance - */ - Object.defineProperty(GetGroupActionSignersRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionSignersRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest instance - */ - GetGroupActionSignersRequest.create = function create(properties) { - return new GetGroupActionSignersRequest(properties); - }; - - /** - * Encodes the specified GetGroupActionSignersRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionSignersRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionSignersRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionSignersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupActionSignersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest - */ - GetGroupActionSignersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionSignersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} message GetGroupActionSignersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionSignersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupActionSignersRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionSignersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * ActionStatus enum. - * @name org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus - * @enum {number} - * @property {number} ACTIVE=0 ACTIVE value - * @property {number} CLOSED=1 CLOSED value - */ - GetGroupActionSignersRequest.ActionStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTIVE"] = 0; - values[valuesById[1] = "CLOSED"] = 1; - return values; - })(); - - GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 = (function() { - - /** - * Properties of a GetGroupActionSignersRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @interface IGetGroupActionSignersRequestV0 - * @property {Uint8Array|null} [contractId] GetGroupActionSignersRequestV0 contractId - * @property {number|null} [groupContractPosition] GetGroupActionSignersRequestV0 groupContractPosition - * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus|null} [status] GetGroupActionSignersRequestV0 status - * @property {Uint8Array|null} [actionId] GetGroupActionSignersRequestV0 actionId - * @property {boolean|null} [prove] GetGroupActionSignersRequestV0 prove - */ - - /** - * Constructs a new GetGroupActionSignersRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @classdesc Represents a GetGroupActionSignersRequestV0. - * @implements IGetGroupActionSignersRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set - */ - function GetGroupActionSignersRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionSignersRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetGroupActionSignersRequestV0 groupContractPosition. - * @member {number} groupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.groupContractPosition = 0; - - /** - * GetGroupActionSignersRequestV0 status. - * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus} status - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.status = 0; - - /** - * GetGroupActionSignersRequestV0 actionId. - * @member {Uint8Array} actionId - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.actionId = $util.newBuffer([]); - - /** - * GetGroupActionSignersRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.prove = false; - - /** - * Creates a new GetGroupActionSignersRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 instance - */ - GetGroupActionSignersRequestV0.create = function create(properties) { - return new GetGroupActionSignersRequestV0(properties); - }; - - /** - * Encodes the specified GetGroupActionSignersRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.actionId); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetGroupActionSignersRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.groupContractPosition = reader.uint32(); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.actionId = reader.bytes(); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionSignersRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionSignersRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - if (!$util.isInteger(message.groupContractPosition)) - return "groupContractPosition: integer expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - break; - } - if (message.actionId != null && message.hasOwnProperty("actionId")) - if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) - return "actionId: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetGroupActionSignersRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 - */ - GetGroupActionSignersRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.groupContractPosition != null) - message.groupContractPosition = object.groupContractPosition >>> 0; - switch (object.status) { - case "ACTIVE": - case 0: - message.status = 0; - break; - case "CLOSED": - case 1: - message.status = 1; - break; - } - if (object.actionId != null) - if (typeof object.actionId === "string") - $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); - else if (object.actionId.length >= 0) - message.actionId = object.actionId; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetGroupActionSignersRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionSignersRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.groupContractPosition = 0; - object.status = options.enums === String ? "ACTIVE" : 0; - if (options.bytes === String) - object.actionId = ""; - else { - object.actionId = []; - if (options.bytes !== Array) - object.actionId = $util.newBuffer(object.actionId); - } - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - object.groupContractPosition = message.groupContractPosition; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus[message.status] : message.status; - if (message.actionId != null && message.hasOwnProperty("actionId")) - object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetGroupActionSignersRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionSignersRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetGroupActionSignersRequestV0; - })(); - - return GetGroupActionSignersRequest; - })(); - - v0.GetGroupActionSignersResponse = (function() { - - /** - * Properties of a GetGroupActionSignersResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupActionSignersResponse - * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null} [v0] GetGroupActionSignersResponse v0 - */ - - /** - * Constructs a new GetGroupActionSignersResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupActionSignersResponse. - * @implements IGetGroupActionSignersResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set - */ - function GetGroupActionSignersResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionSignersResponse v0. - * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @instance - */ - GetGroupActionSignersResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionSignersResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @instance - */ - Object.defineProperty(GetGroupActionSignersResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionSignersResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse instance - */ - GetGroupActionSignersResponse.create = function create(properties) { - return new GetGroupActionSignersResponse(properties); - }; - - /** - * Encodes the specified GetGroupActionSignersResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionSignersResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionSignersResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionSignersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupActionSignersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse - */ - GetGroupActionSignersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionSignersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} message GetGroupActionSignersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionSignersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupActionSignersResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionSignersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 = (function() { - - /** - * Properties of a GetGroupActionSignersResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @interface IGetGroupActionSignersResponseV0 - * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null} [groupActionSigners] GetGroupActionSignersResponseV0 groupActionSigners - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionSignersResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionSignersResponseV0 metadata - */ - - /** - * Constructs a new GetGroupActionSignersResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @classdesc Represents a GetGroupActionSignersResponseV0. - * @implements IGetGroupActionSignersResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set - */ - function GetGroupActionSignersResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionSignersResponseV0 groupActionSigners. - * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null|undefined} groupActionSigners - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - */ - GetGroupActionSignersResponseV0.prototype.groupActionSigners = null; - - /** - * GetGroupActionSignersResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - */ - GetGroupActionSignersResponseV0.prototype.proof = null; - - /** - * GetGroupActionSignersResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - */ - GetGroupActionSignersResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionSignersResponseV0 result. - * @member {"groupActionSigners"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - */ - Object.defineProperty(GetGroupActionSignersResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["groupActionSigners", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionSignersResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 instance - */ - GetGroupActionSignersResponseV0.create = function create(properties) { - return new GetGroupActionSignersResponseV0(properties); - }; - - /** - * Encodes the specified GetGroupActionSignersResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupActionSigners != null && Object.hasOwnProperty.call(message, "groupActionSigners")) - $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.encode(message.groupActionSigners, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionSignersResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionSignersResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionSignersResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify(message.groupActionSigners); - if (error) - return "groupActionSigners." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetGroupActionSignersResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 - */ - GetGroupActionSignersResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); - if (object.groupActionSigners != null) { - if (typeof object.groupActionSigners !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.groupActionSigners: object expected"); - message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.fromObject(object.groupActionSigners); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionSignersResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionSignersResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { - object.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.toObject(message.groupActionSigners, options); - if (options.oneofs) - object.result = "groupActionSigners"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetGroupActionSignersResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionSignersResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupActionSignersResponseV0.GroupActionSigner = (function() { - - /** - * Properties of a GroupActionSigner. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @interface IGroupActionSigner - * @property {Uint8Array|null} [signerId] GroupActionSigner signerId - * @property {number|null} [power] GroupActionSigner power - */ - - /** - * Constructs a new GroupActionSigner. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @classdesc Represents a GroupActionSigner. - * @implements IGroupActionSigner - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set - */ - function GroupActionSigner(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActionSigner signerId. - * @member {Uint8Array} signerId - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @instance - */ - GroupActionSigner.prototype.signerId = $util.newBuffer([]); - - /** - * GroupActionSigner power. - * @member {number} power - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @instance - */ - GroupActionSigner.prototype.power = 0; - - /** - * Creates a new GroupActionSigner instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner instance - */ - GroupActionSigner.create = function create(properties) { - return new GroupActionSigner(properties); - }; - - /** - * Encodes the specified GroupActionSigner message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionSigner.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signerId != null && Object.hasOwnProperty.call(message, "signerId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signerId); - if (message.power != null && Object.hasOwnProperty.call(message, "power")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); - return writer; - }; - - /** - * Encodes the specified GroupActionSigner message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionSigner.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActionSigner message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionSigner.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signerId = reader.bytes(); - break; - case 2: - message.power = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActionSigner message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionSigner.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActionSigner message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActionSigner.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signerId != null && message.hasOwnProperty("signerId")) - if (!(message.signerId && typeof message.signerId.length === "number" || $util.isString(message.signerId))) - return "signerId: buffer expected"; - if (message.power != null && message.hasOwnProperty("power")) - if (!$util.isInteger(message.power)) - return "power: integer expected"; - return null; - }; - - /** - * Creates a GroupActionSigner message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner - */ - GroupActionSigner.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); - if (object.signerId != null) - if (typeof object.signerId === "string") - $util.base64.decode(object.signerId, message.signerId = $util.newBuffer($util.base64.length(object.signerId)), 0); - else if (object.signerId.length >= 0) - message.signerId = object.signerId; - if (object.power != null) - message.power = object.power >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupActionSigner message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} message GroupActionSigner - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActionSigner.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signerId = ""; - else { - object.signerId = []; - if (options.bytes !== Array) - object.signerId = $util.newBuffer(object.signerId); - } - object.power = 0; - } - if (message.signerId != null && message.hasOwnProperty("signerId")) - object.signerId = options.bytes === String ? $util.base64.encode(message.signerId, 0, message.signerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.signerId) : message.signerId; - if (message.power != null && message.hasOwnProperty("power")) - object.power = message.power; - return object; - }; - - /** - * Converts this GroupActionSigner to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @instance - * @returns {Object.} JSON object - */ - GroupActionSigner.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActionSigner; - })(); - - GetGroupActionSignersResponseV0.GroupActionSigners = (function() { - - /** - * Properties of a GroupActionSigners. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @interface IGroupActionSigners - * @property {Array.|null} [signers] GroupActionSigners signers - */ - - /** - * Constructs a new GroupActionSigners. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @classdesc Represents a GroupActionSigners. - * @implements IGroupActionSigners - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set - */ - function GroupActionSigners(properties) { - this.signers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActionSigners signers. - * @member {Array.} signers - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @instance - */ - GroupActionSigners.prototype.signers = $util.emptyArray; - - /** - * Creates a new GroupActionSigners instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners instance - */ - GroupActionSigners.create = function create(properties) { - return new GroupActionSigners(properties); - }; - - /** - * Encodes the specified GroupActionSigners message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionSigners.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signers != null && message.signers.length) - for (var i = 0; i < message.signers.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.encode(message.signers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupActionSigners message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionSigners.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActionSigners message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionSigners.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.signers && message.signers.length)) - message.signers = []; - message.signers.push($root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActionSigners message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionSigners.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActionSigners message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActionSigners.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signers != null && message.hasOwnProperty("signers")) { - if (!Array.isArray(message.signers)) - return "signers: array expected"; - for (var i = 0; i < message.signers.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify(message.signers[i]); - if (error) - return "signers." + error; - } - } - return null; - }; - - /** - * Creates a GroupActionSigners message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners - */ - GroupActionSigners.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); - if (object.signers) { - if (!Array.isArray(object.signers)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: array expected"); - message.signers = []; - for (var i = 0; i < object.signers.length; ++i) { - if (typeof object.signers[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: object expected"); - message.signers[i] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.fromObject(object.signers[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GroupActionSigners message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} message GroupActionSigners - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActionSigners.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.signers = []; - if (message.signers && message.signers.length) { - object.signers = []; - for (var j = 0; j < message.signers.length; ++j) - object.signers[j] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.toObject(message.signers[j], options); - } - return object; - }; - - /** - * Converts this GroupActionSigners to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @instance - * @returns {Object.} JSON object - */ - GroupActionSigners.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActionSigners; - })(); - - return GetGroupActionSignersResponseV0; - })(); - - return GetGroupActionSignersResponse; - })(); - - return v0; - })(); - - return dapi; - })(); - - return platform; - })(); - - return dash; - })(); - - return org; -})(); - -$root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BytesValue; - })(); - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(properties) { - this.fields = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) - return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.Struct} message Struct - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Struct.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Struct; - })(); - - protobuf.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ - - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = 0; - - /** - * Value numberValue. - * @member {number} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = 0; - - /** - * Value stringValue. - * @member {string} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = ""; - - /** - * Value boolValue. - * @member {boolean} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = false; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nullValue = reader.int32(); - break; - case 2: - message.numberValue = reader.double(); - break; - case 3: - message.stringValue = reader.string(); - break; - case 4: - message.boolValue = reader.bool(); - break; - case 5: - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 6: - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) - return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); - - protobuf.ListValue = (function() { - - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ - - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; - - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue - */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) - return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListValue; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - - return protobuf; - })(); - - return google; -})(); - module.exports = $root; diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js index c913724c5ac..dfbcb436b02 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -9,70802 +9,4 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut // Exported root namespace var $root = $protobuf.roots.platform_root || ($protobuf.roots.platform_root = {}); -$root.org = (function() { - - /** - * Namespace org. - * @exports org - * @namespace - */ - var org = {}; - - org.dash = (function() { - - /** - * Namespace dash. - * @memberof org - * @namespace - */ - var dash = {}; - - dash.platform = (function() { - - /** - * Namespace platform. - * @memberof org.dash - * @namespace - */ - var platform = {}; - - platform.dapi = (function() { - - /** - * Namespace dapi. - * @memberof org.dash.platform - * @namespace - */ - var dapi = {}; - - dapi.v0 = (function() { - - /** - * Namespace v0. - * @memberof org.dash.platform.dapi - * @namespace - */ - var v0 = {}; - - v0.Platform = (function() { - - /** - * Constructs a new Platform service. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a Platform - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Platform(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Platform.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Platform; - - /** - * Creates new Platform service using the specified rpc implementation. - * @function create - * @memberof org.dash.platform.dapi.v0.Platform - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Platform} RPC service. Useful where requests and/or responses are streamed. - */ - Platform.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#broadcastStateTransition}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef broadcastStateTransitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} [response] BroadcastStateTransitionResponse - */ - - /** - * Calls broadcastStateTransition. - * @function broadcastStateTransition - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.broadcastStateTransitionCallback} callback Node-style callback called with the error, if any, and BroadcastStateTransitionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.broadcastStateTransition = function broadcastStateTransition(request, callback) { - return this.rpcCall(broadcastStateTransition, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse, request, callback); - }, "name", { value: "broadcastStateTransition" }); - - /** - * Calls broadcastStateTransition. - * @function broadcastStateTransition - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentity}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityResponse} [response] GetIdentityResponse - */ - - /** - * Calls getIdentity. - * @function getIdentity - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityCallback} callback Node-style callback called with the error, if any, and GetIdentityResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentity = function getIdentity(request, callback) { - return this.rpcCall(getIdentity, $root.org.dash.platform.dapi.v0.GetIdentityRequest, $root.org.dash.platform.dapi.v0.GetIdentityResponse, request, callback); - }, "name", { value: "getIdentity" }); - - /** - * Calls getIdentity. - * @function getIdentity - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityKeys}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityKeysCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} [response] GetIdentityKeysResponse - */ - - /** - * Calls getIdentityKeys. - * @function getIdentityKeys - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityKeysCallback} callback Node-style callback called with the error, if any, and GetIdentityKeysResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityKeys = function getIdentityKeys(request, callback) { - return this.rpcCall(getIdentityKeys, $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse, request, callback); - }, "name", { value: "getIdentityKeys" }); - - /** - * Calls getIdentityKeys. - * @function getIdentityKeys - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesContractKeys}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentitiesContractKeysCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} [response] GetIdentitiesContractKeysResponse - */ - - /** - * Calls getIdentitiesContractKeys. - * @function getIdentitiesContractKeys - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesContractKeysCallback} callback Node-style callback called with the error, if any, and GetIdentitiesContractKeysResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentitiesContractKeys = function getIdentitiesContractKeys(request, callback) { - return this.rpcCall(getIdentitiesContractKeys, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse, request, callback); - }, "name", { value: "getIdentitiesContractKeys" }); - - /** - * Calls getIdentitiesContractKeys. - * @function getIdentitiesContractKeys - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityNonce}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityNonceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} [response] GetIdentityNonceResponse - */ - - /** - * Calls getIdentityNonce. - * @function getIdentityNonce - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityNonceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityNonce = function getIdentityNonce(request, callback) { - return this.rpcCall(getIdentityNonce, $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse, request, callback); - }, "name", { value: "getIdentityNonce" }); - - /** - * Calls getIdentityNonce. - * @function getIdentityNonce - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityContractNonce}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityContractNonceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} [response] GetIdentityContractNonceResponse - */ - - /** - * Calls getIdentityContractNonce. - * @function getIdentityContractNonce - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityContractNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityContractNonceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityContractNonce = function getIdentityContractNonce(request, callback) { - return this.rpcCall(getIdentityContractNonce, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse, request, callback); - }, "name", { value: "getIdentityContractNonce" }); - - /** - * Calls getIdentityContractNonce. - * @function getIdentityContractNonce - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalance}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityBalanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} [response] GetIdentityBalanceResponse - */ - - /** - * Calls getIdentityBalance. - * @function getIdentityBalance - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityBalance = function getIdentityBalance(request, callback) { - return this.rpcCall(getIdentityBalance, $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse, request, callback); - }, "name", { value: "getIdentityBalance" }); - - /** - * Calls getIdentityBalance. - * @function getIdentityBalance - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesBalances}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentitiesBalancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} [response] GetIdentitiesBalancesResponse - */ - - /** - * Calls getIdentitiesBalances. - * @function getIdentitiesBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesBalancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentitiesBalances = function getIdentitiesBalances(request, callback) { - return this.rpcCall(getIdentitiesBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse, request, callback); - }, "name", { value: "getIdentitiesBalances" }); - - /** - * Calls getIdentitiesBalances. - * @function getIdentitiesBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalanceAndRevision}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityBalanceAndRevisionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} [response] GetIdentityBalanceAndRevisionResponse - */ - - /** - * Calls getIdentityBalanceAndRevision. - * @function getIdentityBalanceAndRevision - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceAndRevisionCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceAndRevisionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(request, callback) { - return this.rpcCall(getIdentityBalanceAndRevision, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse, request, callback); - }, "name", { value: "getIdentityBalanceAndRevision" }); - - /** - * Calls getIdentityBalanceAndRevision. - * @function getIdentityBalanceAndRevision - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByIds}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getEvonodesProposedEpochBlocksByIdsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse - */ - - /** - * Calls getEvonodesProposedEpochBlocksByIds. - * @function getEvonodesProposedEpochBlocksByIds - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByIdsCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByIds = function getEvonodesProposedEpochBlocksByIds(request, callback) { - return this.rpcCall(getEvonodesProposedEpochBlocksByIds, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); - }, "name", { value: "getEvonodesProposedEpochBlocksByIds" }); - - /** - * Calls getEvonodesProposedEpochBlocksByIds. - * @function getEvonodesProposedEpochBlocksByIds - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByRange}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getEvonodesProposedEpochBlocksByRangeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse - */ - - /** - * Calls getEvonodesProposedEpochBlocksByRange. - * @function getEvonodesProposedEpochBlocksByRange - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByRangeCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByRange = function getEvonodesProposedEpochBlocksByRange(request, callback) { - return this.rpcCall(getEvonodesProposedEpochBlocksByRange, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); - }, "name", { value: "getEvonodesProposedEpochBlocksByRange" }); - - /** - * Calls getEvonodesProposedEpochBlocksByRange. - * @function getEvonodesProposedEpochBlocksByRange - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContract}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDataContractCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDataContractResponse} [response] GetDataContractResponse - */ - - /** - * Calls getDataContract. - * @function getDataContract - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDataContractCallback} callback Node-style callback called with the error, if any, and GetDataContractResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDataContract = function getDataContract(request, callback) { - return this.rpcCall(getDataContract, $root.org.dash.platform.dapi.v0.GetDataContractRequest, $root.org.dash.platform.dapi.v0.GetDataContractResponse, request, callback); - }, "name", { value: "getDataContract" }); - - /** - * Calls getDataContract. - * @function getDataContract - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContractHistory}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDataContractHistoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} [response] GetDataContractHistoryResponse - */ - - /** - * Calls getDataContractHistory. - * @function getDataContractHistory - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDataContractHistoryCallback} callback Node-style callback called with the error, if any, and GetDataContractHistoryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDataContractHistory = function getDataContractHistory(request, callback) { - return this.rpcCall(getDataContractHistory, $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest, $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse, request, callback); - }, "name", { value: "getDataContractHistory" }); - - /** - * Calls getDataContractHistory. - * @function getDataContractHistory - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContracts}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDataContractsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} [response] GetDataContractsResponse - */ - - /** - * Calls getDataContracts. - * @function getDataContracts - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDataContractsCallback} callback Node-style callback called with the error, if any, and GetDataContractsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDataContracts = function getDataContracts(request, callback) { - return this.rpcCall(getDataContracts, $root.org.dash.platform.dapi.v0.GetDataContractsRequest, $root.org.dash.platform.dapi.v0.GetDataContractsResponse, request, callback); - }, "name", { value: "getDataContracts" }); - - /** - * Calls getDataContracts. - * @function getDataContracts - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDocuments}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} [response] GetDocumentsResponse - */ - - /** - * Calls getDocuments. - * @function getDocuments - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getDocumentsCallback} callback Node-style callback called with the error, if any, and GetDocumentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getDocuments = function getDocuments(request, callback) { - return this.rpcCall(getDocuments, $root.org.dash.platform.dapi.v0.GetDocumentsRequest, $root.org.dash.platform.dapi.v0.GetDocumentsResponse, request, callback); - }, "name", { value: "getDocuments" }); - - /** - * Calls getDocuments. - * @function getDocuments - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityByPublicKeyHash}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityByPublicKeyHashCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} [response] GetIdentityByPublicKeyHashResponse - */ - - /** - * Calls getIdentityByPublicKeyHash. - * @function getIdentityByPublicKeyHash - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHashCallback} callback Node-style callback called with the error, if any, and GetIdentityByPublicKeyHashResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityByPublicKeyHash = function getIdentityByPublicKeyHash(request, callback) { - return this.rpcCall(getIdentityByPublicKeyHash, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse, request, callback); - }, "name", { value: "getIdentityByPublicKeyHash" }); - - /** - * Calls getIdentityByPublicKeyHash. - * @function getIdentityByPublicKeyHash - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#waitForStateTransitionResult}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef waitForStateTransitionResultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} [response] WaitForStateTransitionResultResponse - */ - - /** - * Calls waitForStateTransitionResult. - * @function waitForStateTransitionResult - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.waitForStateTransitionResultCallback} callback Node-style callback called with the error, if any, and WaitForStateTransitionResultResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.waitForStateTransitionResult = function waitForStateTransitionResult(request, callback) { - return this.rpcCall(waitForStateTransitionResult, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, request, callback); - }, "name", { value: "waitForStateTransitionResult" }); - - /** - * Calls waitForStateTransitionResult. - * @function waitForStateTransitionResult - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getConsensusParams}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getConsensusParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} [response] GetConsensusParamsResponse - */ - - /** - * Calls getConsensusParams. - * @function getConsensusParams - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getConsensusParamsCallback} callback Node-style callback called with the error, if any, and GetConsensusParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getConsensusParams = function getConsensusParams(request, callback) { - return this.rpcCall(getConsensusParams, $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest, $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse, request, callback); - }, "name", { value: "getConsensusParams" }); - - /** - * Calls getConsensusParams. - * @function getConsensusParams - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeState}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getProtocolVersionUpgradeStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} [response] GetProtocolVersionUpgradeStateResponse - */ - - /** - * Calls getProtocolVersionUpgradeState. - * @function getProtocolVersionUpgradeState - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeStateCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeState = function getProtocolVersionUpgradeState(request, callback) { - return this.rpcCall(getProtocolVersionUpgradeState, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse, request, callback); - }, "name", { value: "getProtocolVersionUpgradeState" }); - - /** - * Calls getProtocolVersionUpgradeState. - * @function getProtocolVersionUpgradeState - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeVoteStatus}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getProtocolVersionUpgradeVoteStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} [response] GetProtocolVersionUpgradeVoteStatusResponse - */ - - /** - * Calls getProtocolVersionUpgradeVoteStatus. - * @function getProtocolVersionUpgradeVoteStatus - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeVoteStatusCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeVoteStatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeVoteStatus = function getProtocolVersionUpgradeVoteStatus(request, callback) { - return this.rpcCall(getProtocolVersionUpgradeVoteStatus, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse, request, callback); - }, "name", { value: "getProtocolVersionUpgradeVoteStatus" }); - - /** - * Calls getProtocolVersionUpgradeVoteStatus. - * @function getProtocolVersionUpgradeVoteStatus - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEpochsInfo}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getEpochsInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} [response] GetEpochsInfoResponse - */ - - /** - * Calls getEpochsInfo. - * @function getEpochsInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getEpochsInfoCallback} callback Node-style callback called with the error, if any, and GetEpochsInfoResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getEpochsInfo = function getEpochsInfo(request, callback) { - return this.rpcCall(getEpochsInfo, $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest, $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse, request, callback); - }, "name", { value: "getEpochsInfo" }); - - /** - * Calls getEpochsInfo. - * @function getEpochsInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResources}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getContestedResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} [response] GetContestedResourcesResponse - */ - - /** - * Calls getContestedResources. - * @function getContestedResources - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getContestedResourcesCallback} callback Node-style callback called with the error, if any, and GetContestedResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getContestedResources = function getContestedResources(request, callback) { - return this.rpcCall(getContestedResources, $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse, request, callback); - }, "name", { value: "getContestedResources" }); - - /** - * Calls getContestedResources. - * @function getContestedResources - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVoteState}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getContestedResourceVoteStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} [response] GetContestedResourceVoteStateResponse - */ - - /** - * Calls getContestedResourceVoteState. - * @function getContestedResourceVoteState - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVoteStateCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVoteStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getContestedResourceVoteState = function getContestedResourceVoteState(request, callback) { - return this.rpcCall(getContestedResourceVoteState, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse, request, callback); - }, "name", { value: "getContestedResourceVoteState" }); - - /** - * Calls getContestedResourceVoteState. - * @function getContestedResourceVoteState - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVotersForIdentity}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getContestedResourceVotersForIdentityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} [response] GetContestedResourceVotersForIdentityResponse - */ - - /** - * Calls getContestedResourceVotersForIdentity. - * @function getContestedResourceVotersForIdentity - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVotersForIdentityCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVotersForIdentityResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getContestedResourceVotersForIdentity = function getContestedResourceVotersForIdentity(request, callback) { - return this.rpcCall(getContestedResourceVotersForIdentity, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse, request, callback); - }, "name", { value: "getContestedResourceVotersForIdentity" }); - - /** - * Calls getContestedResourceVotersForIdentity. - * @function getContestedResourceVotersForIdentity - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceIdentityVotes}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getContestedResourceIdentityVotesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} [response] GetContestedResourceIdentityVotesResponse - */ - - /** - * Calls getContestedResourceIdentityVotes. - * @function getContestedResourceIdentityVotes - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceIdentityVotesCallback} callback Node-style callback called with the error, if any, and GetContestedResourceIdentityVotesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getContestedResourceIdentityVotes = function getContestedResourceIdentityVotes(request, callback) { - return this.rpcCall(getContestedResourceIdentityVotes, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse, request, callback); - }, "name", { value: "getContestedResourceIdentityVotes" }); - - /** - * Calls getContestedResourceIdentityVotes. - * @function getContestedResourceIdentityVotes - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getVotePollsByEndDate}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getVotePollsByEndDateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} [response] GetVotePollsByEndDateResponse - */ - - /** - * Calls getVotePollsByEndDate. - * @function getVotePollsByEndDate - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getVotePollsByEndDateCallback} callback Node-style callback called with the error, if any, and GetVotePollsByEndDateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getVotePollsByEndDate = function getVotePollsByEndDate(request, callback) { - return this.rpcCall(getVotePollsByEndDate, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse, request, callback); - }, "name", { value: "getVotePollsByEndDate" }); - - /** - * Calls getVotePollsByEndDate. - * @function getVotePollsByEndDate - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPrefundedSpecializedBalance}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getPrefundedSpecializedBalanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} [response] GetPrefundedSpecializedBalanceResponse - */ - - /** - * Calls getPrefundedSpecializedBalance. - * @function getPrefundedSpecializedBalance - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getPrefundedSpecializedBalanceCallback} callback Node-style callback called with the error, if any, and GetPrefundedSpecializedBalanceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getPrefundedSpecializedBalance = function getPrefundedSpecializedBalance(request, callback) { - return this.rpcCall(getPrefundedSpecializedBalance, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse, request, callback); - }, "name", { value: "getPrefundedSpecializedBalance" }); - - /** - * Calls getPrefundedSpecializedBalance. - * @function getPrefundedSpecializedBalance - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTotalCreditsInPlatform}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTotalCreditsInPlatformCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} [response] GetTotalCreditsInPlatformResponse - */ - - /** - * Calls getTotalCreditsInPlatform. - * @function getTotalCreditsInPlatform - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTotalCreditsInPlatformCallback} callback Node-style callback called with the error, if any, and GetTotalCreditsInPlatformResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTotalCreditsInPlatform = function getTotalCreditsInPlatform(request, callback) { - return this.rpcCall(getTotalCreditsInPlatform, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse, request, callback); - }, "name", { value: "getTotalCreditsInPlatform" }); - - /** - * Calls getTotalCreditsInPlatform. - * @function getTotalCreditsInPlatform - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPathElements}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getPathElementsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} [response] GetPathElementsResponse - */ - - /** - * Calls getPathElements. - * @function getPathElements - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getPathElementsCallback} callback Node-style callback called with the error, if any, and GetPathElementsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getPathElements = function getPathElements(request, callback) { - return this.rpcCall(getPathElements, $root.org.dash.platform.dapi.v0.GetPathElementsRequest, $root.org.dash.platform.dapi.v0.GetPathElementsResponse, request, callback); - }, "name", { value: "getPathElements" }); - - /** - * Calls getPathElements. - * @function getPathElements - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getStatus}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetStatusResponse} [response] GetStatusResponse - */ - - /** - * Calls getStatus. - * @function getStatus - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getStatusCallback} callback Node-style callback called with the error, if any, and GetStatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getStatus = function getStatus(request, callback) { - return this.rpcCall(getStatus, $root.org.dash.platform.dapi.v0.GetStatusRequest, $root.org.dash.platform.dapi.v0.GetStatusResponse, request, callback); - }, "name", { value: "getStatus" }); - - /** - * Calls getStatus. - * @function getStatus - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getCurrentQuorumsInfo}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getCurrentQuorumsInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} [response] GetCurrentQuorumsInfoResponse - */ - - /** - * Calls getCurrentQuorumsInfo. - * @function getCurrentQuorumsInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfoCallback} callback Node-style callback called with the error, if any, and GetCurrentQuorumsInfoResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(request, callback) { - return this.rpcCall(getCurrentQuorumsInfo, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse, request, callback); - }, "name", { value: "getCurrentQuorumsInfo" }); - - /** - * Calls getCurrentQuorumsInfo. - * @function getCurrentQuorumsInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenBalances}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityTokenBalancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} [response] GetIdentityTokenBalancesResponse - */ - - /** - * Calls getIdentityTokenBalances. - * @function getIdentityTokenBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenBalancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityTokenBalances = function getIdentityTokenBalances(request, callback) { - return this.rpcCall(getIdentityTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse, request, callback); - }, "name", { value: "getIdentityTokenBalances" }); - - /** - * Calls getIdentityTokenBalances. - * @function getIdentityTokenBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenBalances}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentitiesTokenBalancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} [response] GetIdentitiesTokenBalancesResponse - */ - - /** - * Calls getIdentitiesTokenBalances. - * @function getIdentitiesTokenBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenBalancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentitiesTokenBalances = function getIdentitiesTokenBalances(request, callback) { - return this.rpcCall(getIdentitiesTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse, request, callback); - }, "name", { value: "getIdentitiesTokenBalances" }); - - /** - * Calls getIdentitiesTokenBalances. - * @function getIdentitiesTokenBalances - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenInfos}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentityTokenInfosCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} [response] GetIdentityTokenInfosResponse - */ - - /** - * Calls getIdentityTokenInfos. - * @function getIdentityTokenInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenInfosResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentityTokenInfos = function getIdentityTokenInfos(request, callback) { - return this.rpcCall(getIdentityTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse, request, callback); - }, "name", { value: "getIdentityTokenInfos" }); - - /** - * Calls getIdentityTokenInfos. - * @function getIdentityTokenInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenInfos}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getIdentitiesTokenInfosCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} [response] GetIdentitiesTokenInfosResponse - */ - - /** - * Calls getIdentitiesTokenInfos. - * @function getIdentitiesTokenInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenInfosResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getIdentitiesTokenInfos = function getIdentitiesTokenInfos(request, callback) { - return this.rpcCall(getIdentitiesTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse, request, callback); - }, "name", { value: "getIdentitiesTokenInfos" }); - - /** - * Calls getIdentitiesTokenInfos. - * @function getIdentitiesTokenInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenStatuses}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTokenStatusesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} [response] GetTokenStatusesResponse - */ - - /** - * Calls getTokenStatuses. - * @function getTokenStatuses - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTokenStatusesCallback} callback Node-style callback called with the error, if any, and GetTokenStatusesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTokenStatuses = function getTokenStatuses(request, callback) { - return this.rpcCall(getTokenStatuses, $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest, $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse, request, callback); - }, "name", { value: "getTokenStatuses" }); - - /** - * Calls getTokenStatuses. - * @function getTokenStatuses - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenDirectPurchasePrices}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTokenDirectPurchasePricesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} [response] GetTokenDirectPurchasePricesResponse - */ - - /** - * Calls getTokenDirectPurchasePrices. - * @function getTokenDirectPurchasePrices - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTokenDirectPurchasePricesCallback} callback Node-style callback called with the error, if any, and GetTokenDirectPurchasePricesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTokenDirectPurchasePrices = function getTokenDirectPurchasePrices(request, callback) { - return this.rpcCall(getTokenDirectPurchasePrices, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, request, callback); - }, "name", { value: "getTokenDirectPurchasePrices" }); - - /** - * Calls getTokenDirectPurchasePrices. - * @function getTokenDirectPurchasePrices - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenPreProgrammedDistributions}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTokenPreProgrammedDistributionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} [response] GetTokenPreProgrammedDistributionsResponse - */ - - /** - * Calls getTokenPreProgrammedDistributions. - * @function getTokenPreProgrammedDistributions - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributionsCallback} callback Node-style callback called with the error, if any, and GetTokenPreProgrammedDistributionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTokenPreProgrammedDistributions = function getTokenPreProgrammedDistributions(request, callback) { - return this.rpcCall(getTokenPreProgrammedDistributions, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse, request, callback); - }, "name", { value: "getTokenPreProgrammedDistributions" }); - - /** - * Calls getTokenPreProgrammedDistributions. - * @function getTokenPreProgrammedDistributions - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenTotalSupply}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getTokenTotalSupplyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} [response] GetTokenTotalSupplyResponse - */ - - /** - * Calls getTokenTotalSupply. - * @function getTokenTotalSupply - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getTokenTotalSupplyCallback} callback Node-style callback called with the error, if any, and GetTokenTotalSupplyResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getTokenTotalSupply = function getTokenTotalSupply(request, callback) { - return this.rpcCall(getTokenTotalSupply, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse, request, callback); - }, "name", { value: "getTokenTotalSupply" }); - - /** - * Calls getTokenTotalSupply. - * @function getTokenTotalSupply - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfo}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getGroupInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} [response] GetGroupInfoResponse - */ - - /** - * Calls getGroupInfo. - * @function getGroupInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getGroupInfoCallback} callback Node-style callback called with the error, if any, and GetGroupInfoResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getGroupInfo = function getGroupInfo(request, callback) { - return this.rpcCall(getGroupInfo, $root.org.dash.platform.dapi.v0.GetGroupInfoRequest, $root.org.dash.platform.dapi.v0.GetGroupInfoResponse, request, callback); - }, "name", { value: "getGroupInfo" }); - - /** - * Calls getGroupInfo. - * @function getGroupInfo - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfos}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getGroupInfosCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} [response] GetGroupInfosResponse - */ - - /** - * Calls getGroupInfos. - * @function getGroupInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getGroupInfosCallback} callback Node-style callback called with the error, if any, and GetGroupInfosResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getGroupInfos = function getGroupInfos(request, callback) { - return this.rpcCall(getGroupInfos, $root.org.dash.platform.dapi.v0.GetGroupInfosRequest, $root.org.dash.platform.dapi.v0.GetGroupInfosResponse, request, callback); - }, "name", { value: "getGroupInfos" }); - - /** - * Calls getGroupInfos. - * @function getGroupInfos - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActions}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getGroupActionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} [response] GetGroupActionsResponse - */ - - /** - * Calls getGroupActions. - * @function getGroupActions - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getGroupActionsCallback} callback Node-style callback called with the error, if any, and GetGroupActionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getGroupActions = function getGroupActions(request, callback) { - return this.rpcCall(getGroupActions, $root.org.dash.platform.dapi.v0.GetGroupActionsRequest, $root.org.dash.platform.dapi.v0.GetGroupActionsResponse, request, callback); - }, "name", { value: "getGroupActions" }); - - /** - * Calls getGroupActions. - * @function getGroupActions - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActionSigners}. - * @memberof org.dash.platform.dapi.v0.Platform - * @typedef getGroupActionSignersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} [response] GetGroupActionSignersResponse - */ - - /** - * Calls getGroupActionSigners. - * @function getGroupActionSigners - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object - * @param {org.dash.platform.dapi.v0.Platform.getGroupActionSignersCallback} callback Node-style callback called with the error, if any, and GetGroupActionSignersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Platform.prototype.getGroupActionSigners = function getGroupActionSigners(request, callback) { - return this.rpcCall(getGroupActionSigners, $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest, $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse, request, callback); - }, "name", { value: "getGroupActionSigners" }); - - /** - * Calls getGroupActionSigners. - * @function getGroupActionSigners - * @memberof org.dash.platform.dapi.v0.Platform - * @instance - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Platform; - })(); - - v0.Proof = (function() { - - /** - * Properties of a Proof. - * @memberof org.dash.platform.dapi.v0 - * @interface IProof - * @property {Uint8Array|null} [grovedbProof] Proof grovedbProof - * @property {Uint8Array|null} [quorumHash] Proof quorumHash - * @property {Uint8Array|null} [signature] Proof signature - * @property {number|null} [round] Proof round - * @property {Uint8Array|null} [blockIdHash] Proof blockIdHash - * @property {number|null} [quorumType] Proof quorumType - */ - - /** - * Constructs a new Proof. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a Proof. - * @implements IProof - * @constructor - * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set - */ - function Proof(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proof grovedbProof. - * @member {Uint8Array} grovedbProof - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.grovedbProof = $util.newBuffer([]); - - /** - * Proof quorumHash. - * @member {Uint8Array} quorumHash - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.quorumHash = $util.newBuffer([]); - - /** - * Proof signature. - * @member {Uint8Array} signature - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.signature = $util.newBuffer([]); - - /** - * Proof round. - * @member {number} round - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.round = 0; - - /** - * Proof blockIdHash. - * @member {Uint8Array} blockIdHash - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.blockIdHash = $util.newBuffer([]); - - /** - * Proof quorumType. - * @member {number} quorumType - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - */ - Proof.prototype.quorumType = 0; - - /** - * Creates a new Proof instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.Proof} Proof instance - */ - Proof.create = function create(properties) { - return new Proof(properties); - }; - - /** - * Encodes the specified Proof message. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.grovedbProof != null && Object.hasOwnProperty.call(message, "grovedbProof")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.grovedbProof); - if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.quorumHash); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.round); - if (message.blockIdHash != null && Object.hasOwnProperty.call(message, "blockIdHash")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.blockIdHash); - if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.quorumType); - return writer; - }; - - /** - * Encodes the specified Proof message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proof message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.Proof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.grovedbProof = reader.bytes(); - break; - case 2: - message.quorumHash = reader.bytes(); - break; - case 3: - message.signature = reader.bytes(); - break; - case 4: - message.round = reader.uint32(); - break; - case 5: - message.blockIdHash = reader.bytes(); - break; - case 6: - message.quorumType = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proof message. - * @function verify - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) - if (!(message.grovedbProof && typeof message.grovedbProof.length === "number" || $util.isString(message.grovedbProof))) - return "grovedbProof: buffer expected"; - if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) - if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) - return "quorumHash: buffer expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) - if (!(message.blockIdHash && typeof message.blockIdHash.length === "number" || $util.isString(message.blockIdHash))) - return "blockIdHash: buffer expected"; - if (message.quorumType != null && message.hasOwnProperty("quorumType")) - if (!$util.isInteger(message.quorumType)) - return "quorumType: integer expected"; - return null; - }; - - /** - * Creates a Proof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.Proof} Proof - */ - Proof.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.Proof) - return object; - var message = new $root.org.dash.platform.dapi.v0.Proof(); - if (object.grovedbProof != null) - if (typeof object.grovedbProof === "string") - $util.base64.decode(object.grovedbProof, message.grovedbProof = $util.newBuffer($util.base64.length(object.grovedbProof)), 0); - else if (object.grovedbProof.length >= 0) - message.grovedbProof = object.grovedbProof; - if (object.quorumHash != null) - if (typeof object.quorumHash === "string") - $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); - else if (object.quorumHash.length >= 0) - message.quorumHash = object.quorumHash; - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length >= 0) - message.signature = object.signature; - if (object.round != null) - message.round = object.round >>> 0; - if (object.blockIdHash != null) - if (typeof object.blockIdHash === "string") - $util.base64.decode(object.blockIdHash, message.blockIdHash = $util.newBuffer($util.base64.length(object.blockIdHash)), 0); - else if (object.blockIdHash.length >= 0) - message.blockIdHash = object.blockIdHash; - if (object.quorumType != null) - message.quorumType = object.quorumType >>> 0; - return message; - }; - - /** - * Creates a plain object from a Proof message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.Proof - * @static - * @param {org.dash.platform.dapi.v0.Proof} message Proof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.grovedbProof = ""; - else { - object.grovedbProof = []; - if (options.bytes !== Array) - object.grovedbProof = $util.newBuffer(object.grovedbProof); - } - if (options.bytes === String) - object.quorumHash = ""; - else { - object.quorumHash = []; - if (options.bytes !== Array) - object.quorumHash = $util.newBuffer(object.quorumHash); - } - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.round = 0; - if (options.bytes === String) - object.blockIdHash = ""; - else { - object.blockIdHash = []; - if (options.bytes !== Array) - object.blockIdHash = $util.newBuffer(object.blockIdHash); - } - object.quorumType = 0; - } - if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) - object.grovedbProof = options.bytes === String ? $util.base64.encode(message.grovedbProof, 0, message.grovedbProof.length) : options.bytes === Array ? Array.prototype.slice.call(message.grovedbProof) : message.grovedbProof; - if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) - object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) - object.blockIdHash = options.bytes === String ? $util.base64.encode(message.blockIdHash, 0, message.blockIdHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.blockIdHash) : message.blockIdHash; - if (message.quorumType != null && message.hasOwnProperty("quorumType")) - object.quorumType = message.quorumType; - return object; - }; - - /** - * Converts this Proof to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.Proof - * @instance - * @returns {Object.} JSON object - */ - Proof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proof; - })(); - - v0.ResponseMetadata = (function() { - - /** - * Properties of a ResponseMetadata. - * @memberof org.dash.platform.dapi.v0 - * @interface IResponseMetadata - * @property {number|Long|null} [height] ResponseMetadata height - * @property {number|null} [coreChainLockedHeight] ResponseMetadata coreChainLockedHeight - * @property {number|null} [epoch] ResponseMetadata epoch - * @property {number|Long|null} [timeMs] ResponseMetadata timeMs - * @property {number|null} [protocolVersion] ResponseMetadata protocolVersion - * @property {string|null} [chainId] ResponseMetadata chainId - */ - - /** - * Constructs a new ResponseMetadata. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a ResponseMetadata. - * @implements IResponseMetadata - * @constructor - * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set - */ - function ResponseMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseMetadata height. - * @member {number|Long} height - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ResponseMetadata coreChainLockedHeight. - * @member {number} coreChainLockedHeight - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.coreChainLockedHeight = 0; - - /** - * ResponseMetadata epoch. - * @member {number} epoch - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.epoch = 0; - - /** - * ResponseMetadata timeMs. - * @member {number|Long} timeMs - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.timeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ResponseMetadata protocolVersion. - * @member {number} protocolVersion - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.protocolVersion = 0; - - /** - * ResponseMetadata chainId. - * @member {string} chainId - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - */ - ResponseMetadata.prototype.chainId = ""; - - /** - * Creates a new ResponseMetadata instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata instance - */ - ResponseMetadata.create = function create(properties) { - return new ResponseMetadata(properties); - }; - - /** - * Encodes the specified ResponseMetadata message. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); - if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreChainLockedHeight); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.epoch); - if (message.timeMs != null && Object.hasOwnProperty.call(message, "timeMs")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timeMs); - if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.protocolVersion); - if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.chainId); - return writer; - }; - - /** - * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseMetadata message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.uint64(); - break; - case 2: - message.coreChainLockedHeight = reader.uint32(); - break; - case 3: - message.epoch = reader.uint32(); - break; - case 4: - message.timeMs = reader.uint64(); - break; - case 5: - message.protocolVersion = reader.uint32(); - break; - case 6: - message.chainId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseMetadata message. - * @function verify - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) - if (!$util.isInteger(message.coreChainLockedHeight)) - return "coreChainLockedHeight: integer expected"; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - if (message.timeMs != null && message.hasOwnProperty("timeMs")) - if (!$util.isInteger(message.timeMs) && !(message.timeMs && $util.isInteger(message.timeMs.low) && $util.isInteger(message.timeMs.high))) - return "timeMs: integer|Long expected"; - if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) - if (!$util.isInteger(message.protocolVersion)) - return "protocolVersion: integer expected"; - if (message.chainId != null && message.hasOwnProperty("chainId")) - if (!$util.isString(message.chainId)) - return "chainId: string expected"; - return null; - }; - - /** - * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata - */ - ResponseMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.ResponseMetadata) - return object; - var message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = true; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); - if (object.coreChainLockedHeight != null) - message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; - if (object.epoch != null) - message.epoch = object.epoch >>> 0; - if (object.timeMs != null) - if ($util.Long) - (message.timeMs = $util.Long.fromValue(object.timeMs)).unsigned = true; - else if (typeof object.timeMs === "string") - message.timeMs = parseInt(object.timeMs, 10); - else if (typeof object.timeMs === "number") - message.timeMs = object.timeMs; - else if (typeof object.timeMs === "object") - message.timeMs = new $util.LongBits(object.timeMs.low >>> 0, object.timeMs.high >>> 0).toNumber(true); - if (object.protocolVersion != null) - message.protocolVersion = object.protocolVersion >>> 0; - if (object.chainId != null) - message.chainId = String(object.chainId); - return message; - }; - - /** - * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @static - * @param {org.dash.platform.dapi.v0.ResponseMetadata} message ResponseMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.coreChainLockedHeight = 0; - object.epoch = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeMs = options.longs === String ? "0" : 0; - object.protocolVersion = 0; - object.chainId = ""; - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; - if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) - object.coreChainLockedHeight = message.coreChainLockedHeight; - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - if (message.timeMs != null && message.hasOwnProperty("timeMs")) - if (typeof message.timeMs === "number") - object.timeMs = options.longs === String ? String(message.timeMs) : message.timeMs; - else - object.timeMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeMs) : options.longs === Number ? new $util.LongBits(message.timeMs.low >>> 0, message.timeMs.high >>> 0).toNumber(true) : message.timeMs; - if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) - object.protocolVersion = message.protocolVersion; - if (message.chainId != null && message.hasOwnProperty("chainId")) - object.chainId = message.chainId; - return object; - }; - - /** - * Converts this ResponseMetadata to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.ResponseMetadata - * @instance - * @returns {Object.} JSON object - */ - ResponseMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseMetadata; - })(); - - v0.StateTransitionBroadcastError = (function() { - - /** - * Properties of a StateTransitionBroadcastError. - * @memberof org.dash.platform.dapi.v0 - * @interface IStateTransitionBroadcastError - * @property {number|null} [code] StateTransitionBroadcastError code - * @property {string|null} [message] StateTransitionBroadcastError message - * @property {Uint8Array|null} [data] StateTransitionBroadcastError data - */ - - /** - * Constructs a new StateTransitionBroadcastError. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a StateTransitionBroadcastError. - * @implements IStateTransitionBroadcastError - * @constructor - * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set - */ - function StateTransitionBroadcastError(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StateTransitionBroadcastError code. - * @member {number} code - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @instance - */ - StateTransitionBroadcastError.prototype.code = 0; - - /** - * StateTransitionBroadcastError message. - * @member {string} message - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @instance - */ - StateTransitionBroadcastError.prototype.message = ""; - - /** - * StateTransitionBroadcastError data. - * @member {Uint8Array} data - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @instance - */ - StateTransitionBroadcastError.prototype.data = $util.newBuffer([]); - - /** - * Creates a new StateTransitionBroadcastError instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError instance - */ - StateTransitionBroadcastError.create = function create(properties) { - return new StateTransitionBroadcastError(properties); - }; - - /** - * Encodes the specified StateTransitionBroadcastError message. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateTransitionBroadcastError.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified StateTransitionBroadcastError message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateTransitionBroadcastError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StateTransitionBroadcastError message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateTransitionBroadcastError.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 2: - message.message = reader.string(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StateTransitionBroadcastError message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateTransitionBroadcastError.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StateTransitionBroadcastError message. - * @function verify - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StateTransitionBroadcastError.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a StateTransitionBroadcastError message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError - */ - StateTransitionBroadcastError.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError) - return object; - var message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); - if (object.code != null) - message.code = object.code >>> 0; - if (object.message != null) - message.message = String(object.message); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a StateTransitionBroadcastError message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @static - * @param {org.dash.platform.dapi.v0.StateTransitionBroadcastError} message StateTransitionBroadcastError - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StateTransitionBroadcastError.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.code = 0; - object.message = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this StateTransitionBroadcastError to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError - * @instance - * @returns {Object.} JSON object - */ - StateTransitionBroadcastError.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StateTransitionBroadcastError; - })(); - - /** - * KeyPurpose enum. - * @name org.dash.platform.dapi.v0.KeyPurpose - * @enum {number} - * @property {number} AUTHENTICATION=0 AUTHENTICATION value - * @property {number} ENCRYPTION=1 ENCRYPTION value - * @property {number} DECRYPTION=2 DECRYPTION value - * @property {number} TRANSFER=3 TRANSFER value - * @property {number} VOTING=5 VOTING value - */ - v0.KeyPurpose = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUTHENTICATION"] = 0; - values[valuesById[1] = "ENCRYPTION"] = 1; - values[valuesById[2] = "DECRYPTION"] = 2; - values[valuesById[3] = "TRANSFER"] = 3; - values[valuesById[5] = "VOTING"] = 5; - return values; - })(); - - v0.BroadcastStateTransitionRequest = (function() { - - /** - * Properties of a BroadcastStateTransitionRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IBroadcastStateTransitionRequest - * @property {Uint8Array|null} [stateTransition] BroadcastStateTransitionRequest stateTransition - */ - - /** - * Constructs a new BroadcastStateTransitionRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BroadcastStateTransitionRequest. - * @implements IBroadcastStateTransitionRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set - */ - function BroadcastStateTransitionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BroadcastStateTransitionRequest stateTransition. - * @member {Uint8Array} stateTransition - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @instance - */ - BroadcastStateTransitionRequest.prototype.stateTransition = $util.newBuffer([]); - - /** - * Creates a new BroadcastStateTransitionRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest instance - */ - BroadcastStateTransitionRequest.create = function create(properties) { - return new BroadcastStateTransitionRequest(properties); - }; - - /** - * Encodes the specified BroadcastStateTransitionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastStateTransitionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransition); - return writer; - }; - - /** - * Encodes the specified BroadcastStateTransitionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastStateTransitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastStateTransitionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.stateTransition = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastStateTransitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BroadcastStateTransitionRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BroadcastStateTransitionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) - if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) - return "stateTransition: buffer expected"; - return null; - }; - - /** - * Creates a BroadcastStateTransitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest - */ - BroadcastStateTransitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); - if (object.stateTransition != null) - if (typeof object.stateTransition === "string") - $util.base64.decode(object.stateTransition, message.stateTransition = $util.newBuffer($util.base64.length(object.stateTransition)), 0); - else if (object.stateTransition.length >= 0) - message.stateTransition = object.stateTransition; - return message; - }; - - /** - * Creates a plain object from a BroadcastStateTransitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @static - * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message BroadcastStateTransitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BroadcastStateTransitionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.stateTransition = ""; - else { - object.stateTransition = []; - if (options.bytes !== Array) - object.stateTransition = $util.newBuffer(object.stateTransition); - } - if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) - object.stateTransition = options.bytes === String ? $util.base64.encode(message.stateTransition, 0, message.stateTransition.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransition) : message.stateTransition; - return object; - }; - - /** - * Converts this BroadcastStateTransitionRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest - * @instance - * @returns {Object.} JSON object - */ - BroadcastStateTransitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BroadcastStateTransitionRequest; - })(); - - v0.BroadcastStateTransitionResponse = (function() { - - /** - * Properties of a BroadcastStateTransitionResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IBroadcastStateTransitionResponse - */ - - /** - * Constructs a new BroadcastStateTransitionResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a BroadcastStateTransitionResponse. - * @implements IBroadcastStateTransitionResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set - */ - function BroadcastStateTransitionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new BroadcastStateTransitionResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse instance - */ - BroadcastStateTransitionResponse.create = function create(properties) { - return new BroadcastStateTransitionResponse(properties); - }; - - /** - * Encodes the specified BroadcastStateTransitionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastStateTransitionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified BroadcastStateTransitionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BroadcastStateTransitionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastStateTransitionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BroadcastStateTransitionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BroadcastStateTransitionResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BroadcastStateTransitionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a BroadcastStateTransitionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse - */ - BroadcastStateTransitionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse) - return object; - return new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); - }; - - /** - * Creates a plain object from a BroadcastStateTransitionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @static - * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message BroadcastStateTransitionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BroadcastStateTransitionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this BroadcastStateTransitionResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse - * @instance - * @returns {Object.} JSON object - */ - BroadcastStateTransitionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BroadcastStateTransitionResponse; - })(); - - v0.GetIdentityRequest = (function() { - - /** - * Properties of a GetIdentityRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityRequest - * @property {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null} [v0] GetIdentityRequest v0 - */ - - /** - * Constructs a new GetIdentityRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityRequest. - * @implements IGetIdentityRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set - */ - function GetIdentityRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @instance - */ - GetIdentityRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @instance - */ - Object.defineProperty(GetIdentityRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest instance - */ - GetIdentityRequest.create = function create(properties) { - return new GetIdentityRequest(properties); - }; - - /** - * Encodes the specified GetIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest - */ - GetIdentityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest} message GetIdentityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityRequest.GetIdentityRequestV0 = (function() { - - /** - * Properties of a GetIdentityRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @interface IGetIdentityRequestV0 - * @property {Uint8Array|null} [id] GetIdentityRequestV0 id - * @property {boolean|null} [prove] GetIdentityRequestV0 prove - */ - - /** - * Constructs a new GetIdentityRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest - * @classdesc Represents a GetIdentityRequestV0. - * @implements IGetIdentityRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set - */ - function GetIdentityRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @instance - */ - GetIdentityRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetIdentityRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @instance - */ - GetIdentityRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 instance - */ - GetIdentityRequestV0.create = function create(properties) { - return new GetIdentityRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 - */ - GetIdentityRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} message GetIdentityRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityRequestV0; - })(); - - return GetIdentityRequest; - })(); - - v0.GetIdentityNonceRequest = (function() { - - /** - * Properties of a GetIdentityNonceRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityNonceRequest - * @property {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null} [v0] GetIdentityNonceRequest v0 - */ - - /** - * Constructs a new GetIdentityNonceRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityNonceRequest. - * @implements IGetIdentityNonceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set - */ - function GetIdentityNonceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityNonceRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @instance - */ - GetIdentityNonceRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityNonceRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @instance - */ - Object.defineProperty(GetIdentityNonceRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityNonceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest instance - */ - GetIdentityNonceRequest.create = function create(properties) { - return new GetIdentityNonceRequest(properties); - }; - - /** - * Encodes the specified GetIdentityNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityNonceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityNonceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityNonceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityNonceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityNonceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest - */ - GetIdentityNonceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityNonceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest} message GetIdentityNonceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityNonceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityNonceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityNonceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityNonceRequest.GetIdentityNonceRequestV0 = (function() { - - /** - * Properties of a GetIdentityNonceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @interface IGetIdentityNonceRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityNonceRequestV0 identityId - * @property {boolean|null} [prove] GetIdentityNonceRequestV0 prove - */ - - /** - * Constructs a new GetIdentityNonceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest - * @classdesc Represents a GetIdentityNonceRequestV0. - * @implements IGetIdentityNonceRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set - */ - function GetIdentityNonceRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityNonceRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @instance - */ - GetIdentityNonceRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityNonceRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @instance - */ - GetIdentityNonceRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityNonceRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 instance - */ - GetIdentityNonceRequestV0.create = function create(properties) { - return new GetIdentityNonceRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityNonceRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityNonceRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityNonceRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 - */ - GetIdentityNonceRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityNonceRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityNonceRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityNonceRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityNonceRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityNonceRequestV0; - })(); - - return GetIdentityNonceRequest; - })(); - - v0.GetIdentityContractNonceRequest = (function() { - - /** - * Properties of a GetIdentityContractNonceRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityContractNonceRequest - * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null} [v0] GetIdentityContractNonceRequest v0 - */ - - /** - * Constructs a new GetIdentityContractNonceRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityContractNonceRequest. - * @implements IGetIdentityContractNonceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set - */ - function GetIdentityContractNonceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityContractNonceRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @instance - */ - GetIdentityContractNonceRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityContractNonceRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @instance - */ - Object.defineProperty(GetIdentityContractNonceRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityContractNonceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest instance - */ - GetIdentityContractNonceRequest.create = function create(properties) { - return new GetIdentityContractNonceRequest(properties); - }; - - /** - * Encodes the specified GetIdentityContractNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityContractNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityContractNonceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityContractNonceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityContractNonceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest - */ - GetIdentityContractNonceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityContractNonceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} message GetIdentityContractNonceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityContractNonceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityContractNonceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityContractNonceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 = (function() { - - /** - * Properties of a GetIdentityContractNonceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @interface IGetIdentityContractNonceRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityContractNonceRequestV0 identityId - * @property {Uint8Array|null} [contractId] GetIdentityContractNonceRequestV0 contractId - * @property {boolean|null} [prove] GetIdentityContractNonceRequestV0 prove - */ - - /** - * Constructs a new GetIdentityContractNonceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest - * @classdesc Represents a GetIdentityContractNonceRequestV0. - * @implements IGetIdentityContractNonceRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set - */ - function GetIdentityContractNonceRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityContractNonceRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @instance - */ - GetIdentityContractNonceRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityContractNonceRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @instance - */ - GetIdentityContractNonceRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetIdentityContractNonceRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @instance - */ - GetIdentityContractNonceRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityContractNonceRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 instance - */ - GetIdentityContractNonceRequestV0.create = function create(properties) { - return new GetIdentityContractNonceRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityContractNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityContractNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.contractId = reader.bytes(); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityContractNonceRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityContractNonceRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityContractNonceRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 - */ - GetIdentityContractNonceRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityContractNonceRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityContractNonceRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityContractNonceRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityContractNonceRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityContractNonceRequestV0; - })(); - - return GetIdentityContractNonceRequest; - })(); - - v0.GetIdentityBalanceRequest = (function() { - - /** - * Properties of a GetIdentityBalanceRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityBalanceRequest - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null} [v0] GetIdentityBalanceRequest v0 - */ - - /** - * Constructs a new GetIdentityBalanceRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityBalanceRequest. - * @implements IGetIdentityBalanceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set - */ - function GetIdentityBalanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @instance - */ - GetIdentityBalanceRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @instance - */ - Object.defineProperty(GetIdentityBalanceRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest instance - */ - GetIdentityBalanceRequest.create = function create(properties) { - return new GetIdentityBalanceRequest(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityBalanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest - */ - GetIdentityBalanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} message GetIdentityBalanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityBalanceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 = (function() { - - /** - * Properties of a GetIdentityBalanceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @interface IGetIdentityBalanceRequestV0 - * @property {Uint8Array|null} [id] GetIdentityBalanceRequestV0 id - * @property {boolean|null} [prove] GetIdentityBalanceRequestV0 prove - */ - - /** - * Constructs a new GetIdentityBalanceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest - * @classdesc Represents a GetIdentityBalanceRequestV0. - * @implements IGetIdentityBalanceRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set - */ - function GetIdentityBalanceRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @instance - */ - GetIdentityBalanceRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetIdentityBalanceRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @instance - */ - GetIdentityBalanceRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityBalanceRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 instance - */ - GetIdentityBalanceRequestV0.create = function create(properties) { - return new GetIdentityBalanceRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 - */ - GetIdentityBalanceRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityBalanceRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityBalanceRequestV0; - })(); - - return GetIdentityBalanceRequest; - })(); - - v0.GetIdentityBalanceAndRevisionRequest = (function() { - - /** - * Properties of a GetIdentityBalanceAndRevisionRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityBalanceAndRevisionRequest - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null} [v0] GetIdentityBalanceAndRevisionRequest v0 - */ - - /** - * Constructs a new GetIdentityBalanceAndRevisionRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityBalanceAndRevisionRequest. - * @implements IGetIdentityBalanceAndRevisionRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set - */ - function GetIdentityBalanceAndRevisionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceAndRevisionRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @instance - */ - GetIdentityBalanceAndRevisionRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceAndRevisionRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @instance - */ - Object.defineProperty(GetIdentityBalanceAndRevisionRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceAndRevisionRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest instance - */ - GetIdentityBalanceAndRevisionRequest.create = function create(properties) { - return new GetIdentityBalanceAndRevisionRequest(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceAndRevisionRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceAndRevisionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityBalanceAndRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest - */ - GetIdentityBalanceAndRevisionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceAndRevisionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceAndRevisionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityBalanceAndRevisionRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceAndRevisionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 = (function() { - - /** - * Properties of a GetIdentityBalanceAndRevisionRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @interface IGetIdentityBalanceAndRevisionRequestV0 - * @property {Uint8Array|null} [id] GetIdentityBalanceAndRevisionRequestV0 id - * @property {boolean|null} [prove] GetIdentityBalanceAndRevisionRequestV0 prove - */ - - /** - * Constructs a new GetIdentityBalanceAndRevisionRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest - * @classdesc Represents a GetIdentityBalanceAndRevisionRequestV0. - * @implements IGetIdentityBalanceAndRevisionRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set - */ - function GetIdentityBalanceAndRevisionRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceAndRevisionRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @instance - */ - GetIdentityBalanceAndRevisionRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetIdentityBalanceAndRevisionRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @instance - */ - GetIdentityBalanceAndRevisionRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityBalanceAndRevisionRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 instance - */ - GetIdentityBalanceAndRevisionRequestV0.create = function create(properties) { - return new GetIdentityBalanceAndRevisionRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceAndRevisionRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceAndRevisionRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityBalanceAndRevisionRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 - */ - GetIdentityBalanceAndRevisionRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceAndRevisionRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceAndRevisionRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityBalanceAndRevisionRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceAndRevisionRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityBalanceAndRevisionRequestV0; - })(); - - return GetIdentityBalanceAndRevisionRequest; - })(); - - v0.GetIdentityResponse = (function() { - - /** - * Properties of a GetIdentityResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityResponse - * @property {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null} [v0] GetIdentityResponse v0 - */ - - /** - * Constructs a new GetIdentityResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityResponse. - * @implements IGetIdentityResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set - */ - function GetIdentityResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @instance - */ - GetIdentityResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @instance - */ - Object.defineProperty(GetIdentityResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse instance - */ - GetIdentityResponse.create = function create(properties) { - return new GetIdentityResponse(properties); - }; - - /** - * Encodes the specified GetIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse - */ - GetIdentityResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse} message GetIdentityResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityResponse.GetIdentityResponseV0 = (function() { - - /** - * Properties of a GetIdentityResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @interface IGetIdentityResponseV0 - * @property {Uint8Array|null} [identity] GetIdentityResponseV0 identity - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse - * @classdesc Represents a GetIdentityResponseV0. - * @implements IGetIdentityResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set - */ - function GetIdentityResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityResponseV0 identity. - * @member {Uint8Array} identity - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - */ - GetIdentityResponseV0.prototype.identity = $util.newBuffer([]); - - /** - * GetIdentityResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - */ - GetIdentityResponseV0.prototype.proof = null; - - /** - * GetIdentityResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - */ - GetIdentityResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityResponseV0 result. - * @member {"identity"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 instance - */ - GetIdentityResponseV0.create = function create(properties) { - return new GetIdentityResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identity = reader.bytes(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identity != null && message.hasOwnProperty("identity")) { - properties.result = 1; - if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) - return "identity: buffer expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 - */ - GetIdentityResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); - if (object.identity != null) - if (typeof object.identity === "string") - $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); - else if (object.identity.length >= 0) - message.identity = object.identity; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} message GetIdentityResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identity != null && message.hasOwnProperty("identity")) { - object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; - if (options.oneofs) - object.result = "identity"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityResponseV0; - })(); - - return GetIdentityResponse; - })(); - - v0.GetIdentityNonceResponse = (function() { - - /** - * Properties of a GetIdentityNonceResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityNonceResponse - * @property {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null} [v0] GetIdentityNonceResponse v0 - */ - - /** - * Constructs a new GetIdentityNonceResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityNonceResponse. - * @implements IGetIdentityNonceResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set - */ - function GetIdentityNonceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityNonceResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @instance - */ - GetIdentityNonceResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityNonceResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @instance - */ - Object.defineProperty(GetIdentityNonceResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityNonceResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse instance - */ - GetIdentityNonceResponse.create = function create(properties) { - return new GetIdentityNonceResponse(properties); - }; - - /** - * Encodes the specified GetIdentityNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityNonceResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityNonceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityNonceResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityNonceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityNonceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse - */ - GetIdentityNonceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityNonceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} message GetIdentityNonceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityNonceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityNonceResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityNonceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityNonceResponse.GetIdentityNonceResponseV0 = (function() { - - /** - * Properties of a GetIdentityNonceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @interface IGetIdentityNonceResponseV0 - * @property {number|Long|null} [identityNonce] GetIdentityNonceResponseV0 identityNonce - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityNonceResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityNonceResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityNonceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse - * @classdesc Represents a GetIdentityNonceResponseV0. - * @implements IGetIdentityNonceResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set - */ - function GetIdentityNonceResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityNonceResponseV0 identityNonce. - * @member {number|Long} identityNonce - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - */ - GetIdentityNonceResponseV0.prototype.identityNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetIdentityNonceResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - */ - GetIdentityNonceResponseV0.prototype.proof = null; - - /** - * GetIdentityNonceResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - */ - GetIdentityNonceResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityNonceResponseV0 result. - * @member {"identityNonce"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityNonceResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identityNonce", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityNonceResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 instance - */ - GetIdentityNonceResponseV0.create = function create(properties) { - return new GetIdentityNonceResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityNonce != null && Object.hasOwnProperty.call(message, "identityNonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityNonce); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityNonce = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityNonceResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityNonceResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { - properties.result = 1; - if (!$util.isInteger(message.identityNonce) && !(message.identityNonce && $util.isInteger(message.identityNonce.low) && $util.isInteger(message.identityNonce.high))) - return "identityNonce: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityNonceResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 - */ - GetIdentityNonceResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); - if (object.identityNonce != null) - if ($util.Long) - (message.identityNonce = $util.Long.fromValue(object.identityNonce)).unsigned = true; - else if (typeof object.identityNonce === "string") - message.identityNonce = parseInt(object.identityNonce, 10); - else if (typeof object.identityNonce === "number") - message.identityNonce = object.identityNonce; - else if (typeof object.identityNonce === "object") - message.identityNonce = new $util.LongBits(object.identityNonce.low >>> 0, object.identityNonce.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityNonceResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityNonceResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { - if (typeof message.identityNonce === "number") - object.identityNonce = options.longs === String ? String(message.identityNonce) : message.identityNonce; - else - object.identityNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityNonce) : options.longs === Number ? new $util.LongBits(message.identityNonce.low >>> 0, message.identityNonce.high >>> 0).toNumber(true) : message.identityNonce; - if (options.oneofs) - object.result = "identityNonce"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityNonceResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityNonceResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityNonceResponseV0; - })(); - - return GetIdentityNonceResponse; - })(); - - v0.GetIdentityContractNonceResponse = (function() { - - /** - * Properties of a GetIdentityContractNonceResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityContractNonceResponse - * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null} [v0] GetIdentityContractNonceResponse v0 - */ - - /** - * Constructs a new GetIdentityContractNonceResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityContractNonceResponse. - * @implements IGetIdentityContractNonceResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set - */ - function GetIdentityContractNonceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityContractNonceResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @instance - */ - GetIdentityContractNonceResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityContractNonceResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @instance - */ - Object.defineProperty(GetIdentityContractNonceResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityContractNonceResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse instance - */ - GetIdentityContractNonceResponse.create = function create(properties) { - return new GetIdentityContractNonceResponse(properties); - }; - - /** - * Encodes the specified GetIdentityContractNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityContractNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityContractNonceResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityContractNonceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityContractNonceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse - */ - GetIdentityContractNonceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityContractNonceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} message GetIdentityContractNonceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityContractNonceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityContractNonceResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityContractNonceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 = (function() { - - /** - * Properties of a GetIdentityContractNonceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @interface IGetIdentityContractNonceResponseV0 - * @property {number|Long|null} [identityContractNonce] GetIdentityContractNonceResponseV0 identityContractNonce - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityContractNonceResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityContractNonceResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityContractNonceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse - * @classdesc Represents a GetIdentityContractNonceResponseV0. - * @implements IGetIdentityContractNonceResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set - */ - function GetIdentityContractNonceResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityContractNonceResponseV0 identityContractNonce. - * @member {number|Long} identityContractNonce - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - */ - GetIdentityContractNonceResponseV0.prototype.identityContractNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetIdentityContractNonceResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - */ - GetIdentityContractNonceResponseV0.prototype.proof = null; - - /** - * GetIdentityContractNonceResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - */ - GetIdentityContractNonceResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityContractNonceResponseV0 result. - * @member {"identityContractNonce"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityContractNonceResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identityContractNonce", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityContractNonceResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 instance - */ - GetIdentityContractNonceResponseV0.create = function create(properties) { - return new GetIdentityContractNonceResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityContractNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityContractNonce != null && Object.hasOwnProperty.call(message, "identityContractNonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityContractNonce); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityContractNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityContractNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityContractNonce = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityContractNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityContractNonceResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityContractNonceResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { - properties.result = 1; - if (!$util.isInteger(message.identityContractNonce) && !(message.identityContractNonce && $util.isInteger(message.identityContractNonce.low) && $util.isInteger(message.identityContractNonce.high))) - return "identityContractNonce: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityContractNonceResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 - */ - GetIdentityContractNonceResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); - if (object.identityContractNonce != null) - if ($util.Long) - (message.identityContractNonce = $util.Long.fromValue(object.identityContractNonce)).unsigned = true; - else if (typeof object.identityContractNonce === "string") - message.identityContractNonce = parseInt(object.identityContractNonce, 10); - else if (typeof object.identityContractNonce === "number") - message.identityContractNonce = object.identityContractNonce; - else if (typeof object.identityContractNonce === "object") - message.identityContractNonce = new $util.LongBits(object.identityContractNonce.low >>> 0, object.identityContractNonce.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityContractNonceResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityContractNonceResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { - if (typeof message.identityContractNonce === "number") - object.identityContractNonce = options.longs === String ? String(message.identityContractNonce) : message.identityContractNonce; - else - object.identityContractNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityContractNonce) : options.longs === Number ? new $util.LongBits(message.identityContractNonce.low >>> 0, message.identityContractNonce.high >>> 0).toNumber(true) : message.identityContractNonce; - if (options.oneofs) - object.result = "identityContractNonce"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityContractNonceResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityContractNonceResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityContractNonceResponseV0; - })(); - - return GetIdentityContractNonceResponse; - })(); - - v0.GetIdentityBalanceResponse = (function() { - - /** - * Properties of a GetIdentityBalanceResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityBalanceResponse - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null} [v0] GetIdentityBalanceResponse v0 - */ - - /** - * Constructs a new GetIdentityBalanceResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityBalanceResponse. - * @implements IGetIdentityBalanceResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set - */ - function GetIdentityBalanceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @instance - */ - GetIdentityBalanceResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @instance - */ - Object.defineProperty(GetIdentityBalanceResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse instance - */ - GetIdentityBalanceResponse.create = function create(properties) { - return new GetIdentityBalanceResponse(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityBalanceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse - */ - GetIdentityBalanceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} message GetIdentityBalanceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityBalanceResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 = (function() { - - /** - * Properties of a GetIdentityBalanceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @interface IGetIdentityBalanceResponseV0 - * @property {number|Long|null} [balance] GetIdentityBalanceResponseV0 balance - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityBalanceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse - * @classdesc Represents a GetIdentityBalanceResponseV0. - * @implements IGetIdentityBalanceResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set - */ - function GetIdentityBalanceResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceResponseV0 balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - */ - GetIdentityBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetIdentityBalanceResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - */ - GetIdentityBalanceResponseV0.prototype.proof = null; - - /** - * GetIdentityBalanceResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - */ - GetIdentityBalanceResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceResponseV0 result. - * @member {"balance"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityBalanceResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 instance - */ - GetIdentityBalanceResponseV0.create = function create(properties) { - return new GetIdentityBalanceResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balance = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.balance != null && message.hasOwnProperty("balance")) { - properties.result = 1; - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 - */ - GetIdentityBalanceResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.balance != null && message.hasOwnProperty("balance")) { - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - if (options.oneofs) - object.result = "balance"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityBalanceResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityBalanceResponseV0; - })(); - - return GetIdentityBalanceResponse; - })(); - - v0.GetIdentityBalanceAndRevisionResponse = (function() { - - /** - * Properties of a GetIdentityBalanceAndRevisionResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityBalanceAndRevisionResponse - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null} [v0] GetIdentityBalanceAndRevisionResponse v0 - */ - - /** - * Constructs a new GetIdentityBalanceAndRevisionResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityBalanceAndRevisionResponse. - * @implements IGetIdentityBalanceAndRevisionResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set - */ - function GetIdentityBalanceAndRevisionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceAndRevisionResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @instance - */ - GetIdentityBalanceAndRevisionResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceAndRevisionResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @instance - */ - Object.defineProperty(GetIdentityBalanceAndRevisionResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceAndRevisionResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse instance - */ - GetIdentityBalanceAndRevisionResponse.create = function create(properties) { - return new GetIdentityBalanceAndRevisionResponse(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceAndRevisionResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceAndRevisionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityBalanceAndRevisionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse - */ - GetIdentityBalanceAndRevisionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceAndRevisionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceAndRevisionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityBalanceAndRevisionResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceAndRevisionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 = (function() { - - /** - * Properties of a GetIdentityBalanceAndRevisionResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @interface IGetIdentityBalanceAndRevisionResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null} [balanceAndRevision] GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceAndRevisionResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceAndRevisionResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityBalanceAndRevisionResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse - * @classdesc Represents a GetIdentityBalanceAndRevisionResponseV0. - * @implements IGetIdentityBalanceAndRevisionResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set - */ - function GetIdentityBalanceAndRevisionResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision. - * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null|undefined} balanceAndRevision - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - */ - GetIdentityBalanceAndRevisionResponseV0.prototype.balanceAndRevision = null; - - /** - * GetIdentityBalanceAndRevisionResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - */ - GetIdentityBalanceAndRevisionResponseV0.prototype.proof = null; - - /** - * GetIdentityBalanceAndRevisionResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - */ - GetIdentityBalanceAndRevisionResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityBalanceAndRevisionResponseV0 result. - * @member {"balanceAndRevision"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityBalanceAndRevisionResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["balanceAndRevision", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityBalanceAndRevisionResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 instance - */ - GetIdentityBalanceAndRevisionResponseV0.create = function create(properties) { - return new GetIdentityBalanceAndRevisionResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.balanceAndRevision != null && Object.hasOwnProperty.call(message, "balanceAndRevision")) - $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.encode(message.balanceAndRevision, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityBalanceAndRevisionResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityBalanceAndRevisionResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityBalanceAndRevisionResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityBalanceAndRevisionResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify(message.balanceAndRevision); - if (error) - return "balanceAndRevision." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityBalanceAndRevisionResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 - */ - GetIdentityBalanceAndRevisionResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); - if (object.balanceAndRevision != null) { - if (typeof object.balanceAndRevision !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.balanceAndRevision: object expected"); - message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.fromObject(object.balanceAndRevision); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityBalanceAndRevisionResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityBalanceAndRevisionResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { - object.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.toObject(message.balanceAndRevision, options); - if (options.oneofs) - object.result = "balanceAndRevision"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityBalanceAndRevisionResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityBalanceAndRevisionResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision = (function() { - - /** - * Properties of a BalanceAndRevision. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @interface IBalanceAndRevision - * @property {number|Long|null} [balance] BalanceAndRevision balance - * @property {number|Long|null} [revision] BalanceAndRevision revision - */ - - /** - * Constructs a new BalanceAndRevision. - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 - * @classdesc Represents a BalanceAndRevision. - * @implements IBalanceAndRevision - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set - */ - function BalanceAndRevision(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BalanceAndRevision balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @instance - */ - BalanceAndRevision.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BalanceAndRevision revision. - * @member {number|Long} revision - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @instance - */ - BalanceAndRevision.prototype.revision = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new BalanceAndRevision instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision instance - */ - BalanceAndRevision.create = function create(properties) { - return new BalanceAndRevision(properties); - }; - - /** - * Encodes the specified BalanceAndRevision message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BalanceAndRevision.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision); - return writer; - }; - - /** - * Encodes the specified BalanceAndRevision message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BalanceAndRevision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BalanceAndRevision message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BalanceAndRevision.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balance = reader.uint64(); - break; - case 2: - message.revision = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BalanceAndRevision message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BalanceAndRevision.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BalanceAndRevision message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BalanceAndRevision.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.balance != null && message.hasOwnProperty("balance")) - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isInteger(message.revision) && !(message.revision && $util.isInteger(message.revision.low) && $util.isInteger(message.revision.high))) - return "revision: integer|Long expected"; - return null; - }; - - /** - * Creates a BalanceAndRevision message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision - */ - BalanceAndRevision.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - if (object.revision != null) - if ($util.Long) - (message.revision = $util.Long.fromValue(object.revision)).unsigned = true; - else if (typeof object.revision === "string") - message.revision = parseInt(object.revision, 10); - else if (typeof object.revision === "number") - message.revision = object.revision; - else if (typeof object.revision === "object") - message.revision = new $util.LongBits(object.revision.low >>> 0, object.revision.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a BalanceAndRevision message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} message BalanceAndRevision - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BalanceAndRevision.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.balance = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision = options.longs === String ? "0" : 0; - } - if (message.balance != null && message.hasOwnProperty("balance")) - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - if (message.revision != null && message.hasOwnProperty("revision")) - if (typeof message.revision === "number") - object.revision = options.longs === String ? String(message.revision) : message.revision; - else - object.revision = options.longs === String ? $util.Long.prototype.toString.call(message.revision) : options.longs === Number ? new $util.LongBits(message.revision.low >>> 0, message.revision.high >>> 0).toNumber(true) : message.revision; - return object; - }; - - /** - * Converts this BalanceAndRevision to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision - * @instance - * @returns {Object.} JSON object - */ - BalanceAndRevision.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BalanceAndRevision; - })(); - - return GetIdentityBalanceAndRevisionResponseV0; - })(); - - return GetIdentityBalanceAndRevisionResponse; - })(); - - v0.KeyRequestType = (function() { - - /** - * Properties of a KeyRequestType. - * @memberof org.dash.platform.dapi.v0 - * @interface IKeyRequestType - * @property {org.dash.platform.dapi.v0.IAllKeys|null} [allKeys] KeyRequestType allKeys - * @property {org.dash.platform.dapi.v0.ISpecificKeys|null} [specificKeys] KeyRequestType specificKeys - * @property {org.dash.platform.dapi.v0.ISearchKey|null} [searchKey] KeyRequestType searchKey - */ - - /** - * Constructs a new KeyRequestType. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a KeyRequestType. - * @implements IKeyRequestType - * @constructor - * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set - */ - function KeyRequestType(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KeyRequestType allKeys. - * @member {org.dash.platform.dapi.v0.IAllKeys|null|undefined} allKeys - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - */ - KeyRequestType.prototype.allKeys = null; - - /** - * KeyRequestType specificKeys. - * @member {org.dash.platform.dapi.v0.ISpecificKeys|null|undefined} specificKeys - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - */ - KeyRequestType.prototype.specificKeys = null; - - /** - * KeyRequestType searchKey. - * @member {org.dash.platform.dapi.v0.ISearchKey|null|undefined} searchKey - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - */ - KeyRequestType.prototype.searchKey = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KeyRequestType request. - * @member {"allKeys"|"specificKeys"|"searchKey"|undefined} request - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - */ - Object.defineProperty(KeyRequestType.prototype, "request", { - get: $util.oneOfGetter($oneOfFields = ["allKeys", "specificKeys", "searchKey"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KeyRequestType instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType instance - */ - KeyRequestType.create = function create(properties) { - return new KeyRequestType(properties); - }; - - /** - * Encodes the specified KeyRequestType message. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRequestType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allKeys != null && Object.hasOwnProperty.call(message, "allKeys")) - $root.org.dash.platform.dapi.v0.AllKeys.encode(message.allKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.specificKeys != null && Object.hasOwnProperty.call(message, "specificKeys")) - $root.org.dash.platform.dapi.v0.SpecificKeys.encode(message.specificKeys, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.searchKey != null && Object.hasOwnProperty.call(message, "searchKey")) - $root.org.dash.platform.dapi.v0.SearchKey.encode(message.searchKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KeyRequestType message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyRequestType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KeyRequestType message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRequestType.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.decode(reader, reader.uint32()); - break; - case 2: - message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.decode(reader, reader.uint32()); - break; - case 3: - message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KeyRequestType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyRequestType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyRequestType message. - * @function verify - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyRequestType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.allKeys != null && message.hasOwnProperty("allKeys")) { - properties.request = 1; - { - var error = $root.org.dash.platform.dapi.v0.AllKeys.verify(message.allKeys); - if (error) - return "allKeys." + error; - } - } - if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { - if (properties.request === 1) - return "request: multiple values"; - properties.request = 1; - { - var error = $root.org.dash.platform.dapi.v0.SpecificKeys.verify(message.specificKeys); - if (error) - return "specificKeys." + error; - } - } - if (message.searchKey != null && message.hasOwnProperty("searchKey")) { - if (properties.request === 1) - return "request: multiple values"; - properties.request = 1; - { - var error = $root.org.dash.platform.dapi.v0.SearchKey.verify(message.searchKey); - if (error) - return "searchKey." + error; - } - } - return null; - }; - - /** - * Creates a KeyRequestType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType - */ - KeyRequestType.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.KeyRequestType) - return object; - var message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); - if (object.allKeys != null) { - if (typeof object.allKeys !== "object") - throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.allKeys: object expected"); - message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.fromObject(object.allKeys); - } - if (object.specificKeys != null) { - if (typeof object.specificKeys !== "object") - throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.specificKeys: object expected"); - message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.fromObject(object.specificKeys); - } - if (object.searchKey != null) { - if (typeof object.searchKey !== "object") - throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.searchKey: object expected"); - message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.fromObject(object.searchKey); - } - return message; - }; - - /** - * Creates a plain object from a KeyRequestType message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @static - * @param {org.dash.platform.dapi.v0.KeyRequestType} message KeyRequestType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyRequestType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.allKeys != null && message.hasOwnProperty("allKeys")) { - object.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.toObject(message.allKeys, options); - if (options.oneofs) - object.request = "allKeys"; - } - if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { - object.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.toObject(message.specificKeys, options); - if (options.oneofs) - object.request = "specificKeys"; - } - if (message.searchKey != null && message.hasOwnProperty("searchKey")) { - object.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.toObject(message.searchKey, options); - if (options.oneofs) - object.request = "searchKey"; - } - return object; - }; - - /** - * Converts this KeyRequestType to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.KeyRequestType - * @instance - * @returns {Object.} JSON object - */ - KeyRequestType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return KeyRequestType; - })(); - - v0.AllKeys = (function() { - - /** - * Properties of an AllKeys. - * @memberof org.dash.platform.dapi.v0 - * @interface IAllKeys - */ - - /** - * Constructs a new AllKeys. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents an AllKeys. - * @implements IAllKeys - * @constructor - * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set - */ - function AllKeys(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new AllKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys instance - */ - AllKeys.create = function create(properties) { - return new AllKeys(properties); - }; - - /** - * Encodes the specified AllKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified AllKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.AllKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an AllKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys - */ - AllKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.AllKeys) - return object; - return new $root.org.dash.platform.dapi.v0.AllKeys(); - }; - - /** - * Creates a plain object from an AllKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.AllKeys - * @static - * @param {org.dash.platform.dapi.v0.AllKeys} message AllKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllKeys.toObject = function toObject() { - return {}; - }; - - /** - * Converts this AllKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.AllKeys - * @instance - * @returns {Object.} JSON object - */ - AllKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AllKeys; - })(); - - v0.SpecificKeys = (function() { - - /** - * Properties of a SpecificKeys. - * @memberof org.dash.platform.dapi.v0 - * @interface ISpecificKeys - * @property {Array.|null} [keyIds] SpecificKeys keyIds - */ - - /** - * Constructs a new SpecificKeys. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a SpecificKeys. - * @implements ISpecificKeys - * @constructor - * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set - */ - function SpecificKeys(properties) { - this.keyIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpecificKeys keyIds. - * @member {Array.} keyIds - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @instance - */ - SpecificKeys.prototype.keyIds = $util.emptyArray; - - /** - * Creates a new SpecificKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys instance - */ - SpecificKeys.create = function create(properties) { - return new SpecificKeys(properties); - }; - - /** - * Encodes the specified SpecificKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpecificKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyIds != null && message.keyIds.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.keyIds.length; ++i) - writer.uint32(message.keyIds[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified SpecificKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpecificKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpecificKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpecificKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.keyIds && message.keyIds.length)) - message.keyIds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.keyIds.push(reader.uint32()); - } else - message.keyIds.push(reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpecificKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpecificKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpecificKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpecificKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyIds != null && message.hasOwnProperty("keyIds")) { - if (!Array.isArray(message.keyIds)) - return "keyIds: array expected"; - for (var i = 0; i < message.keyIds.length; ++i) - if (!$util.isInteger(message.keyIds[i])) - return "keyIds: integer[] expected"; - } - return null; - }; - - /** - * Creates a SpecificKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys - */ - SpecificKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.SpecificKeys) - return object; - var message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); - if (object.keyIds) { - if (!Array.isArray(object.keyIds)) - throw TypeError(".org.dash.platform.dapi.v0.SpecificKeys.keyIds: array expected"); - message.keyIds = []; - for (var i = 0; i < object.keyIds.length; ++i) - message.keyIds[i] = object.keyIds[i] >>> 0; - } - return message; - }; - - /** - * Creates a plain object from a SpecificKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @static - * @param {org.dash.platform.dapi.v0.SpecificKeys} message SpecificKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpecificKeys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keyIds = []; - if (message.keyIds && message.keyIds.length) { - object.keyIds = []; - for (var j = 0; j < message.keyIds.length; ++j) - object.keyIds[j] = message.keyIds[j]; - } - return object; - }; - - /** - * Converts this SpecificKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.SpecificKeys - * @instance - * @returns {Object.} JSON object - */ - SpecificKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SpecificKeys; - })(); - - v0.SearchKey = (function() { - - /** - * Properties of a SearchKey. - * @memberof org.dash.platform.dapi.v0 - * @interface ISearchKey - * @property {Object.|null} [purposeMap] SearchKey purposeMap - */ - - /** - * Constructs a new SearchKey. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a SearchKey. - * @implements ISearchKey - * @constructor - * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set - */ - function SearchKey(properties) { - this.purposeMap = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchKey purposeMap. - * @member {Object.} purposeMap - * @memberof org.dash.platform.dapi.v0.SearchKey - * @instance - */ - SearchKey.prototype.purposeMap = $util.emptyObject; - - /** - * Creates a new SearchKey instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey instance - */ - SearchKey.create = function create(properties) { - return new SearchKey(properties); - }; - - /** - * Encodes the specified SearchKey message. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.purposeMap != null && Object.hasOwnProperty.call(message, "purposeMap")) - for (var keys = Object.keys(message.purposeMap), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]); - $root.org.dash.platform.dapi.v0.SecurityLevelMap.encode(message.purposeMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified SearchKey message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchKey message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SearchKey(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (message.purposeMap === $util.emptyObject) - message.purposeMap = {}; - var end2 = reader.uint32() + reader.pos; - key = 0; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.uint32(); - break; - case 2: - value = $root.org.dash.platform.dapi.v0.SecurityLevelMap.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.purposeMap[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchKey message. - * @function verify - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.purposeMap != null && message.hasOwnProperty("purposeMap")) { - if (!$util.isObject(message.purposeMap)) - return "purposeMap: object expected"; - var key = Object.keys(message.purposeMap); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "purposeMap: integer key{k:uint32} expected"; - { - var error = $root.org.dash.platform.dapi.v0.SecurityLevelMap.verify(message.purposeMap[key[i]]); - if (error) - return "purposeMap." + error; - } - } - } - return null; - }; - - /** - * Creates a SearchKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey - */ - SearchKey.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.SearchKey) - return object; - var message = new $root.org.dash.platform.dapi.v0.SearchKey(); - if (object.purposeMap) { - if (typeof object.purposeMap !== "object") - throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); - message.purposeMap = {}; - for (var keys = Object.keys(object.purposeMap), i = 0; i < keys.length; ++i) { - if (typeof object.purposeMap[keys[i]] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); - message.purposeMap[keys[i]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.fromObject(object.purposeMap[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a SearchKey message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.SearchKey - * @static - * @param {org.dash.platform.dapi.v0.SearchKey} message SearchKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.purposeMap = {}; - var keys2; - if (message.purposeMap && (keys2 = Object.keys(message.purposeMap)).length) { - object.purposeMap = {}; - for (var j = 0; j < keys2.length; ++j) - object.purposeMap[keys2[j]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.toObject(message.purposeMap[keys2[j]], options); - } - return object; - }; - - /** - * Converts this SearchKey to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.SearchKey - * @instance - * @returns {Object.} JSON object - */ - SearchKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchKey; - })(); - - v0.SecurityLevelMap = (function() { - - /** - * Properties of a SecurityLevelMap. - * @memberof org.dash.platform.dapi.v0 - * @interface ISecurityLevelMap - * @property {Object.|null} [securityLevelMap] SecurityLevelMap securityLevelMap - */ - - /** - * Constructs a new SecurityLevelMap. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a SecurityLevelMap. - * @implements ISecurityLevelMap - * @constructor - * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set - */ - function SecurityLevelMap(properties) { - this.securityLevelMap = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityLevelMap securityLevelMap. - * @member {Object.} securityLevelMap - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @instance - */ - SecurityLevelMap.prototype.securityLevelMap = $util.emptyObject; - - /** - * Creates a new SecurityLevelMap instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap instance - */ - SecurityLevelMap.create = function create(properties) { - return new SecurityLevelMap(properties); - }; - - /** - * Encodes the specified SecurityLevelMap message. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityLevelMap.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.securityLevelMap != null && Object.hasOwnProperty.call(message, "securityLevelMap")) - for (var keys = Object.keys(message.securityLevelMap), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.securityLevelMap[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified SecurityLevelMap message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityLevelMap.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityLevelMap message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityLevelMap.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (message.securityLevelMap === $util.emptyObject) - message.securityLevelMap = {}; - var end2 = reader.uint32() + reader.pos; - key = 0; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.uint32(); - break; - case 2: - value = reader.int32(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.securityLevelMap[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityLevelMap message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityLevelMap.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityLevelMap message. - * @function verify - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityLevelMap.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.securityLevelMap != null && message.hasOwnProperty("securityLevelMap")) { - if (!$util.isObject(message.securityLevelMap)) - return "securityLevelMap: object expected"; - var key = Object.keys(message.securityLevelMap); - for (var i = 0; i < key.length; ++i) { - if (!$util.key32Re.test(key[i])) - return "securityLevelMap: integer key{k:uint32} expected"; - switch (message.securityLevelMap[key[i]]) { - default: - return "securityLevelMap: enum value{k:uint32} expected"; - case 0: - case 1: - break; - } - } - } - return null; - }; - - /** - * Creates a SecurityLevelMap message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap - */ - SecurityLevelMap.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.SecurityLevelMap) - return object; - var message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(); - if (object.securityLevelMap) { - if (typeof object.securityLevelMap !== "object") - throw TypeError(".org.dash.platform.dapi.v0.SecurityLevelMap.securityLevelMap: object expected"); - message.securityLevelMap = {}; - for (var keys = Object.keys(object.securityLevelMap), i = 0; i < keys.length; ++i) - switch (object.securityLevelMap[keys[i]]) { - case "CURRENT_KEY_OF_KIND_REQUEST": - case 0: - message.securityLevelMap[keys[i]] = 0; - break; - case "ALL_KEYS_OF_KIND_REQUEST": - case 1: - message.securityLevelMap[keys[i]] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a SecurityLevelMap message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @static - * @param {org.dash.platform.dapi.v0.SecurityLevelMap} message SecurityLevelMap - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityLevelMap.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.securityLevelMap = {}; - var keys2; - if (message.securityLevelMap && (keys2 = Object.keys(message.securityLevelMap)).length) { - object.securityLevelMap = {}; - for (var j = 0; j < keys2.length; ++j) - object.securityLevelMap[keys2[j]] = options.enums === String ? $root.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType[message.securityLevelMap[keys2[j]]] : message.securityLevelMap[keys2[j]]; - } - return object; - }; - - /** - * Converts this SecurityLevelMap to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.SecurityLevelMap - * @instance - * @returns {Object.} JSON object - */ - SecurityLevelMap.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * KeyKindRequestType enum. - * @name org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType - * @enum {number} - * @property {number} CURRENT_KEY_OF_KIND_REQUEST=0 CURRENT_KEY_OF_KIND_REQUEST value - * @property {number} ALL_KEYS_OF_KIND_REQUEST=1 ALL_KEYS_OF_KIND_REQUEST value - */ - SecurityLevelMap.KeyKindRequestType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CURRENT_KEY_OF_KIND_REQUEST"] = 0; - values[valuesById[1] = "ALL_KEYS_OF_KIND_REQUEST"] = 1; - return values; - })(); - - return SecurityLevelMap; - })(); - - v0.GetIdentityKeysRequest = (function() { - - /** - * Properties of a GetIdentityKeysRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityKeysRequest - * @property {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null} [v0] GetIdentityKeysRequest v0 - */ - - /** - * Constructs a new GetIdentityKeysRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityKeysRequest. - * @implements IGetIdentityKeysRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set - */ - function GetIdentityKeysRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityKeysRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @instance - */ - GetIdentityKeysRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityKeysRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @instance - */ - Object.defineProperty(GetIdentityKeysRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityKeysRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest instance - */ - GetIdentityKeysRequest.create = function create(properties) { - return new GetIdentityKeysRequest(properties); - }; - - /** - * Encodes the specified GetIdentityKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityKeysRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityKeysRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityKeysRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityKeysRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityKeysRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest - */ - GetIdentityKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityKeysRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest} message GetIdentityKeysRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityKeysRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityKeysRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityKeysRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityKeysRequest.GetIdentityKeysRequestV0 = (function() { - - /** - * Properties of a GetIdentityKeysRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @interface IGetIdentityKeysRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityKeysRequestV0 identityId - * @property {org.dash.platform.dapi.v0.IKeyRequestType|null} [requestType] GetIdentityKeysRequestV0 requestType - * @property {google.protobuf.IUInt32Value|null} [limit] GetIdentityKeysRequestV0 limit - * @property {google.protobuf.IUInt32Value|null} [offset] GetIdentityKeysRequestV0 offset - * @property {boolean|null} [prove] GetIdentityKeysRequestV0 prove - */ - - /** - * Constructs a new GetIdentityKeysRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest - * @classdesc Represents a GetIdentityKeysRequestV0. - * @implements IGetIdentityKeysRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set - */ - function GetIdentityKeysRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityKeysRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityKeysRequestV0 requestType. - * @member {org.dash.platform.dapi.v0.IKeyRequestType|null|undefined} requestType - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.requestType = null; - - /** - * GetIdentityKeysRequestV0 limit. - * @member {google.protobuf.IUInt32Value|null|undefined} limit - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.limit = null; - - /** - * GetIdentityKeysRequestV0 offset. - * @member {google.protobuf.IUInt32Value|null|undefined} offset - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.offset = null; - - /** - * GetIdentityKeysRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - */ - GetIdentityKeysRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityKeysRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 instance - */ - GetIdentityKeysRequestV0.create = function create(properties) { - return new GetIdentityKeysRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.requestType != null && Object.hasOwnProperty.call(message, "requestType")) - $root.org.dash.platform.dapi.v0.KeyRequestType.encode(message.requestType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.decode(reader, reader.uint32()); - break; - case 3: - message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 4: - message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityKeysRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityKeysRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.requestType != null && message.hasOwnProperty("requestType")) { - var error = $root.org.dash.platform.dapi.v0.KeyRequestType.verify(message.requestType); - if (error) - return "requestType." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.UInt32Value.verify(message.limit); - if (error) - return "limit." + error; - } - if (message.offset != null && message.hasOwnProperty("offset")) { - var error = $root.google.protobuf.UInt32Value.verify(message.offset); - if (error) - return "offset." + error; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityKeysRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 - */ - GetIdentityKeysRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.requestType != null) { - if (typeof object.requestType !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.requestType: object expected"); - message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.fromObject(object.requestType); - } - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.limit: object expected"); - message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); - } - if (object.offset != null) { - if (typeof object.offset !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.offset: object expected"); - message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityKeysRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityKeysRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.requestType = null; - object.limit = null; - object.offset = null; - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.requestType != null && message.hasOwnProperty("requestType")) - object.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.toObject(message.requestType, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityKeysRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityKeysRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityKeysRequestV0; - })(); - - return GetIdentityKeysRequest; - })(); - - v0.GetIdentityKeysResponse = (function() { - - /** - * Properties of a GetIdentityKeysResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityKeysResponse - * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null} [v0] GetIdentityKeysResponse v0 - */ - - /** - * Constructs a new GetIdentityKeysResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityKeysResponse. - * @implements IGetIdentityKeysResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set - */ - function GetIdentityKeysResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityKeysResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @instance - */ - GetIdentityKeysResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityKeysResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @instance - */ - Object.defineProperty(GetIdentityKeysResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityKeysResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse instance - */ - GetIdentityKeysResponse.create = function create(properties) { - return new GetIdentityKeysResponse(properties); - }; - - /** - * Encodes the specified GetIdentityKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityKeysResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityKeysResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityKeysResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityKeysResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityKeysResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse - */ - GetIdentityKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityKeysResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} message GetIdentityKeysResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityKeysResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityKeysResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityKeysResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityKeysResponse.GetIdentityKeysResponseV0 = (function() { - - /** - * Properties of a GetIdentityKeysResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @interface IGetIdentityKeysResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null} [keys] GetIdentityKeysResponseV0 keys - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityKeysResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityKeysResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityKeysResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse - * @classdesc Represents a GetIdentityKeysResponseV0. - * @implements IGetIdentityKeysResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set - */ - function GetIdentityKeysResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityKeysResponseV0 keys. - * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null|undefined} keys - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - */ - GetIdentityKeysResponseV0.prototype.keys = null; - - /** - * GetIdentityKeysResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - */ - GetIdentityKeysResponseV0.prototype.proof = null; - - /** - * GetIdentityKeysResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - */ - GetIdentityKeysResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityKeysResponseV0 result. - * @member {"keys"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityKeysResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["keys", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityKeysResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 instance - */ - GetIdentityKeysResponseV0.create = function create(properties) { - return new GetIdentityKeysResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) - $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.encode(message.keys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityKeysResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityKeysResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.keys != null && message.hasOwnProperty("keys")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify(message.keys); - if (error) - return "keys." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityKeysResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 - */ - GetIdentityKeysResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); - if (object.keys != null) { - if (typeof object.keys !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.keys: object expected"); - message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.fromObject(object.keys); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityKeysResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityKeysResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.keys != null && message.hasOwnProperty("keys")) { - object.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.toObject(message.keys, options); - if (options.oneofs) - object.result = "keys"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityKeysResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityKeysResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityKeysResponseV0.Keys = (function() { - - /** - * Properties of a Keys. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @interface IKeys - * @property {Array.|null} [keysBytes] Keys keysBytes - */ - - /** - * Constructs a new Keys. - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 - * @classdesc Represents a Keys. - * @implements IKeys - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set - */ - function Keys(properties) { - this.keysBytes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Keys keysBytes. - * @member {Array.} keysBytes - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @instance - */ - Keys.prototype.keysBytes = $util.emptyArray; - - /** - * Creates a new Keys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys instance - */ - Keys.create = function create(properties) { - return new Keys(properties); - }; - - /** - * Encodes the specified Keys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Keys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keysBytes != null && message.keysBytes.length) - for (var i = 0; i < message.keysBytes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keysBytes[i]); - return writer; - }; - - /** - * Encodes the specified Keys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Keys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Keys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Keys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.keysBytes && message.keysBytes.length)) - message.keysBytes = []; - message.keysBytes.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Keys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Keys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Keys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Keys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { - if (!Array.isArray(message.keysBytes)) - return "keysBytes: array expected"; - for (var i = 0; i < message.keysBytes.length; ++i) - if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) - return "keysBytes: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Keys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys - */ - Keys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); - if (object.keysBytes) { - if (!Array.isArray(object.keysBytes)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.keysBytes: array expected"); - message.keysBytes = []; - for (var i = 0; i < object.keysBytes.length; ++i) - if (typeof object.keysBytes[i] === "string") - $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); - else if (object.keysBytes[i].length >= 0) - message.keysBytes[i] = object.keysBytes[i]; - } - return message; - }; - - /** - * Creates a plain object from a Keys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} message Keys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Keys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keysBytes = []; - if (message.keysBytes && message.keysBytes.length) { - object.keysBytes = []; - for (var j = 0; j < message.keysBytes.length; ++j) - object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; - } - return object; - }; - - /** - * Converts this Keys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys - * @instance - * @returns {Object.} JSON object - */ - Keys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Keys; - })(); - - return GetIdentityKeysResponseV0; - })(); - - return GetIdentityKeysResponse; - })(); - - v0.GetIdentitiesContractKeysRequest = (function() { - - /** - * Properties of a GetIdentitiesContractKeysRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesContractKeysRequest - * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null} [v0] GetIdentitiesContractKeysRequest v0 - */ - - /** - * Constructs a new GetIdentitiesContractKeysRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesContractKeysRequest. - * @implements IGetIdentitiesContractKeysRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set - */ - function GetIdentitiesContractKeysRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesContractKeysRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @instance - */ - GetIdentitiesContractKeysRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesContractKeysRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @instance - */ - Object.defineProperty(GetIdentitiesContractKeysRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesContractKeysRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest instance - */ - GetIdentitiesContractKeysRequest.create = function create(properties) { - return new GetIdentitiesContractKeysRequest(properties); - }; - - /** - * Encodes the specified GetIdentitiesContractKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesContractKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesContractKeysRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesContractKeysRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesContractKeysRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest - */ - GetIdentitiesContractKeysRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesContractKeysRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesContractKeysRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesContractKeysRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesContractKeysRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 = (function() { - - /** - * Properties of a GetIdentitiesContractKeysRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @interface IGetIdentitiesContractKeysRequestV0 - * @property {Array.|null} [identitiesIds] GetIdentitiesContractKeysRequestV0 identitiesIds - * @property {Uint8Array|null} [contractId] GetIdentitiesContractKeysRequestV0 contractId - * @property {string|null} [documentTypeName] GetIdentitiesContractKeysRequestV0 documentTypeName - * @property {Array.|null} [purposes] GetIdentitiesContractKeysRequestV0 purposes - * @property {boolean|null} [prove] GetIdentitiesContractKeysRequestV0 prove - */ - - /** - * Constructs a new GetIdentitiesContractKeysRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest - * @classdesc Represents a GetIdentitiesContractKeysRequestV0. - * @implements IGetIdentitiesContractKeysRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set - */ - function GetIdentitiesContractKeysRequestV0(properties) { - this.identitiesIds = []; - this.purposes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesContractKeysRequestV0 identitiesIds. - * @member {Array.} identitiesIds - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.identitiesIds = $util.emptyArray; - - /** - * GetIdentitiesContractKeysRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetIdentitiesContractKeysRequestV0 documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.documentTypeName = ""; - - /** - * GetIdentitiesContractKeysRequestV0 purposes. - * @member {Array.} purposes - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.purposes = $util.emptyArray; - - /** - * GetIdentitiesContractKeysRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - */ - GetIdentitiesContractKeysRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentitiesContractKeysRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 instance - */ - GetIdentitiesContractKeysRequestV0.create = function create(properties) { - return new GetIdentitiesContractKeysRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesContractKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identitiesIds != null && message.identitiesIds.length) - for (var i = 0; i < message.identitiesIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identitiesIds[i]); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentTypeName); - if (message.purposes != null && message.purposes.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.purposes.length; ++i) - writer.int32(message.purposes[i]); - writer.ldelim(); - } - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesContractKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.identitiesIds && message.identitiesIds.length)) - message.identitiesIds = []; - message.identitiesIds.push(reader.bytes()); - break; - case 2: - message.contractId = reader.bytes(); - break; - case 3: - message.documentTypeName = reader.string(); - break; - case 4: - if (!(message.purposes && message.purposes.length)) - message.purposes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.purposes.push(reader.int32()); - } else - message.purposes.push(reader.int32()); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesContractKeysRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesContractKeysRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identitiesIds != null && message.hasOwnProperty("identitiesIds")) { - if (!Array.isArray(message.identitiesIds)) - return "identitiesIds: array expected"; - for (var i = 0; i < message.identitiesIds.length; ++i) - if (!(message.identitiesIds[i] && typeof message.identitiesIds[i].length === "number" || $util.isString(message.identitiesIds[i]))) - return "identitiesIds: buffer[] expected"; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.purposes != null && message.hasOwnProperty("purposes")) { - if (!Array.isArray(message.purposes)) - return "purposes: array expected"; - for (var i = 0; i < message.purposes.length; ++i) - switch (message.purposes[i]) { - default: - return "purposes: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 5: - break; - } - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentitiesContractKeysRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 - */ - GetIdentitiesContractKeysRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); - if (object.identitiesIds) { - if (!Array.isArray(object.identitiesIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.identitiesIds: array expected"); - message.identitiesIds = []; - for (var i = 0; i < object.identitiesIds.length; ++i) - if (typeof object.identitiesIds[i] === "string") - $util.base64.decode(object.identitiesIds[i], message.identitiesIds[i] = $util.newBuffer($util.base64.length(object.identitiesIds[i])), 0); - else if (object.identitiesIds[i].length >= 0) - message.identitiesIds[i] = object.identitiesIds[i]; - } - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.purposes) { - if (!Array.isArray(object.purposes)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.purposes: array expected"); - message.purposes = []; - for (var i = 0; i < object.purposes.length; ++i) - switch (object.purposes[i]) { - default: - case "AUTHENTICATION": - case 0: - message.purposes[i] = 0; - break; - case "ENCRYPTION": - case 1: - message.purposes[i] = 1; - break; - case "DECRYPTION": - case 2: - message.purposes[i] = 2; - break; - case "TRANSFER": - case 3: - message.purposes[i] = 3; - break; - case "VOTING": - case 5: - message.purposes[i] = 5; - break; - } - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesContractKeysRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesContractKeysRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.identitiesIds = []; - object.purposes = []; - } - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.prove = false; - } - if (message.identitiesIds && message.identitiesIds.length) { - object.identitiesIds = []; - for (var j = 0; j < message.identitiesIds.length; ++j) - object.identitiesIds[j] = options.bytes === String ? $util.base64.encode(message.identitiesIds[j], 0, message.identitiesIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identitiesIds[j]) : message.identitiesIds[j]; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.purposes && message.purposes.length) { - object.purposes = []; - for (var j = 0; j < message.purposes.length; ++j) - object.purposes[j] = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purposes[j]] : message.purposes[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentitiesContractKeysRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesContractKeysRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesContractKeysRequestV0; - })(); - - return GetIdentitiesContractKeysRequest; - })(); - - v0.GetIdentitiesContractKeysResponse = (function() { - - /** - * Properties of a GetIdentitiesContractKeysResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesContractKeysResponse - * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null} [v0] GetIdentitiesContractKeysResponse v0 - */ - - /** - * Constructs a new GetIdentitiesContractKeysResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesContractKeysResponse. - * @implements IGetIdentitiesContractKeysResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set - */ - function GetIdentitiesContractKeysResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesContractKeysResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @instance - */ - GetIdentitiesContractKeysResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesContractKeysResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @instance - */ - Object.defineProperty(GetIdentitiesContractKeysResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesContractKeysResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse instance - */ - GetIdentitiesContractKeysResponse.create = function create(properties) { - return new GetIdentitiesContractKeysResponse(properties); - }; - - /** - * Encodes the specified GetIdentitiesContractKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesContractKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesContractKeysResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesContractKeysResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesContractKeysResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse - */ - GetIdentitiesContractKeysResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesContractKeysResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesContractKeysResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesContractKeysResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesContractKeysResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 = (function() { - - /** - * Properties of a GetIdentitiesContractKeysResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @interface IGetIdentitiesContractKeysResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null} [identitiesKeys] GetIdentitiesContractKeysResponseV0 identitiesKeys - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesContractKeysResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesContractKeysResponseV0 metadata - */ - - /** - * Constructs a new GetIdentitiesContractKeysResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse - * @classdesc Represents a GetIdentitiesContractKeysResponseV0. - * @implements IGetIdentitiesContractKeysResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set - */ - function GetIdentitiesContractKeysResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesContractKeysResponseV0 identitiesKeys. - * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null|undefined} identitiesKeys - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - */ - GetIdentitiesContractKeysResponseV0.prototype.identitiesKeys = null; - - /** - * GetIdentitiesContractKeysResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - */ - GetIdentitiesContractKeysResponseV0.prototype.proof = null; - - /** - * GetIdentitiesContractKeysResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - */ - GetIdentitiesContractKeysResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesContractKeysResponseV0 result. - * @member {"identitiesKeys"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - */ - Object.defineProperty(GetIdentitiesContractKeysResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identitiesKeys", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesContractKeysResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 instance - */ - GetIdentitiesContractKeysResponseV0.create = function create(properties) { - return new GetIdentitiesContractKeysResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesContractKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identitiesKeys != null && Object.hasOwnProperty.call(message, "identitiesKeys")) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.encode(message.identitiesKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesContractKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesContractKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesContractKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesContractKeysResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesContractKeysResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify(message.identitiesKeys); - if (error) - return "identitiesKeys." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentitiesContractKeysResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 - */ - GetIdentitiesContractKeysResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); - if (object.identitiesKeys != null) { - if (typeof object.identitiesKeys !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.identitiesKeys: object expected"); - message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.fromObject(object.identitiesKeys); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesContractKeysResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesContractKeysResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { - object.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.toObject(message.identitiesKeys, options); - if (options.oneofs) - object.result = "identitiesKeys"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentitiesContractKeysResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesContractKeysResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesContractKeysResponseV0.PurposeKeys = (function() { - - /** - * Properties of a PurposeKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @interface IPurposeKeys - * @property {org.dash.platform.dapi.v0.KeyPurpose|null} [purpose] PurposeKeys purpose - * @property {Array.|null} [keysBytes] PurposeKeys keysBytes - */ - - /** - * Constructs a new PurposeKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @classdesc Represents a PurposeKeys. - * @implements IPurposeKeys - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set - */ - function PurposeKeys(properties) { - this.keysBytes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PurposeKeys purpose. - * @member {org.dash.platform.dapi.v0.KeyPurpose} purpose - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @instance - */ - PurposeKeys.prototype.purpose = 0; - - /** - * PurposeKeys keysBytes. - * @member {Array.} keysBytes - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @instance - */ - PurposeKeys.prototype.keysBytes = $util.emptyArray; - - /** - * Creates a new PurposeKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys instance - */ - PurposeKeys.create = function create(properties) { - return new PurposeKeys(properties); - }; - - /** - * Encodes the specified PurposeKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurposeKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.purpose != null && Object.hasOwnProperty.call(message, "purpose")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.purpose); - if (message.keysBytes != null && message.keysBytes.length) - for (var i = 0; i < message.keysBytes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keysBytes[i]); - return writer; - }; - - /** - * Encodes the specified PurposeKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurposeKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PurposeKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurposeKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.purpose = reader.int32(); - break; - case 2: - if (!(message.keysBytes && message.keysBytes.length)) - message.keysBytes = []; - message.keysBytes.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PurposeKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurposeKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PurposeKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PurposeKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.purpose != null && message.hasOwnProperty("purpose")) - switch (message.purpose) { - default: - return "purpose: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 5: - break; - } - if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { - if (!Array.isArray(message.keysBytes)) - return "keysBytes: array expected"; - for (var i = 0; i < message.keysBytes.length; ++i) - if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) - return "keysBytes: buffer[] expected"; - } - return null; - }; - - /** - * Creates a PurposeKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys - */ - PurposeKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); - switch (object.purpose) { - case "AUTHENTICATION": - case 0: - message.purpose = 0; - break; - case "ENCRYPTION": - case 1: - message.purpose = 1; - break; - case "DECRYPTION": - case 2: - message.purpose = 2; - break; - case "TRANSFER": - case 3: - message.purpose = 3; - break; - case "VOTING": - case 5: - message.purpose = 5; - break; - } - if (object.keysBytes) { - if (!Array.isArray(object.keysBytes)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.keysBytes: array expected"); - message.keysBytes = []; - for (var i = 0; i < object.keysBytes.length; ++i) - if (typeof object.keysBytes[i] === "string") - $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); - else if (object.keysBytes[i].length >= 0) - message.keysBytes[i] = object.keysBytes[i]; - } - return message; - }; - - /** - * Creates a plain object from a PurposeKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} message PurposeKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PurposeKeys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keysBytes = []; - if (options.defaults) - object.purpose = options.enums === String ? "AUTHENTICATION" : 0; - if (message.purpose != null && message.hasOwnProperty("purpose")) - object.purpose = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purpose] : message.purpose; - if (message.keysBytes && message.keysBytes.length) { - object.keysBytes = []; - for (var j = 0; j < message.keysBytes.length; ++j) - object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; - } - return object; - }; - - /** - * Converts this PurposeKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys - * @instance - * @returns {Object.} JSON object - */ - PurposeKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PurposeKeys; - })(); - - GetIdentitiesContractKeysResponseV0.IdentityKeys = (function() { - - /** - * Properties of an IdentityKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @interface IIdentityKeys - * @property {Uint8Array|null} [identityId] IdentityKeys identityId - * @property {Array.|null} [keys] IdentityKeys keys - */ - - /** - * Constructs a new IdentityKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @classdesc Represents an IdentityKeys. - * @implements IIdentityKeys - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set - */ - function IdentityKeys(properties) { - this.keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityKeys identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @instance - */ - IdentityKeys.prototype.identityId = $util.newBuffer([]); - - /** - * IdentityKeys keys. - * @member {Array.} keys - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @instance - */ - IdentityKeys.prototype.keys = $util.emptyArray; - - /** - * Creates a new IdentityKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys instance - */ - IdentityKeys.create = function create(properties) { - return new IdentityKeys(properties); - }; - - /** - * Encodes the specified IdentityKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.encode(message.keys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentityKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - return null; - }; - - /** - * Creates an IdentityKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys - */ - IdentityKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: object expected"); - message.keys[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.fromObject(object.keys[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentityKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} message IdentityKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityKeys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.toObject(message.keys[j], options); - } - return object; - }; - - /** - * Converts this IdentityKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys - * @instance - * @returns {Object.} JSON object - */ - IdentityKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityKeys; - })(); - - GetIdentitiesContractKeysResponseV0.IdentitiesKeys = (function() { - - /** - * Properties of an IdentitiesKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @interface IIdentitiesKeys - * @property {Array.|null} [entries] IdentitiesKeys entries - */ - - /** - * Constructs a new IdentitiesKeys. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 - * @classdesc Represents an IdentitiesKeys. - * @implements IIdentitiesKeys - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set - */ - function IdentitiesKeys(properties) { - this.entries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentitiesKeys entries. - * @member {Array.} entries - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @instance - */ - IdentitiesKeys.prototype.entries = $util.emptyArray; - - /** - * Creates a new IdentitiesKeys instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys instance - */ - IdentitiesKeys.create = function create(properties) { - return new IdentitiesKeys(properties); - }; - - /** - * Encodes the specified IdentitiesKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitiesKeys.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (var i = 0; i < message.entries.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentitiesKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitiesKeys.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentitiesKeys message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitiesKeys.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentitiesKeys message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitiesKeys.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentitiesKeys message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentitiesKeys.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (var i = 0; i < message.entries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify(message.entries[i]); - if (error) - return "entries." + error; - } - } - return null; - }; - - /** - * Creates an IdentitiesKeys message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys - */ - IdentitiesKeys.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: array expected"); - message.entries = []; - for (var i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: object expected"); - message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.fromObject(object.entries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentitiesKeys message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} message IdentitiesKeys - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentitiesKeys.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entries = []; - if (message.entries && message.entries.length) { - object.entries = []; - for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.toObject(message.entries[j], options); - } - return object; - }; - - /** - * Converts this IdentitiesKeys to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys - * @instance - * @returns {Object.} JSON object - */ - IdentitiesKeys.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentitiesKeys; - })(); - - return GetIdentitiesContractKeysResponseV0; - })(); - - return GetIdentitiesContractKeysResponse; - })(); - - v0.GetEvonodesProposedEpochBlocksByIdsRequest = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksByIdsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEvonodesProposedEpochBlocksByIdsRequest - * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByIdsRequest v0 - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequest. - * @implements IGetEvonodesProposedEpochBlocksByIdsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksByIdsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksByIdsRequest v0. - * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @instance - */ - GetEvonodesProposedEpochBlocksByIdsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksByIdsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksByIdsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksByIdsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest instance - */ - GetEvonodesProposedEpochBlocksByIdsRequest.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksByIdsRequest(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByIdsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByIdsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByIdsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksByIdsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksByIdsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksByIdsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest - */ - GetEvonodesProposedEpochBlocksByIdsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksByIdsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksByIdsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksByIdsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksByIdsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @interface IGetEvonodesProposedEpochBlocksByIdsRequestV0 - * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch - * @property {Array.|null} [ids] GetEvonodesProposedEpochBlocksByIdsRequestV0 ids - * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByIdsRequestV0 prove - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest - * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequestV0. - * @implements IGetEvonodesProposedEpochBlocksByIdsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksByIdsRequestV0(properties) { - this.ids = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch. - * @member {number} epoch - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.epoch = 0; - - /** - * GetEvonodesProposedEpochBlocksByIdsRequestV0 ids. - * @member {Array.} ids - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.ids = $util.emptyArray; - - /** - * GetEvonodesProposedEpochBlocksByIdsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.prove = false; - - /** - * Creates a new GetEvonodesProposedEpochBlocksByIdsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 instance - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksByIdsRequestV0(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); - if (message.ids != null && message.ids.length) - for (var i = 0; i < message.ids.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ids[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.epoch = reader.uint32(); - break; - case 2: - if (!(message.ids && message.ids.length)) - message.ids = []; - message.ids.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - if (message.ids != null && message.hasOwnProperty("ids")) { - if (!Array.isArray(message.ids)) - return "ids: array expected"; - for (var i = 0; i < message.ids.length; ++i) - if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) - return "ids: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); - if (object.epoch != null) - message.epoch = object.epoch >>> 0; - if (object.ids) { - if (!Array.isArray(object.ids)) - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.ids: array expected"); - message.ids = []; - for (var i = 0; i < object.ids.length; ++i) - if (typeof object.ids[i] === "string") - $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); - else if (object.ids[i].length >= 0) - message.ids[i] = object.ids[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ids = []; - if (options.defaults) { - object.epoch = 0; - object.prove = false; - } - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - if (message.ids && message.ids.length) { - object.ids = []; - for (var j = 0; j < message.ids.length; ++j) - object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksByIdsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetEvonodesProposedEpochBlocksByIdsRequestV0; - })(); - - return GetEvonodesProposedEpochBlocksByIdsRequest; - })(); - - v0.GetEvonodesProposedEpochBlocksResponse = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEvonodesProposedEpochBlocksResponse - * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null} [v0] GetEvonodesProposedEpochBlocksResponse v0 - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEvonodesProposedEpochBlocksResponse. - * @implements IGetEvonodesProposedEpochBlocksResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksResponse v0. - * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @instance - */ - GetEvonodesProposedEpochBlocksResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse instance - */ - GetEvonodesProposedEpochBlocksResponse.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksResponse(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse - */ - GetEvonodesProposedEpochBlocksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksResponseV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @interface IGetEvonodesProposedEpochBlocksResponseV0 - * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null} [evonodesProposedBlockCountsInfo] GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEvonodesProposedEpochBlocksResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEvonodesProposedEpochBlocksResponseV0 metadata - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksResponseV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse - * @classdesc Represents a GetEvonodesProposedEpochBlocksResponseV0. - * @implements IGetEvonodesProposedEpochBlocksResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo. - * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null|undefined} evonodesProposedBlockCountsInfo - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - */ - GetEvonodesProposedEpochBlocksResponseV0.prototype.evonodesProposedBlockCountsInfo = null; - - /** - * GetEvonodesProposedEpochBlocksResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - */ - GetEvonodesProposedEpochBlocksResponseV0.prototype.proof = null; - - /** - * GetEvonodesProposedEpochBlocksResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - */ - GetEvonodesProposedEpochBlocksResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksResponseV0 result. - * @member {"evonodesProposedBlockCountsInfo"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["evonodesProposedBlockCountsInfo", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 instance - */ - GetEvonodesProposedEpochBlocksResponseV0.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksResponseV0(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evonodesProposedBlockCountsInfo != null && Object.hasOwnProperty.call(message, "evonodesProposedBlockCountsInfo")) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.encode(message.evonodesProposedBlockCountsInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify(message.evonodesProposedBlockCountsInfo); - if (error) - return "evonodesProposedBlockCountsInfo." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 - */ - GetEvonodesProposedEpochBlocksResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); - if (object.evonodesProposedBlockCountsInfo != null) { - if (typeof object.evonodesProposedBlockCountsInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.evonodesProposedBlockCountsInfo: object expected"); - message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.fromObject(object.evonodesProposedBlockCountsInfo); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { - object.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.toObject(message.evonodesProposedBlockCountsInfo, options); - if (options.oneofs) - object.result = "evonodesProposedBlockCountsInfo"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks = (function() { - - /** - * Properties of an EvonodeProposedBlocks. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @interface IEvonodeProposedBlocks - * @property {Uint8Array|null} [proTxHash] EvonodeProposedBlocks proTxHash - * @property {number|Long|null} [count] EvonodeProposedBlocks count - */ - - /** - * Constructs a new EvonodeProposedBlocks. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @classdesc Represents an EvonodeProposedBlocks. - * @implements IEvonodeProposedBlocks - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set - */ - function EvonodeProposedBlocks(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvonodeProposedBlocks proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @instance - */ - EvonodeProposedBlocks.prototype.proTxHash = $util.newBuffer([]); - - /** - * EvonodeProposedBlocks count. - * @member {number|Long} count - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @instance - */ - EvonodeProposedBlocks.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new EvonodeProposedBlocks instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks instance - */ - EvonodeProposedBlocks.create = function create(properties) { - return new EvonodeProposedBlocks(properties); - }; - - /** - * Encodes the specified EvonodeProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvonodeProposedBlocks.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.count); - return writer; - }; - - /** - * Encodes the specified EvonodeProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvonodeProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvonodeProposedBlocks message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvonodeProposedBlocks.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proTxHash = reader.bytes(); - break; - case 2: - message.count = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvonodeProposedBlocks message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvonodeProposedBlocks.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvonodeProposedBlocks message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvonodeProposedBlocks.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; - - /** - * Creates an EvonodeProposedBlocks message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks - */ - EvonodeProposedBlocks.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = true; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an EvonodeProposedBlocks message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} message EvonodeProposedBlocks - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvonodeProposedBlocks.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - } - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber(true) : message.count; - return object; - }; - - /** - * Converts this EvonodeProposedBlocks to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks - * @instance - * @returns {Object.} JSON object - */ - EvonodeProposedBlocks.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EvonodeProposedBlocks; - })(); - - GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks = (function() { - - /** - * Properties of an EvonodesProposedBlocks. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @interface IEvonodesProposedBlocks - * @property {Array.|null} [evonodesProposedBlockCounts] EvonodesProposedBlocks evonodesProposedBlockCounts - */ - - /** - * Constructs a new EvonodesProposedBlocks. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 - * @classdesc Represents an EvonodesProposedBlocks. - * @implements IEvonodesProposedBlocks - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set - */ - function EvonodesProposedBlocks(properties) { - this.evonodesProposedBlockCounts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvonodesProposedBlocks evonodesProposedBlockCounts. - * @member {Array.} evonodesProposedBlockCounts - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @instance - */ - EvonodesProposedBlocks.prototype.evonodesProposedBlockCounts = $util.emptyArray; - - /** - * Creates a new EvonodesProposedBlocks instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks instance - */ - EvonodesProposedBlocks.create = function create(properties) { - return new EvonodesProposedBlocks(properties); - }; - - /** - * Encodes the specified EvonodesProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvonodesProposedBlocks.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evonodesProposedBlockCounts != null && message.evonodesProposedBlockCounts.length) - for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.encode(message.evonodesProposedBlockCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvonodesProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvonodesProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvonodesProposedBlocks message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvonodesProposedBlocks.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length)) - message.evonodesProposedBlockCounts = []; - message.evonodesProposedBlockCounts.push($root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvonodesProposedBlocks message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvonodesProposedBlocks.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvonodesProposedBlocks message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvonodesProposedBlocks.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evonodesProposedBlockCounts != null && message.hasOwnProperty("evonodesProposedBlockCounts")) { - if (!Array.isArray(message.evonodesProposedBlockCounts)) - return "evonodesProposedBlockCounts: array expected"; - for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify(message.evonodesProposedBlockCounts[i]); - if (error) - return "evonodesProposedBlockCounts." + error; - } - } - return null; - }; - - /** - * Creates an EvonodesProposedBlocks message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks - */ - EvonodesProposedBlocks.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); - if (object.evonodesProposedBlockCounts) { - if (!Array.isArray(object.evonodesProposedBlockCounts)) - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: array expected"); - message.evonodesProposedBlockCounts = []; - for (var i = 0; i < object.evonodesProposedBlockCounts.length; ++i) { - if (typeof object.evonodesProposedBlockCounts[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: object expected"); - message.evonodesProposedBlockCounts[i] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.fromObject(object.evonodesProposedBlockCounts[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EvonodesProposedBlocks message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} message EvonodesProposedBlocks - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvonodesProposedBlocks.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evonodesProposedBlockCounts = []; - if (message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length) { - object.evonodesProposedBlockCounts = []; - for (var j = 0; j < message.evonodesProposedBlockCounts.length; ++j) - object.evonodesProposedBlockCounts[j] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.toObject(message.evonodesProposedBlockCounts[j], options); - } - return object; - }; - - /** - * Converts this EvonodesProposedBlocks to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks - * @instance - * @returns {Object.} JSON object - */ - EvonodesProposedBlocks.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EvonodesProposedBlocks; - })(); - - return GetEvonodesProposedEpochBlocksResponseV0; - })(); - - return GetEvonodesProposedEpochBlocksResponse; - })(); - - v0.GetEvonodesProposedEpochBlocksByRangeRequest = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksByRangeRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEvonodesProposedEpochBlocksByRangeRequest - * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByRangeRequest v0 - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequest. - * @implements IGetEvonodesProposedEpochBlocksByRangeRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksByRangeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksByRangeRequest v0. - * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksByRangeRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksByRangeRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest instance - */ - GetEvonodesProposedEpochBlocksByRangeRequest.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksByRangeRequest(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByRangeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByRangeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByRangeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksByRangeRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksByRangeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksByRangeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest - */ - GetEvonodesProposedEpochBlocksByRangeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksByRangeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksByRangeRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksByRangeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 = (function() { - - /** - * Properties of a GetEvonodesProposedEpochBlocksByRangeRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @interface IGetEvonodesProposedEpochBlocksByRangeRequestV0 - * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch - * @property {number|null} [limit] GetEvonodesProposedEpochBlocksByRangeRequestV0 limit - * @property {Uint8Array|null} [startAfter] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter - * @property {Uint8Array|null} [startAt] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt - * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByRangeRequestV0 prove - */ - - /** - * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest - * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequestV0. - * @implements IGetEvonodesProposedEpochBlocksByRangeRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set - */ - function GetEvonodesProposedEpochBlocksByRangeRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch. - * @member {number} epoch - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.epoch = 0; - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.limit = 0; - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter. - * @member {Uint8Array} startAfter - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAfter = $util.newBuffer([]); - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt. - * @member {Uint8Array} startAt - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAt = $util.newBuffer([]); - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.prove = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEvonodesProposedEpochBlocksByRangeRequestV0 start. - * @member {"startAfter"|"startAt"|undefined} start - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - */ - Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype, "start", { - get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEvonodesProposedEpochBlocksByRangeRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 instance - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.create = function create(properties) { - return new GetEvonodesProposedEpochBlocksByRangeRequestV0(properties); - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.limit); - if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.startAfter); - if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startAt); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.epoch = reader.uint32(); - break; - case 2: - message.limit = reader.uint32(); - break; - case 3: - message.startAfter = reader.bytes(); - break; - case 4: - message.startAt = reader.bytes(); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - properties.start = 1; - if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) - return "startAfter: buffer expected"; - } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - if (properties.start === 1) - return "start: multiple values"; - properties.start = 1; - if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) - return "startAt: buffer expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); - if (object.epoch != null) - message.epoch = object.epoch >>> 0; - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.startAfter != null) - if (typeof object.startAfter === "string") - $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); - else if (object.startAfter.length >= 0) - message.startAfter = object.startAfter; - if (object.startAt != null) - if (typeof object.startAt === "string") - $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); - else if (object.startAt.length >= 0) - message.startAt = object.startAt; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.epoch = 0; - object.limit = 0; - object.prove = false; - } - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; - if (options.oneofs) - object.start = "startAfter"; - } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; - if (options.oneofs) - object.start = "startAt"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetEvonodesProposedEpochBlocksByRangeRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetEvonodesProposedEpochBlocksByRangeRequestV0; - })(); - - return GetEvonodesProposedEpochBlocksByRangeRequest; - })(); - - v0.GetIdentitiesBalancesRequest = (function() { - - /** - * Properties of a GetIdentitiesBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesBalancesRequest - * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null} [v0] GetIdentitiesBalancesRequest v0 - */ - - /** - * Constructs a new GetIdentitiesBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesBalancesRequest. - * @implements IGetIdentitiesBalancesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set - */ - function GetIdentitiesBalancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @instance - */ - GetIdentitiesBalancesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesBalancesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @instance - */ - Object.defineProperty(GetIdentitiesBalancesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesBalancesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest instance - */ - GetIdentitiesBalancesRequest.create = function create(properties) { - return new GetIdentitiesBalancesRequest(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesBalancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest - */ - GetIdentitiesBalancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesBalancesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 = (function() { - - /** - * Properties of a GetIdentitiesBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @interface IGetIdentitiesBalancesRequestV0 - * @property {Array.|null} [ids] GetIdentitiesBalancesRequestV0 ids - * @property {boolean|null} [prove] GetIdentitiesBalancesRequestV0 prove - */ - - /** - * Constructs a new GetIdentitiesBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest - * @classdesc Represents a GetIdentitiesBalancesRequestV0. - * @implements IGetIdentitiesBalancesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set - */ - function GetIdentitiesBalancesRequestV0(properties) { - this.ids = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesRequestV0 ids. - * @member {Array.} ids - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @instance - */ - GetIdentitiesBalancesRequestV0.prototype.ids = $util.emptyArray; - - /** - * GetIdentitiesBalancesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @instance - */ - GetIdentitiesBalancesRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentitiesBalancesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 instance - */ - GetIdentitiesBalancesRequestV0.create = function create(properties) { - return new GetIdentitiesBalancesRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ids != null && message.ids.length) - for (var i = 0; i < message.ids.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ids && message.ids.length)) - message.ids = []; - message.ids.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ids != null && message.hasOwnProperty("ids")) { - if (!Array.isArray(message.ids)) - return "ids: array expected"; - for (var i = 0; i < message.ids.length; ++i) - if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) - return "ids: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentitiesBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 - */ - GetIdentitiesBalancesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); - if (object.ids) { - if (!Array.isArray(object.ids)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids: array expected"); - message.ids = []; - for (var i = 0; i < object.ids.length; ++i) - if (typeof object.ids[i] === "string") - $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); - else if (object.ids[i].length >= 0) - message.ids[i] = object.ids[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ids = []; - if (options.defaults) - object.prove = false; - if (message.ids && message.ids.length) { - object.ids = []; - for (var j = 0; j < message.ids.length; ++j) - object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentitiesBalancesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesBalancesRequestV0; - })(); - - return GetIdentitiesBalancesRequest; - })(); - - v0.GetIdentitiesBalancesResponse = (function() { - - /** - * Properties of a GetIdentitiesBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesBalancesResponse - * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null} [v0] GetIdentitiesBalancesResponse v0 - */ - - /** - * Constructs a new GetIdentitiesBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesBalancesResponse. - * @implements IGetIdentitiesBalancesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set - */ - function GetIdentitiesBalancesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @instance - */ - GetIdentitiesBalancesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesBalancesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @instance - */ - Object.defineProperty(GetIdentitiesBalancesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesBalancesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse instance - */ - GetIdentitiesBalancesResponse.create = function create(properties) { - return new GetIdentitiesBalancesResponse(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesBalancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse - */ - GetIdentitiesBalancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesBalancesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 = (function() { - - /** - * Properties of a GetIdentitiesBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @interface IGetIdentitiesBalancesResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null} [identitiesBalances] GetIdentitiesBalancesResponseV0 identitiesBalances - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesBalancesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesBalancesResponseV0 metadata - */ - - /** - * Constructs a new GetIdentitiesBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse - * @classdesc Represents a GetIdentitiesBalancesResponseV0. - * @implements IGetIdentitiesBalancesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set - */ - function GetIdentitiesBalancesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesBalancesResponseV0 identitiesBalances. - * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null|undefined} identitiesBalances - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - */ - GetIdentitiesBalancesResponseV0.prototype.identitiesBalances = null; - - /** - * GetIdentitiesBalancesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - */ - GetIdentitiesBalancesResponseV0.prototype.proof = null; - - /** - * GetIdentitiesBalancesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - */ - GetIdentitiesBalancesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesBalancesResponseV0 result. - * @member {"identitiesBalances"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - */ - Object.defineProperty(GetIdentitiesBalancesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identitiesBalances", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesBalancesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 instance - */ - GetIdentitiesBalancesResponseV0.create = function create(properties) { - return new GetIdentitiesBalancesResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identitiesBalances != null && Object.hasOwnProperty.call(message, "identitiesBalances")) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.encode(message.identitiesBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesBalancesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesBalancesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify(message.identitiesBalances); - if (error) - return "identitiesBalances." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentitiesBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 - */ - GetIdentitiesBalancesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); - if (object.identitiesBalances != null) { - if (typeof object.identitiesBalances !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.identitiesBalances: object expected"); - message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.fromObject(object.identitiesBalances); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesBalancesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesBalancesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { - object.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.toObject(message.identitiesBalances, options); - if (options.oneofs) - object.result = "identitiesBalances"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentitiesBalancesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesBalancesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesBalancesResponseV0.IdentityBalance = (function() { - - /** - * Properties of an IdentityBalance. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @interface IIdentityBalance - * @property {Uint8Array|null} [identityId] IdentityBalance identityId - * @property {number|Long|null} [balance] IdentityBalance balance - */ - - /** - * Constructs a new IdentityBalance. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @classdesc Represents an IdentityBalance. - * @implements IIdentityBalance - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set - */ - function IdentityBalance(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityBalance identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @instance - */ - IdentityBalance.prototype.identityId = $util.newBuffer([]); - - /** - * IdentityBalance balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @instance - */ - IdentityBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new IdentityBalance instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance instance - */ - IdentityBalance.create = function create(properties) { - return new IdentityBalance(properties); - }; - - /** - * Encodes the specified IdentityBalance message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityBalance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); - return writer; - }; - - /** - * Encodes the specified IdentityBalance message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityBalance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityBalance message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityBalance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.balance = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityBalance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityBalance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityBalance message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityBalance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.balance != null && message.hasOwnProperty("balance")) - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - return null; - }; - - /** - * Creates an IdentityBalance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance - */ - IdentityBalance.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an IdentityBalance message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} message IdentityBalance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityBalance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.balance = options.longs === String ? "0" : 0; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.balance != null && message.hasOwnProperty("balance")) - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - return object; - }; - - /** - * Converts this IdentityBalance to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance - * @instance - * @returns {Object.} JSON object - */ - IdentityBalance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityBalance; - })(); - - GetIdentitiesBalancesResponseV0.IdentitiesBalances = (function() { - - /** - * Properties of an IdentitiesBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @interface IIdentitiesBalances - * @property {Array.|null} [entries] IdentitiesBalances entries - */ - - /** - * Constructs a new IdentitiesBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 - * @classdesc Represents an IdentitiesBalances. - * @implements IIdentitiesBalances - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set - */ - function IdentitiesBalances(properties) { - this.entries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentitiesBalances entries. - * @member {Array.} entries - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @instance - */ - IdentitiesBalances.prototype.entries = $util.emptyArray; - - /** - * Creates a new IdentitiesBalances instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances instance - */ - IdentitiesBalances.create = function create(properties) { - return new IdentitiesBalances(properties); - }; - - /** - * Encodes the specified IdentitiesBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitiesBalances.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (var i = 0; i < message.entries.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentitiesBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentitiesBalances.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentitiesBalances message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitiesBalances.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentitiesBalances message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentitiesBalances.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentitiesBalances message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentitiesBalances.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (var i = 0; i < message.entries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify(message.entries[i]); - if (error) - return "entries." + error; - } - } - return null; - }; - - /** - * Creates an IdentitiesBalances message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances - */ - IdentitiesBalances.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: array expected"); - message.entries = []; - for (var i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: object expected"); - message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.fromObject(object.entries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentitiesBalances message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} message IdentitiesBalances - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentitiesBalances.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entries = []; - if (message.entries && message.entries.length) { - object.entries = []; - for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.toObject(message.entries[j], options); - } - return object; - }; - - /** - * Converts this IdentitiesBalances to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances - * @instance - * @returns {Object.} JSON object - */ - IdentitiesBalances.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentitiesBalances; - })(); - - return GetIdentitiesBalancesResponseV0; - })(); - - return GetIdentitiesBalancesResponse; - })(); - - v0.GetDataContractRequest = (function() { - - /** - * Properties of a GetDataContractRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractRequest - * @property {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null} [v0] GetDataContractRequest v0 - */ - - /** - * Constructs a new GetDataContractRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractRequest. - * @implements IGetDataContractRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set - */ - function GetDataContractRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractRequest v0. - * @member {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @instance - */ - GetDataContractRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @instance - */ - Object.defineProperty(GetDataContractRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest instance - */ - GetDataContractRequest.create = function create(properties) { - return new GetDataContractRequest(properties); - }; - - /** - * Encodes the specified GetDataContractRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest - */ - GetDataContractRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest} message GetDataContractRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @instance - * @returns {Object.} JSON object - */ - GetDataContractRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractRequest.GetDataContractRequestV0 = (function() { - - /** - * Properties of a GetDataContractRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @interface IGetDataContractRequestV0 - * @property {Uint8Array|null} [id] GetDataContractRequestV0 id - * @property {boolean|null} [prove] GetDataContractRequestV0 prove - */ - - /** - * Constructs a new GetDataContractRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest - * @classdesc Represents a GetDataContractRequestV0. - * @implements IGetDataContractRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set - */ - function GetDataContractRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @instance - */ - GetDataContractRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetDataContractRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @instance - */ - GetDataContractRequestV0.prototype.prove = false; - - /** - * Creates a new GetDataContractRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 instance - */ - GetDataContractRequestV0.create = function create(properties) { - return new GetDataContractRequestV0(properties); - }; - - /** - * Encodes the specified GetDataContractRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetDataContractRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetDataContractRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 - */ - GetDataContractRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetDataContractRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} message GetDataContractRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetDataContractRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractRequestV0; - })(); - - return GetDataContractRequest; - })(); - - v0.GetDataContractResponse = (function() { - - /** - * Properties of a GetDataContractResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractResponse - * @property {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null} [v0] GetDataContractResponse v0 - */ - - /** - * Constructs a new GetDataContractResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractResponse. - * @implements IGetDataContractResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set - */ - function GetDataContractResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractResponse v0. - * @member {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @instance - */ - GetDataContractResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @instance - */ - Object.defineProperty(GetDataContractResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse instance - */ - GetDataContractResponse.create = function create(properties) { - return new GetDataContractResponse(properties); - }; - - /** - * Encodes the specified GetDataContractResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse - */ - GetDataContractResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse} message GetDataContractResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @instance - * @returns {Object.} JSON object - */ - GetDataContractResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractResponse.GetDataContractResponseV0 = (function() { - - /** - * Properties of a GetDataContractResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @interface IGetDataContractResponseV0 - * @property {Uint8Array|null} [dataContract] GetDataContractResponseV0 dataContract - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractResponseV0 metadata - */ - - /** - * Constructs a new GetDataContractResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse - * @classdesc Represents a GetDataContractResponseV0. - * @implements IGetDataContractResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set - */ - function GetDataContractResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractResponseV0 dataContract. - * @member {Uint8Array} dataContract - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - */ - GetDataContractResponseV0.prototype.dataContract = $util.newBuffer([]); - - /** - * GetDataContractResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - */ - GetDataContractResponseV0.prototype.proof = null; - - /** - * GetDataContractResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - */ - GetDataContractResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractResponseV0 result. - * @member {"dataContract"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - */ - Object.defineProperty(GetDataContractResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["dataContract", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 instance - */ - GetDataContractResponseV0.create = function create(properties) { - return new GetDataContractResponseV0(properties); - }; - - /** - * Encodes the specified GetDataContractResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContract); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataContract = reader.bytes(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) { - properties.result = 1; - if (!(message.dataContract && typeof message.dataContract.length === "number" || $util.isString(message.dataContract))) - return "dataContract: buffer expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetDataContractResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 - */ - GetDataContractResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); - if (object.dataContract != null) - if (typeof object.dataContract === "string") - $util.base64.decode(object.dataContract, message.dataContract = $util.newBuffer($util.base64.length(object.dataContract)), 0); - else if (object.dataContract.length >= 0) - message.dataContract = object.dataContract; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} message GetDataContractResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) { - object.dataContract = options.bytes === String ? $util.base64.encode(message.dataContract, 0, message.dataContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContract) : message.dataContract; - if (options.oneofs) - object.result = "dataContract"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetDataContractResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractResponseV0; - })(); - - return GetDataContractResponse; - })(); - - v0.GetDataContractsRequest = (function() { - - /** - * Properties of a GetDataContractsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractsRequest - * @property {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null} [v0] GetDataContractsRequest v0 - */ - - /** - * Constructs a new GetDataContractsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractsRequest. - * @implements IGetDataContractsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set - */ - function GetDataContractsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractsRequest v0. - * @member {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @instance - */ - GetDataContractsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @instance - */ - Object.defineProperty(GetDataContractsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest instance - */ - GetDataContractsRequest.create = function create(properties) { - return new GetDataContractsRequest(properties); - }; - - /** - * Encodes the specified GetDataContractsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest - */ - GetDataContractsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest} message GetDataContractsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @instance - * @returns {Object.} JSON object - */ - GetDataContractsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractsRequest.GetDataContractsRequestV0 = (function() { - - /** - * Properties of a GetDataContractsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @interface IGetDataContractsRequestV0 - * @property {Array.|null} [ids] GetDataContractsRequestV0 ids - * @property {boolean|null} [prove] GetDataContractsRequestV0 prove - */ - - /** - * Constructs a new GetDataContractsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest - * @classdesc Represents a GetDataContractsRequestV0. - * @implements IGetDataContractsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set - */ - function GetDataContractsRequestV0(properties) { - this.ids = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractsRequestV0 ids. - * @member {Array.} ids - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @instance - */ - GetDataContractsRequestV0.prototype.ids = $util.emptyArray; - - /** - * GetDataContractsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @instance - */ - GetDataContractsRequestV0.prototype.prove = false; - - /** - * Creates a new GetDataContractsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 instance - */ - GetDataContractsRequestV0.create = function create(properties) { - return new GetDataContractsRequestV0(properties); - }; - - /** - * Encodes the specified GetDataContractsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ids != null && message.ids.length) - for (var i = 0; i < message.ids.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetDataContractsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ids && message.ids.length)) - message.ids = []; - message.ids.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ids != null && message.hasOwnProperty("ids")) { - if (!Array.isArray(message.ids)) - return "ids: array expected"; - for (var i = 0; i < message.ids.length; ++i) - if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) - return "ids: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetDataContractsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 - */ - GetDataContractsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); - if (object.ids) { - if (!Array.isArray(object.ids)) - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.ids: array expected"); - message.ids = []; - for (var i = 0; i < object.ids.length; ++i) - if (typeof object.ids[i] === "string") - $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); - else if (object.ids[i].length >= 0) - message.ids[i] = object.ids[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetDataContractsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} message GetDataContractsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ids = []; - if (options.defaults) - object.prove = false; - if (message.ids && message.ids.length) { - object.ids = []; - for (var j = 0; j < message.ids.length; ++j) - object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetDataContractsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractsRequestV0; - })(); - - return GetDataContractsRequest; - })(); - - v0.GetDataContractsResponse = (function() { - - /** - * Properties of a GetDataContractsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractsResponse - * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null} [v0] GetDataContractsResponse v0 - */ - - /** - * Constructs a new GetDataContractsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractsResponse. - * @implements IGetDataContractsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set - */ - function GetDataContractsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractsResponse v0. - * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @instance - */ - GetDataContractsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @instance - */ - Object.defineProperty(GetDataContractsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse instance - */ - GetDataContractsResponse.create = function create(properties) { - return new GetDataContractsResponse(properties); - }; - - /** - * Encodes the specified GetDataContractsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse - */ - GetDataContractsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} message GetDataContractsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @instance - * @returns {Object.} JSON object - */ - GetDataContractsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractsResponse.DataContractEntry = (function() { - - /** - * Properties of a DataContractEntry. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @interface IDataContractEntry - * @property {Uint8Array|null} [identifier] DataContractEntry identifier - * @property {google.protobuf.IBytesValue|null} [dataContract] DataContractEntry dataContract - */ - - /** - * Constructs a new DataContractEntry. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @classdesc Represents a DataContractEntry. - * @implements IDataContractEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set - */ - function DataContractEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataContractEntry identifier. - * @member {Uint8Array} identifier - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @instance - */ - DataContractEntry.prototype.identifier = $util.newBuffer([]); - - /** - * DataContractEntry dataContract. - * @member {google.protobuf.IBytesValue|null|undefined} dataContract - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @instance - */ - DataContractEntry.prototype.dataContract = null; - - /** - * Creates a new DataContractEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry instance - */ - DataContractEntry.create = function create(properties) { - return new DataContractEntry(properties); - }; - - /** - * Encodes the specified DataContractEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); - if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) - $root.google.protobuf.BytesValue.encode(message.dataContract, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataContractEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataContractEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identifier = reader.bytes(); - break; - case 2: - message.dataContract = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataContractEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataContractEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataContractEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identifier != null && message.hasOwnProperty("identifier")) - if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) - return "identifier: buffer expected"; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) { - var error = $root.google.protobuf.BytesValue.verify(message.dataContract); - if (error) - return "dataContract." + error; - } - return null; - }; - - /** - * Creates a DataContractEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry - */ - DataContractEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); - if (object.identifier != null) - if (typeof object.identifier === "string") - $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); - else if (object.identifier.length >= 0) - message.identifier = object.identifier; - if (object.dataContract != null) { - if (typeof object.dataContract !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.dataContract: object expected"); - message.dataContract = $root.google.protobuf.BytesValue.fromObject(object.dataContract); - } - return message; - }; - - /** - * Creates a plain object from a DataContractEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} message DataContractEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataContractEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identifier = ""; - else { - object.identifier = []; - if (options.bytes !== Array) - object.identifier = $util.newBuffer(object.identifier); - } - object.dataContract = null; - } - if (message.identifier != null && message.hasOwnProperty("identifier")) - object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) - object.dataContract = $root.google.protobuf.BytesValue.toObject(message.dataContract, options); - return object; - }; - - /** - * Converts this DataContractEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry - * @instance - * @returns {Object.} JSON object - */ - DataContractEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DataContractEntry; - })(); - - GetDataContractsResponse.DataContracts = (function() { - - /** - * Properties of a DataContracts. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @interface IDataContracts - * @property {Array.|null} [dataContractEntries] DataContracts dataContractEntries - */ - - /** - * Constructs a new DataContracts. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @classdesc Represents a DataContracts. - * @implements IDataContracts - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set - */ - function DataContracts(properties) { - this.dataContractEntries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataContracts dataContractEntries. - * @member {Array.} dataContractEntries - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @instance - */ - DataContracts.prototype.dataContractEntries = $util.emptyArray; - - /** - * Creates a new DataContracts instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts instance - */ - DataContracts.create = function create(properties) { - return new DataContracts(properties); - }; - - /** - * Encodes the specified DataContracts message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContracts.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContractEntries != null && message.dataContractEntries.length) - for (var i = 0; i < message.dataContractEntries.length; ++i) - $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataContracts message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContracts.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataContracts message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContracts.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.dataContractEntries && message.dataContractEntries.length)) - message.dataContractEntries = []; - message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataContracts message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContracts.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataContracts message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataContracts.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { - if (!Array.isArray(message.dataContractEntries)) - return "dataContractEntries: array expected"; - for (var i = 0; i < message.dataContractEntries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify(message.dataContractEntries[i]); - if (error) - return "dataContractEntries." + error; - } - } - return null; - }; - - /** - * Creates a DataContracts message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts - */ - DataContracts.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); - if (object.dataContractEntries) { - if (!Array.isArray(object.dataContractEntries)) - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: array expected"); - message.dataContractEntries = []; - for (var i = 0; i < object.dataContractEntries.length; ++i) { - if (typeof object.dataContractEntries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: object expected"); - message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.fromObject(object.dataContractEntries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DataContracts message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} message DataContracts - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataContracts.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dataContractEntries = []; - if (message.dataContractEntries && message.dataContractEntries.length) { - object.dataContractEntries = []; - for (var j = 0; j < message.dataContractEntries.length; ++j) - object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject(message.dataContractEntries[j], options); - } - return object; - }; - - /** - * Converts this DataContracts to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts - * @instance - * @returns {Object.} JSON object - */ - DataContracts.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DataContracts; - })(); - - GetDataContractsResponse.GetDataContractsResponseV0 = (function() { - - /** - * Properties of a GetDataContractsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @interface IGetDataContractsResponseV0 - * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null} [dataContracts] GetDataContractsResponseV0 dataContracts - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractsResponseV0 metadata - */ - - /** - * Constructs a new GetDataContractsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse - * @classdesc Represents a GetDataContractsResponseV0. - * @implements IGetDataContractsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set - */ - function GetDataContractsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractsResponseV0 dataContracts. - * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null|undefined} dataContracts - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - */ - GetDataContractsResponseV0.prototype.dataContracts = null; - - /** - * GetDataContractsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - */ - GetDataContractsResponseV0.prototype.proof = null; - - /** - * GetDataContractsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - */ - GetDataContractsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractsResponseV0 result. - * @member {"dataContracts"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - */ - Object.defineProperty(GetDataContractsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["dataContracts", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 instance - */ - GetDataContractsResponseV0.create = function create(properties) { - return new GetDataContractsResponseV0(properties); - }; - - /** - * Encodes the specified GetDataContractsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContracts != null && Object.hasOwnProperty.call(message, "dataContracts")) - $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.encode(message.dataContracts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify(message.dataContracts); - if (error) - return "dataContracts." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetDataContractsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 - */ - GetDataContractsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); - if (object.dataContracts != null) { - if (typeof object.dataContracts !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.dataContracts: object expected"); - message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.fromObject(object.dataContracts); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} message GetDataContractsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { - object.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(message.dataContracts, options); - if (options.oneofs) - object.result = "dataContracts"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetDataContractsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractsResponseV0; - })(); - - return GetDataContractsResponse; - })(); - - v0.GetDataContractHistoryRequest = (function() { - - /** - * Properties of a GetDataContractHistoryRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractHistoryRequest - * @property {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null} [v0] GetDataContractHistoryRequest v0 - */ - - /** - * Constructs a new GetDataContractHistoryRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractHistoryRequest. - * @implements IGetDataContractHistoryRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set - */ - function GetDataContractHistoryRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractHistoryRequest v0. - * @member {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @instance - */ - GetDataContractHistoryRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractHistoryRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @instance - */ - Object.defineProperty(GetDataContractHistoryRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractHistoryRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest instance - */ - GetDataContractHistoryRequest.create = function create(properties) { - return new GetDataContractHistoryRequest(properties); - }; - - /** - * Encodes the specified GetDataContractHistoryRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractHistoryRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractHistoryRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractHistoryRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractHistoryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest - */ - GetDataContractHistoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractHistoryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} message GetDataContractHistoryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractHistoryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractHistoryRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @instance - * @returns {Object.} JSON object - */ - GetDataContractHistoryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 = (function() { - - /** - * Properties of a GetDataContractHistoryRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @interface IGetDataContractHistoryRequestV0 - * @property {Uint8Array|null} [id] GetDataContractHistoryRequestV0 id - * @property {google.protobuf.IUInt32Value|null} [limit] GetDataContractHistoryRequestV0 limit - * @property {google.protobuf.IUInt32Value|null} [offset] GetDataContractHistoryRequestV0 offset - * @property {number|Long|null} [startAtMs] GetDataContractHistoryRequestV0 startAtMs - * @property {boolean|null} [prove] GetDataContractHistoryRequestV0 prove - */ - - /** - * Constructs a new GetDataContractHistoryRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest - * @classdesc Represents a GetDataContractHistoryRequestV0. - * @implements IGetDataContractHistoryRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set - */ - function GetDataContractHistoryRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractHistoryRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetDataContractHistoryRequestV0 limit. - * @member {google.protobuf.IUInt32Value|null|undefined} limit - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.limit = null; - - /** - * GetDataContractHistoryRequestV0 offset. - * @member {google.protobuf.IUInt32Value|null|undefined} offset - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.offset = null; - - /** - * GetDataContractHistoryRequestV0 startAtMs. - * @member {number|Long} startAtMs - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.startAtMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetDataContractHistoryRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - */ - GetDataContractHistoryRequestV0.prototype.prove = false; - - /** - * Creates a new GetDataContractHistoryRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 instance - */ - GetDataContractHistoryRequestV0.create = function create(properties) { - return new GetDataContractHistoryRequestV0(properties); - }; - - /** - * Encodes the specified GetDataContractHistoryRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.startAtMs != null && Object.hasOwnProperty.call(message, "startAtMs")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startAtMs); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetDataContractHistoryRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 3: - message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 4: - message.startAtMs = reader.uint64(); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractHistoryRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractHistoryRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.UInt32Value.verify(message.limit); - if (error) - return "limit." + error; - } - if (message.offset != null && message.hasOwnProperty("offset")) { - var error = $root.google.protobuf.UInt32Value.verify(message.offset); - if (error) - return "offset." + error; - } - if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) - if (!$util.isInteger(message.startAtMs) && !(message.startAtMs && $util.isInteger(message.startAtMs.low) && $util.isInteger(message.startAtMs.high))) - return "startAtMs: integer|Long expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetDataContractHistoryRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 - */ - GetDataContractHistoryRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.limit: object expected"); - message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); - } - if (object.offset != null) { - if (typeof object.offset !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.offset: object expected"); - message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); - } - if (object.startAtMs != null) - if ($util.Long) - (message.startAtMs = $util.Long.fromValue(object.startAtMs)).unsigned = true; - else if (typeof object.startAtMs === "string") - message.startAtMs = parseInt(object.startAtMs, 10); - else if (typeof object.startAtMs === "number") - message.startAtMs = object.startAtMs; - else if (typeof object.startAtMs === "object") - message.startAtMs = new $util.LongBits(object.startAtMs.low >>> 0, object.startAtMs.high >>> 0).toNumber(true); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetDataContractHistoryRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractHistoryRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.limit = null; - object.offset = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.startAtMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startAtMs = options.longs === String ? "0" : 0; - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); - if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) - if (typeof message.startAtMs === "number") - object.startAtMs = options.longs === String ? String(message.startAtMs) : message.startAtMs; - else - object.startAtMs = options.longs === String ? $util.Long.prototype.toString.call(message.startAtMs) : options.longs === Number ? new $util.LongBits(message.startAtMs.low >>> 0, message.startAtMs.high >>> 0).toNumber(true) : message.startAtMs; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetDataContractHistoryRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractHistoryRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDataContractHistoryRequestV0; - })(); - - return GetDataContractHistoryRequest; - })(); - - v0.GetDataContractHistoryResponse = (function() { - - /** - * Properties of a GetDataContractHistoryResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractHistoryResponse - * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null} [v0] GetDataContractHistoryResponse v0 - */ - - /** - * Constructs a new GetDataContractHistoryResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractHistoryResponse. - * @implements IGetDataContractHistoryResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set - */ - function GetDataContractHistoryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractHistoryResponse v0. - * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @instance - */ - GetDataContractHistoryResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractHistoryResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @instance - */ - Object.defineProperty(GetDataContractHistoryResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractHistoryResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse instance - */ - GetDataContractHistoryResponse.create = function create(properties) { - return new GetDataContractHistoryResponse(properties); - }; - - /** - * Encodes the specified GetDataContractHistoryResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractHistoryResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractHistoryResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractHistoryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDataContractHistoryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse - */ - GetDataContractHistoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractHistoryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} message GetDataContractHistoryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractHistoryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDataContractHistoryResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @instance - * @returns {Object.} JSON object - */ - GetDataContractHistoryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 = (function() { - - /** - * Properties of a GetDataContractHistoryResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @interface IGetDataContractHistoryResponseV0 - * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null} [dataContractHistory] GetDataContractHistoryResponseV0 dataContractHistory - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractHistoryResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractHistoryResponseV0 metadata - */ - - /** - * Constructs a new GetDataContractHistoryResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse - * @classdesc Represents a GetDataContractHistoryResponseV0. - * @implements IGetDataContractHistoryResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set - */ - function GetDataContractHistoryResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataContractHistoryResponseV0 dataContractHistory. - * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null|undefined} dataContractHistory - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - */ - GetDataContractHistoryResponseV0.prototype.dataContractHistory = null; - - /** - * GetDataContractHistoryResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - */ - GetDataContractHistoryResponseV0.prototype.proof = null; - - /** - * GetDataContractHistoryResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - */ - GetDataContractHistoryResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDataContractHistoryResponseV0 result. - * @member {"dataContractHistory"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - */ - Object.defineProperty(GetDataContractHistoryResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["dataContractHistory", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDataContractHistoryResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 instance - */ - GetDataContractHistoryResponseV0.create = function create(properties) { - return new GetDataContractHistoryResponseV0(properties); - }; - - /** - * Encodes the specified GetDataContractHistoryResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContractHistory != null && Object.hasOwnProperty.call(message, "dataContractHistory")) - $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.encode(message.dataContractHistory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDataContractHistoryResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataContractHistoryResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataContractHistoryResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataContractHistoryResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataContractHistoryResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify(message.dataContractHistory); - if (error) - return "dataContractHistory." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetDataContractHistoryResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 - */ - GetDataContractHistoryResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); - if (object.dataContractHistory != null) { - if (typeof object.dataContractHistory !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.dataContractHistory: object expected"); - message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.fromObject(object.dataContractHistory); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDataContractHistoryResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataContractHistoryResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { - object.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.toObject(message.dataContractHistory, options); - if (options.oneofs) - object.result = "dataContractHistory"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetDataContractHistoryResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDataContractHistoryResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDataContractHistoryResponseV0.DataContractHistoryEntry = (function() { - - /** - * Properties of a DataContractHistoryEntry. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @interface IDataContractHistoryEntry - * @property {number|Long|null} [date] DataContractHistoryEntry date - * @property {Uint8Array|null} [value] DataContractHistoryEntry value - */ - - /** - * Constructs a new DataContractHistoryEntry. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @classdesc Represents a DataContractHistoryEntry. - * @implements IDataContractHistoryEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set - */ - function DataContractHistoryEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataContractHistoryEntry date. - * @member {number|Long} date - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @instance - */ - DataContractHistoryEntry.prototype.date = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DataContractHistoryEntry value. - * @member {Uint8Array} value - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @instance - */ - DataContractHistoryEntry.prototype.value = $util.newBuffer([]); - - /** - * Creates a new DataContractHistoryEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry instance - */ - DataContractHistoryEntry.create = function create(properties) { - return new DataContractHistoryEntry(properties); - }; - - /** - * Encodes the specified DataContractHistoryEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractHistoryEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.date != null && Object.hasOwnProperty.call(message, "date")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.date); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified DataContractHistoryEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractHistoryEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataContractHistoryEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractHistoryEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.date = reader.uint64(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataContractHistoryEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractHistoryEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataContractHistoryEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataContractHistoryEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.date != null && message.hasOwnProperty("date")) - if (!$util.isInteger(message.date) && !(message.date && $util.isInteger(message.date.low) && $util.isInteger(message.date.high))) - return "date: integer|Long expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a DataContractHistoryEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry - */ - DataContractHistoryEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); - if (object.date != null) - if ($util.Long) - (message.date = $util.Long.fromValue(object.date)).unsigned = true; - else if (typeof object.date === "string") - message.date = parseInt(object.date, 10); - else if (typeof object.date === "number") - message.date = object.date; - else if (typeof object.date === "object") - message.date = new $util.LongBits(object.date.low >>> 0, object.date.high >>> 0).toNumber(true); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a DataContractHistoryEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} message DataContractHistoryEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataContractHistoryEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.date = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.date != null && message.hasOwnProperty("date")) - if (typeof message.date === "number") - object.date = options.longs === String ? String(message.date) : message.date; - else - object.date = options.longs === String ? $util.Long.prototype.toString.call(message.date) : options.longs === Number ? new $util.LongBits(message.date.low >>> 0, message.date.high >>> 0).toNumber(true) : message.date; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this DataContractHistoryEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry - * @instance - * @returns {Object.} JSON object - */ - DataContractHistoryEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DataContractHistoryEntry; - })(); - - GetDataContractHistoryResponseV0.DataContractHistory = (function() { - - /** - * Properties of a DataContractHistory. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @interface IDataContractHistory - * @property {Array.|null} [dataContractEntries] DataContractHistory dataContractEntries - */ - - /** - * Constructs a new DataContractHistory. - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 - * @classdesc Represents a DataContractHistory. - * @implements IDataContractHistory - * @constructor - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set - */ - function DataContractHistory(properties) { - this.dataContractEntries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataContractHistory dataContractEntries. - * @member {Array.} dataContractEntries - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @instance - */ - DataContractHistory.prototype.dataContractEntries = $util.emptyArray; - - /** - * Creates a new DataContractHistory instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory instance - */ - DataContractHistory.create = function create(properties) { - return new DataContractHistory(properties); - }; - - /** - * Encodes the specified DataContractHistory message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractHistory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContractEntries != null && message.dataContractEntries.length) - for (var i = 0; i < message.dataContractEntries.length; ++i) - $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataContractHistory message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataContractHistory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataContractHistory message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractHistory.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.dataContractEntries && message.dataContractEntries.length)) - message.dataContractEntries = []; - message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataContractHistory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataContractHistory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataContractHistory message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataContractHistory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { - if (!Array.isArray(message.dataContractEntries)) - return "dataContractEntries: array expected"; - for (var i = 0; i < message.dataContractEntries.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify(message.dataContractEntries[i]); - if (error) - return "dataContractEntries." + error; - } - } - return null; - }; - - /** - * Creates a DataContractHistory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory - */ - DataContractHistory.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); - if (object.dataContractEntries) { - if (!Array.isArray(object.dataContractEntries)) - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: array expected"); - message.dataContractEntries = []; - for (var i = 0; i < object.dataContractEntries.length; ++i) { - if (typeof object.dataContractEntries[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: object expected"); - message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.fromObject(object.dataContractEntries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DataContractHistory message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @static - * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} message DataContractHistory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataContractHistory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dataContractEntries = []; - if (message.dataContractEntries && message.dataContractEntries.length) { - object.dataContractEntries = []; - for (var j = 0; j < message.dataContractEntries.length; ++j) - object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.toObject(message.dataContractEntries[j], options); - } - return object; - }; - - /** - * Converts this DataContractHistory to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory - * @instance - * @returns {Object.} JSON object - */ - DataContractHistory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DataContractHistory; - })(); - - return GetDataContractHistoryResponseV0; - })(); - - return GetDataContractHistoryResponse; - })(); - - v0.GetDocumentsRequest = (function() { - - /** - * Properties of a GetDocumentsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsRequest - * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null} [v0] GetDocumentsRequest v0 - */ - - /** - * Constructs a new GetDocumentsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsRequest. - * @implements IGetDocumentsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set - */ - function GetDocumentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsRequest v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - GetDocumentsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - Object.defineProperty(GetDocumentsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDocumentsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest instance - */ - GetDocumentsRequest.create = function create(properties) { - return new GetDocumentsRequest(properties); - }; - - /** - * Encodes the specified GetDocumentsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest - */ - GetDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest} message GetDocumentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDocumentsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDocumentsRequest.GetDocumentsRequestV0 = (function() { - - /** - * Properties of a GetDocumentsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @interface IGetDocumentsRequestV0 - * @property {Uint8Array|null} [dataContractId] GetDocumentsRequestV0 dataContractId - * @property {string|null} [documentType] GetDocumentsRequestV0 documentType - * @property {Uint8Array|null} [where] GetDocumentsRequestV0 where - * @property {Uint8Array|null} [orderBy] GetDocumentsRequestV0 orderBy - * @property {number|null} [limit] GetDocumentsRequestV0 limit - * @property {Uint8Array|null} [startAfter] GetDocumentsRequestV0 startAfter - * @property {Uint8Array|null} [startAt] GetDocumentsRequestV0 startAt - * @property {boolean|null} [prove] GetDocumentsRequestV0 prove - */ - - /** - * Constructs a new GetDocumentsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @classdesc Represents a GetDocumentsRequestV0. - * @implements IGetDocumentsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set - */ - function GetDocumentsRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsRequestV0 dataContractId. - * @member {Uint8Array} dataContractId - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.dataContractId = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 documentType. - * @member {string} documentType - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.documentType = ""; - - /** - * GetDocumentsRequestV0 where. - * @member {Uint8Array} where - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.where = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 orderBy. - * @member {Uint8Array} orderBy - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.orderBy = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.limit = 0; - - /** - * GetDocumentsRequestV0 startAfter. - * @member {Uint8Array} startAfter - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.startAfter = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 startAt. - * @member {Uint8Array} startAt - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.startAt = $util.newBuffer([]); - - /** - * GetDocumentsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - GetDocumentsRequestV0.prototype.prove = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsRequestV0 start. - * @member {"startAfter"|"startAt"|undefined} start - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - */ - Object.defineProperty(GetDocumentsRequestV0.prototype, "start", { - get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDocumentsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 instance - */ - GetDocumentsRequestV0.create = function create(properties) { - return new GetDocumentsRequestV0(properties); - }; - - /** - * Encodes the specified GetDocumentsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); - if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); - if (message.where != null && Object.hasOwnProperty.call(message, "where")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); - if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); - if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetDocumentsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dataContractId = reader.bytes(); - break; - case 2: - message.documentType = reader.string(); - break; - case 3: - message.where = reader.bytes(); - break; - case 4: - message.orderBy = reader.bytes(); - break; - case 5: - message.limit = reader.uint32(); - break; - case 6: - message.startAfter = reader.bytes(); - break; - case 7: - message.startAt = reader.bytes(); - break; - case 8: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) - return "dataContractId: buffer expected"; - if (message.documentType != null && message.hasOwnProperty("documentType")) - if (!$util.isString(message.documentType)) - return "documentType: string expected"; - if (message.where != null && message.hasOwnProperty("where")) - if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) - return "where: buffer expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) - return "orderBy: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - properties.start = 1; - if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) - return "startAfter: buffer expected"; - } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - if (properties.start === 1) - return "start: multiple values"; - properties.start = 1; - if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) - return "startAt: buffer expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetDocumentsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 - */ - GetDocumentsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); - if (object.dataContractId != null) - if (typeof object.dataContractId === "string") - $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); - else if (object.dataContractId.length >= 0) - message.dataContractId = object.dataContractId; - if (object.documentType != null) - message.documentType = String(object.documentType); - if (object.where != null) - if (typeof object.where === "string") - $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); - else if (object.where.length >= 0) - message.where = object.where; - if (object.orderBy != null) - if (typeof object.orderBy === "string") - $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); - else if (object.orderBy.length >= 0) - message.orderBy = object.orderBy; - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.startAfter != null) - if (typeof object.startAfter === "string") - $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); - else if (object.startAfter.length >= 0) - message.startAfter = object.startAfter; - if (object.startAt != null) - if (typeof object.startAt === "string") - $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); - else if (object.startAt.length >= 0) - message.startAt = object.startAt; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetDocumentsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} message GetDocumentsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.dataContractId = ""; - else { - object.dataContractId = []; - if (options.bytes !== Array) - object.dataContractId = $util.newBuffer(object.dataContractId); - } - object.documentType = ""; - if (options.bytes === String) - object.where = ""; - else { - object.where = []; - if (options.bytes !== Array) - object.where = $util.newBuffer(object.where); - } - if (options.bytes === String) - object.orderBy = ""; - else { - object.orderBy = []; - if (options.bytes !== Array) - object.orderBy = $util.newBuffer(object.orderBy); - } - object.limit = 0; - object.prove = false; - } - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; - if (message.documentType != null && message.hasOwnProperty("documentType")) - object.documentType = message.documentType; - if (message.where != null && message.hasOwnProperty("where")) - object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; - if (options.oneofs) - object.start = "startAfter"; - } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; - if (options.oneofs) - object.start = "startAt"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetDocumentsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetDocumentsRequestV0; - })(); - - return GetDocumentsRequest; - })(); - - v0.GetDocumentsResponse = (function() { - - /** - * Properties of a GetDocumentsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsResponse - * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 - */ - - /** - * Constructs a new GetDocumentsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsResponse. - * @implements IGetDocumentsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - */ - function GetDocumentsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsResponse v0. - * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - GetDocumentsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - Object.defineProperty(GetDocumentsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDocumentsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance - */ - GetDocumentsResponse.create = function create(properties) { - return new GetDocumentsResponse(properties); - }; - - /** - * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse - */ - GetDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetDocumentsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDocumentsResponse.GetDocumentsResponseV0 = (function() { - - /** - * Properties of a GetDocumentsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @interface IGetDocumentsResponseV0 - * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata - */ - - /** - * Constructs a new GetDocumentsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @classdesc Represents a GetDocumentsResponseV0. - * @implements IGetDocumentsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set - */ - function GetDocumentsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentsResponseV0 documents. - * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.documents = null; - - /** - * GetDocumentsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.proof = null; - - /** - * GetDocumentsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - GetDocumentsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetDocumentsResponseV0 result. - * @member {"documents"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - */ - Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetDocumentsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance - */ - GetDocumentsResponseV0.create = function create(properties) { - return new GetDocumentsResponseV0(properties); - }; - - /** - * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) - $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.documents != null && message.hasOwnProperty("documents")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); - if (error) - return "documents." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 - */ - GetDocumentsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); - if (object.documents != null) { - if (typeof object.documents !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); - message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.documents != null && message.hasOwnProperty("documents")) { - object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); - if (options.oneofs) - object.result = "documents"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetDocumentsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetDocumentsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetDocumentsResponseV0.Documents = (function() { - - /** - * Properties of a Documents. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @interface IDocuments - * @property {Array.|null} [documents] Documents documents - */ - - /** - * Constructs a new Documents. - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 - * @classdesc Represents a Documents. - * @implements IDocuments - * @constructor - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set - */ - function Documents(properties) { - this.documents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Documents documents. - * @member {Array.} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @instance - */ - Documents.prototype.documents = $util.emptyArray; - - /** - * Creates a new Documents instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance - */ - Documents.create = function create(properties) { - return new Documents(properties); - }; - - /** - * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); - return writer; - }; - - /** - * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Documents message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Documents message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Documents message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Documents.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) - return "documents: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Documents message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents - */ - Documents.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - if (typeof object.documents[i] === "string") - $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); - else if (object.documents[i].length >= 0) - message.documents[i] = object.documents[i]; - } - return message; - }; - - /** - * Creates a plain object from a Documents message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Documents.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; - } - return object; - }; - - /** - * Converts this Documents to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents - * @instance - * @returns {Object.} JSON object - */ - Documents.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Documents; - })(); - - return GetDocumentsResponseV0; - })(); - - return GetDocumentsResponse; - })(); - - v0.GetIdentityByPublicKeyHashRequest = (function() { - - /** - * Properties of a GetIdentityByPublicKeyHashRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityByPublicKeyHashRequest - * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null} [v0] GetIdentityByPublicKeyHashRequest v0 - */ - - /** - * Constructs a new GetIdentityByPublicKeyHashRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityByPublicKeyHashRequest. - * @implements IGetIdentityByPublicKeyHashRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set - */ - function GetIdentityByPublicKeyHashRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityByPublicKeyHashRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @instance - */ - GetIdentityByPublicKeyHashRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityByPublicKeyHashRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @instance - */ - Object.defineProperty(GetIdentityByPublicKeyHashRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityByPublicKeyHashRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest instance - */ - GetIdentityByPublicKeyHashRequest.create = function create(properties) { - return new GetIdentityByPublicKeyHashRequest(properties); - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityByPublicKeyHashRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityByPublicKeyHashRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityByPublicKeyHashRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest - */ - GetIdentityByPublicKeyHashRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityByPublicKeyHashRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityByPublicKeyHashRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityByPublicKeyHashRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityByPublicKeyHashRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 = (function() { - - /** - * Properties of a GetIdentityByPublicKeyHashRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @interface IGetIdentityByPublicKeyHashRequestV0 - * @property {Uint8Array|null} [publicKeyHash] GetIdentityByPublicKeyHashRequestV0 publicKeyHash - * @property {boolean|null} [prove] GetIdentityByPublicKeyHashRequestV0 prove - */ - - /** - * Constructs a new GetIdentityByPublicKeyHashRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest - * @classdesc Represents a GetIdentityByPublicKeyHashRequestV0. - * @implements IGetIdentityByPublicKeyHashRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set - */ - function GetIdentityByPublicKeyHashRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityByPublicKeyHashRequestV0 publicKeyHash. - * @member {Uint8Array} publicKeyHash - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @instance - */ - GetIdentityByPublicKeyHashRequestV0.prototype.publicKeyHash = $util.newBuffer([]); - - /** - * GetIdentityByPublicKeyHashRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @instance - */ - GetIdentityByPublicKeyHashRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityByPublicKeyHashRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 instance - */ - GetIdentityByPublicKeyHashRequestV0.create = function create(properties) { - return new GetIdentityByPublicKeyHashRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.publicKeyHash != null && Object.hasOwnProperty.call(message, "publicKeyHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKeyHash); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.publicKeyHash = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityByPublicKeyHashRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityByPublicKeyHashRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) - if (!(message.publicKeyHash && typeof message.publicKeyHash.length === "number" || $util.isString(message.publicKeyHash))) - return "publicKeyHash: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityByPublicKeyHashRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 - */ - GetIdentityByPublicKeyHashRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); - if (object.publicKeyHash != null) - if (typeof object.publicKeyHash === "string") - $util.base64.decode(object.publicKeyHash, message.publicKeyHash = $util.newBuffer($util.base64.length(object.publicKeyHash)), 0); - else if (object.publicKeyHash.length >= 0) - message.publicKeyHash = object.publicKeyHash; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityByPublicKeyHashRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityByPublicKeyHashRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.publicKeyHash = ""; - else { - object.publicKeyHash = []; - if (options.bytes !== Array) - object.publicKeyHash = $util.newBuffer(object.publicKeyHash); - } - object.prove = false; - } - if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) - object.publicKeyHash = options.bytes === String ? $util.base64.encode(message.publicKeyHash, 0, message.publicKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeyHash) : message.publicKeyHash; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityByPublicKeyHashRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityByPublicKeyHashRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityByPublicKeyHashRequestV0; - })(); - - return GetIdentityByPublicKeyHashRequest; - })(); - - v0.GetIdentityByPublicKeyHashResponse = (function() { - - /** - * Properties of a GetIdentityByPublicKeyHashResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityByPublicKeyHashResponse - * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null} [v0] GetIdentityByPublicKeyHashResponse v0 - */ - - /** - * Constructs a new GetIdentityByPublicKeyHashResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityByPublicKeyHashResponse. - * @implements IGetIdentityByPublicKeyHashResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set - */ - function GetIdentityByPublicKeyHashResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityByPublicKeyHashResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @instance - */ - GetIdentityByPublicKeyHashResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityByPublicKeyHashResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @instance - */ - Object.defineProperty(GetIdentityByPublicKeyHashResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityByPublicKeyHashResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse instance - */ - GetIdentityByPublicKeyHashResponse.create = function create(properties) { - return new GetIdentityByPublicKeyHashResponse(properties); - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityByPublicKeyHashResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityByPublicKeyHashResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityByPublicKeyHashResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse - */ - GetIdentityByPublicKeyHashResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityByPublicKeyHashResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityByPublicKeyHashResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityByPublicKeyHashResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityByPublicKeyHashResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 = (function() { - - /** - * Properties of a GetIdentityByPublicKeyHashResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @interface IGetIdentityByPublicKeyHashResponseV0 - * @property {Uint8Array|null} [identity] GetIdentityByPublicKeyHashResponseV0 identity - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityByPublicKeyHashResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityByPublicKeyHashResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityByPublicKeyHashResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse - * @classdesc Represents a GetIdentityByPublicKeyHashResponseV0. - * @implements IGetIdentityByPublicKeyHashResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set - */ - function GetIdentityByPublicKeyHashResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityByPublicKeyHashResponseV0 identity. - * @member {Uint8Array} identity - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - */ - GetIdentityByPublicKeyHashResponseV0.prototype.identity = $util.newBuffer([]); - - /** - * GetIdentityByPublicKeyHashResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - */ - GetIdentityByPublicKeyHashResponseV0.prototype.proof = null; - - /** - * GetIdentityByPublicKeyHashResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - */ - GetIdentityByPublicKeyHashResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityByPublicKeyHashResponseV0 result. - * @member {"identity"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityByPublicKeyHashResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityByPublicKeyHashResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 instance - */ - GetIdentityByPublicKeyHashResponseV0.create = function create(properties) { - return new GetIdentityByPublicKeyHashResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityByPublicKeyHashResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identity = reader.bytes(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityByPublicKeyHashResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityByPublicKeyHashResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityByPublicKeyHashResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identity != null && message.hasOwnProperty("identity")) { - properties.result = 1; - if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) - return "identity: buffer expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityByPublicKeyHashResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 - */ - GetIdentityByPublicKeyHashResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); - if (object.identity != null) - if (typeof object.identity === "string") - $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); - else if (object.identity.length >= 0) - message.identity = object.identity; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityByPublicKeyHashResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityByPublicKeyHashResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identity != null && message.hasOwnProperty("identity")) { - object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; - if (options.oneofs) - object.result = "identity"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityByPublicKeyHashResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityByPublicKeyHashResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityByPublicKeyHashResponseV0; - })(); - - return GetIdentityByPublicKeyHashResponse; - })(); - - v0.WaitForStateTransitionResultRequest = (function() { - - /** - * Properties of a WaitForStateTransitionResultRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IWaitForStateTransitionResultRequest - * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null} [v0] WaitForStateTransitionResultRequest v0 - */ - - /** - * Constructs a new WaitForStateTransitionResultRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a WaitForStateTransitionResultRequest. - * @implements IWaitForStateTransitionResultRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set - */ - function WaitForStateTransitionResultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitForStateTransitionResultRequest v0. - * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @instance - */ - WaitForStateTransitionResultRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WaitForStateTransitionResultRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @instance - */ - Object.defineProperty(WaitForStateTransitionResultRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WaitForStateTransitionResultRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest instance - */ - WaitForStateTransitionResultRequest.create = function create(properties) { - return new WaitForStateTransitionResultRequest(properties); - }; - - /** - * Encodes the specified WaitForStateTransitionResultRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitForStateTransitionResultRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitForStateTransitionResultRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitForStateTransitionResultRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a WaitForStateTransitionResultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest - */ - WaitForStateTransitionResultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a WaitForStateTransitionResultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitForStateTransitionResultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this WaitForStateTransitionResultRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @instance - * @returns {Object.} JSON object - */ - WaitForStateTransitionResultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 = (function() { - - /** - * Properties of a WaitForStateTransitionResultRequestV0. - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @interface IWaitForStateTransitionResultRequestV0 - * @property {Uint8Array|null} [stateTransitionHash] WaitForStateTransitionResultRequestV0 stateTransitionHash - * @property {boolean|null} [prove] WaitForStateTransitionResultRequestV0 prove - */ - - /** - * Constructs a new WaitForStateTransitionResultRequestV0. - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @classdesc Represents a WaitForStateTransitionResultRequestV0. - * @implements IWaitForStateTransitionResultRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set - */ - function WaitForStateTransitionResultRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitForStateTransitionResultRequestV0 stateTransitionHash. - * @member {Uint8Array} stateTransitionHash - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @instance - */ - WaitForStateTransitionResultRequestV0.prototype.stateTransitionHash = $util.newBuffer([]); - - /** - * WaitForStateTransitionResultRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @instance - */ - WaitForStateTransitionResultRequestV0.prototype.prove = false; - - /** - * Creates a new WaitForStateTransitionResultRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 instance - */ - WaitForStateTransitionResultRequestV0.create = function create(properties) { - return new WaitForStateTransitionResultRequestV0(properties); - }; - - /** - * Encodes the specified WaitForStateTransitionResultRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransitionHash); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified WaitForStateTransitionResultRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.stateTransitionHash = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitForStateTransitionResultRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitForStateTransitionResultRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) - if (!(message.stateTransitionHash && typeof message.stateTransitionHash.length === "number" || $util.isString(message.stateTransitionHash))) - return "stateTransitionHash: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a WaitForStateTransitionResultRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 - */ - WaitForStateTransitionResultRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); - if (object.stateTransitionHash != null) - if (typeof object.stateTransitionHash === "string") - $util.base64.decode(object.stateTransitionHash, message.stateTransitionHash = $util.newBuffer($util.base64.length(object.stateTransitionHash)), 0); - else if (object.stateTransitionHash.length >= 0) - message.stateTransitionHash = object.stateTransitionHash; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a WaitForStateTransitionResultRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitForStateTransitionResultRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.stateTransitionHash = ""; - else { - object.stateTransitionHash = []; - if (options.bytes !== Array) - object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); - } - object.prove = false; - } - if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) - object.stateTransitionHash = options.bytes === String ? $util.base64.encode(message.stateTransitionHash, 0, message.stateTransitionHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransitionHash) : message.stateTransitionHash; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this WaitForStateTransitionResultRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 - * @instance - * @returns {Object.} JSON object - */ - WaitForStateTransitionResultRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WaitForStateTransitionResultRequestV0; - })(); - - return WaitForStateTransitionResultRequest; - })(); - - v0.WaitForStateTransitionResultResponse = (function() { - - /** - * Properties of a WaitForStateTransitionResultResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IWaitForStateTransitionResultResponse - * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null} [v0] WaitForStateTransitionResultResponse v0 - */ - - /** - * Constructs a new WaitForStateTransitionResultResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a WaitForStateTransitionResultResponse. - * @implements IWaitForStateTransitionResultResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set - */ - function WaitForStateTransitionResultResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitForStateTransitionResultResponse v0. - * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @instance - */ - WaitForStateTransitionResultResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WaitForStateTransitionResultResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @instance - */ - Object.defineProperty(WaitForStateTransitionResultResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WaitForStateTransitionResultResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse instance - */ - WaitForStateTransitionResultResponse.create = function create(properties) { - return new WaitForStateTransitionResultResponse(properties); - }; - - /** - * Encodes the specified WaitForStateTransitionResultResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitForStateTransitionResultResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitForStateTransitionResultResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitForStateTransitionResultResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a WaitForStateTransitionResultResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse - */ - WaitForStateTransitionResultResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a WaitForStateTransitionResultResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitForStateTransitionResultResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this WaitForStateTransitionResultResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @instance - * @returns {Object.} JSON object - */ - WaitForStateTransitionResultResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 = (function() { - - /** - * Properties of a WaitForStateTransitionResultResponseV0. - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @interface IWaitForStateTransitionResultResponseV0 - * @property {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null} [error] WaitForStateTransitionResultResponseV0 error - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] WaitForStateTransitionResultResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] WaitForStateTransitionResultResponseV0 metadata - */ - - /** - * Constructs a new WaitForStateTransitionResultResponseV0. - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse - * @classdesc Represents a WaitForStateTransitionResultResponseV0. - * @implements IWaitForStateTransitionResultResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set - */ - function WaitForStateTransitionResultResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitForStateTransitionResultResponseV0 error. - * @member {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null|undefined} error - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - */ - WaitForStateTransitionResultResponseV0.prototype.error = null; - - /** - * WaitForStateTransitionResultResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - */ - WaitForStateTransitionResultResponseV0.prototype.proof = null; - - /** - * WaitForStateTransitionResultResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - */ - WaitForStateTransitionResultResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WaitForStateTransitionResultResponseV0 result. - * @member {"error"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - */ - Object.defineProperty(WaitForStateTransitionResultResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WaitForStateTransitionResultResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 instance - */ - WaitForStateTransitionResultResponseV0.create = function create(properties) { - return new WaitForStateTransitionResultResponseV0(properties); - }; - - /** - * Encodes the specified WaitForStateTransitionResultResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitForStateTransitionResultResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitForStateTransitionResultResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitForStateTransitionResultResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitForStateTransitionResultResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitForStateTransitionResultResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a WaitForStateTransitionResultResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 - */ - WaitForStateTransitionResultResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.error: object expected"); - message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.fromObject(object.error); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a WaitForStateTransitionResultResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitForStateTransitionResultResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this WaitForStateTransitionResultResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 - * @instance - * @returns {Object.} JSON object - */ - WaitForStateTransitionResultResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WaitForStateTransitionResultResponseV0; - })(); - - return WaitForStateTransitionResultResponse; - })(); - - v0.GetConsensusParamsRequest = (function() { - - /** - * Properties of a GetConsensusParamsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetConsensusParamsRequest - * @property {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null} [v0] GetConsensusParamsRequest v0 - */ - - /** - * Constructs a new GetConsensusParamsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetConsensusParamsRequest. - * @implements IGetConsensusParamsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set - */ - function GetConsensusParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConsensusParamsRequest v0. - * @member {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @instance - */ - GetConsensusParamsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetConsensusParamsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @instance - */ - Object.defineProperty(GetConsensusParamsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetConsensusParamsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest instance - */ - GetConsensusParamsRequest.create = function create(properties) { - return new GetConsensusParamsRequest(properties); - }; - - /** - * Encodes the specified GetConsensusParamsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetConsensusParamsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConsensusParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConsensusParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConsensusParamsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConsensusParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetConsensusParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest - */ - GetConsensusParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetConsensusParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest} message GetConsensusParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConsensusParamsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetConsensusParamsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @instance - * @returns {Object.} JSON object - */ - GetConsensusParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetConsensusParamsRequest.GetConsensusParamsRequestV0 = (function() { - - /** - * Properties of a GetConsensusParamsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @interface IGetConsensusParamsRequestV0 - * @property {number|null} [height] GetConsensusParamsRequestV0 height - * @property {boolean|null} [prove] GetConsensusParamsRequestV0 prove - */ - - /** - * Constructs a new GetConsensusParamsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest - * @classdesc Represents a GetConsensusParamsRequestV0. - * @implements IGetConsensusParamsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set - */ - function GetConsensusParamsRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConsensusParamsRequestV0 height. - * @member {number} height - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @instance - */ - GetConsensusParamsRequestV0.prototype.height = 0; - - /** - * GetConsensusParamsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @instance - */ - GetConsensusParamsRequestV0.prototype.prove = false; - - /** - * Creates a new GetConsensusParamsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 instance - */ - GetConsensusParamsRequestV0.create = function create(properties) { - return new GetConsensusParamsRequestV0(properties); - }; - - /** - * Encodes the specified GetConsensusParamsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.height); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetConsensusParamsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int32(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConsensusParamsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConsensusParamsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetConsensusParamsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 - */ - GetConsensusParamsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); - if (object.height != null) - message.height = object.height | 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetConsensusParamsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConsensusParamsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.height = 0; - object.prove = false; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetConsensusParamsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetConsensusParamsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetConsensusParamsRequestV0; - })(); - - return GetConsensusParamsRequest; - })(); - - v0.GetConsensusParamsResponse = (function() { - - /** - * Properties of a GetConsensusParamsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetConsensusParamsResponse - * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null} [v0] GetConsensusParamsResponse v0 - */ - - /** - * Constructs a new GetConsensusParamsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetConsensusParamsResponse. - * @implements IGetConsensusParamsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set - */ - function GetConsensusParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConsensusParamsResponse v0. - * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @instance - */ - GetConsensusParamsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetConsensusParamsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @instance - */ - Object.defineProperty(GetConsensusParamsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetConsensusParamsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse instance - */ - GetConsensusParamsResponse.create = function create(properties) { - return new GetConsensusParamsResponse(properties); - }; - - /** - * Encodes the specified GetConsensusParamsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetConsensusParamsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConsensusParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConsensusParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConsensusParamsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConsensusParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetConsensusParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse - */ - GetConsensusParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetConsensusParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} message GetConsensusParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConsensusParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetConsensusParamsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @instance - * @returns {Object.} JSON object - */ - GetConsensusParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetConsensusParamsResponse.ConsensusParamsBlock = (function() { - - /** - * Properties of a ConsensusParamsBlock. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @interface IConsensusParamsBlock - * @property {string|null} [maxBytes] ConsensusParamsBlock maxBytes - * @property {string|null} [maxGas] ConsensusParamsBlock maxGas - * @property {string|null} [timeIotaMs] ConsensusParamsBlock timeIotaMs - */ - - /** - * Constructs a new ConsensusParamsBlock. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @classdesc Represents a ConsensusParamsBlock. - * @implements IConsensusParamsBlock - * @constructor - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set - */ - function ConsensusParamsBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusParamsBlock maxBytes. - * @member {string} maxBytes - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @instance - */ - ConsensusParamsBlock.prototype.maxBytes = ""; - - /** - * ConsensusParamsBlock maxGas. - * @member {string} maxGas - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @instance - */ - ConsensusParamsBlock.prototype.maxGas = ""; - - /** - * ConsensusParamsBlock timeIotaMs. - * @member {string} timeIotaMs - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @instance - */ - ConsensusParamsBlock.prototype.timeIotaMs = ""; - - /** - * Creates a new ConsensusParamsBlock instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock instance - */ - ConsensusParamsBlock.create = function create(properties) { - return new ConsensusParamsBlock(properties); - }; - - /** - * Encodes the specified ConsensusParamsBlock message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParamsBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxBytes); - if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxGas); - if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeIotaMs); - return writer; - }; - - /** - * Encodes the specified ConsensusParamsBlock message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParamsBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusParamsBlock message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParamsBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.maxBytes = reader.string(); - break; - case 2: - message.maxGas = reader.string(); - break; - case 3: - message.timeIotaMs = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusParamsBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParamsBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusParamsBlock message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusParamsBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - if (!$util.isString(message.maxBytes)) - return "maxBytes: string expected"; - if (message.maxGas != null && message.hasOwnProperty("maxGas")) - if (!$util.isString(message.maxGas)) - return "maxGas: string expected"; - if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) - if (!$util.isString(message.timeIotaMs)) - return "timeIotaMs: string expected"; - return null; - }; - - /** - * Creates a ConsensusParamsBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock - */ - ConsensusParamsBlock.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); - if (object.maxBytes != null) - message.maxBytes = String(object.maxBytes); - if (object.maxGas != null) - message.maxGas = String(object.maxGas); - if (object.timeIotaMs != null) - message.timeIotaMs = String(object.timeIotaMs); - return message; - }; - - /** - * Creates a plain object from a ConsensusParamsBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} message ConsensusParamsBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusParamsBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxBytes = ""; - object.maxGas = ""; - object.timeIotaMs = ""; - } - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - object.maxBytes = message.maxBytes; - if (message.maxGas != null && message.hasOwnProperty("maxGas")) - object.maxGas = message.maxGas; - if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) - object.timeIotaMs = message.timeIotaMs; - return object; - }; - - /** - * Converts this ConsensusParamsBlock to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock - * @instance - * @returns {Object.} JSON object - */ - ConsensusParamsBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusParamsBlock; - })(); - - GetConsensusParamsResponse.ConsensusParamsEvidence = (function() { - - /** - * Properties of a ConsensusParamsEvidence. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @interface IConsensusParamsEvidence - * @property {string|null} [maxAgeNumBlocks] ConsensusParamsEvidence maxAgeNumBlocks - * @property {string|null} [maxAgeDuration] ConsensusParamsEvidence maxAgeDuration - * @property {string|null} [maxBytes] ConsensusParamsEvidence maxBytes - */ - - /** - * Constructs a new ConsensusParamsEvidence. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @classdesc Represents a ConsensusParamsEvidence. - * @implements IConsensusParamsEvidence - * @constructor - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set - */ - function ConsensusParamsEvidence(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusParamsEvidence maxAgeNumBlocks. - * @member {string} maxAgeNumBlocks - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @instance - */ - ConsensusParamsEvidence.prototype.maxAgeNumBlocks = ""; - - /** - * ConsensusParamsEvidence maxAgeDuration. - * @member {string} maxAgeDuration - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @instance - */ - ConsensusParamsEvidence.prototype.maxAgeDuration = ""; - - /** - * ConsensusParamsEvidence maxBytes. - * @member {string} maxBytes - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @instance - */ - ConsensusParamsEvidence.prototype.maxBytes = ""; - - /** - * Creates a new ConsensusParamsEvidence instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence instance - */ - ConsensusParamsEvidence.create = function create(properties) { - return new ConsensusParamsEvidence(properties); - }; - - /** - * Encodes the specified ConsensusParamsEvidence message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParamsEvidence.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxAgeNumBlocks); - if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxAgeDuration); - if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxBytes); - return writer; - }; - - /** - * Encodes the specified ConsensusParamsEvidence message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParamsEvidence.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusParamsEvidence message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParamsEvidence.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.maxAgeNumBlocks = reader.string(); - break; - case 2: - message.maxAgeDuration = reader.string(); - break; - case 3: - message.maxBytes = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusParamsEvidence message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParamsEvidence.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusParamsEvidence message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusParamsEvidence.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) - if (!$util.isString(message.maxAgeNumBlocks)) - return "maxAgeNumBlocks: string expected"; - if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) - if (!$util.isString(message.maxAgeDuration)) - return "maxAgeDuration: string expected"; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - if (!$util.isString(message.maxBytes)) - return "maxBytes: string expected"; - return null; - }; - - /** - * Creates a ConsensusParamsEvidence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence - */ - ConsensusParamsEvidence.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); - if (object.maxAgeNumBlocks != null) - message.maxAgeNumBlocks = String(object.maxAgeNumBlocks); - if (object.maxAgeDuration != null) - message.maxAgeDuration = String(object.maxAgeDuration); - if (object.maxBytes != null) - message.maxBytes = String(object.maxBytes); - return message; - }; - - /** - * Creates a plain object from a ConsensusParamsEvidence message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} message ConsensusParamsEvidence - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusParamsEvidence.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxAgeNumBlocks = ""; - object.maxAgeDuration = ""; - object.maxBytes = ""; - } - if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) - object.maxAgeNumBlocks = message.maxAgeNumBlocks; - if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) - object.maxAgeDuration = message.maxAgeDuration; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - object.maxBytes = message.maxBytes; - return object; - }; - - /** - * Converts this ConsensusParamsEvidence to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence - * @instance - * @returns {Object.} JSON object - */ - ConsensusParamsEvidence.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusParamsEvidence; - })(); - - GetConsensusParamsResponse.GetConsensusParamsResponseV0 = (function() { - - /** - * Properties of a GetConsensusParamsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @interface IGetConsensusParamsResponseV0 - * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null} [block] GetConsensusParamsResponseV0 block - * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null} [evidence] GetConsensusParamsResponseV0 evidence - */ - - /** - * Constructs a new GetConsensusParamsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse - * @classdesc Represents a GetConsensusParamsResponseV0. - * @implements IGetConsensusParamsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set - */ - function GetConsensusParamsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConsensusParamsResponseV0 block. - * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null|undefined} block - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @instance - */ - GetConsensusParamsResponseV0.prototype.block = null; - - /** - * GetConsensusParamsResponseV0 evidence. - * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null|undefined} evidence - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @instance - */ - GetConsensusParamsResponseV0.prototype.evidence = null; - - /** - * Creates a new GetConsensusParamsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 instance - */ - GetConsensusParamsResponseV0.create = function create(properties) { - return new GetConsensusParamsResponseV0(properties); - }; - - /** - * Encodes the specified GetConsensusParamsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) - $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetConsensusParamsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConsensusParamsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConsensusParamsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConsensusParamsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConsensusParamsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) { - var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify(message.block); - if (error) - return "block." + error; - } - if (message.evidence != null && message.hasOwnProperty("evidence")) { - var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify(message.evidence); - if (error) - return "evidence." + error; - } - return null; - }; - - /** - * Creates a GetConsensusParamsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 - */ - GetConsensusParamsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); - if (object.block != null) { - if (typeof object.block !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.block: object expected"); - message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.fromObject(object.block); - } - if (object.evidence != null) { - if (typeof object.evidence !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.evidence: object expected"); - message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.fromObject(object.evidence); - } - return message; - }; - - /** - * Creates a plain object from a GetConsensusParamsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConsensusParamsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.block = null; - object.evidence = null; - } - if (message.block != null && message.hasOwnProperty("block")) - object.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.toObject(message.block, options); - if (message.evidence != null && message.hasOwnProperty("evidence")) - object.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.toObject(message.evidence, options); - return object; - }; - - /** - * Converts this GetConsensusParamsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetConsensusParamsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetConsensusParamsResponseV0; - })(); - - return GetConsensusParamsResponse; - })(); - - v0.GetProtocolVersionUpgradeStateRequest = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeStateRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProtocolVersionUpgradeStateRequest - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null} [v0] GetProtocolVersionUpgradeStateRequest v0 - */ - - /** - * Constructs a new GetProtocolVersionUpgradeStateRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProtocolVersionUpgradeStateRequest. - * @implements IGetProtocolVersionUpgradeStateRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeStateRequest v0. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @instance - */ - GetProtocolVersionUpgradeStateRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeStateRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeStateRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeStateRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest instance - */ - GetProtocolVersionUpgradeStateRequest.create = function create(properties) { - return new GetProtocolVersionUpgradeStateRequest(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeStateRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest - */ - GetProtocolVersionUpgradeStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeStateRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeStateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @interface IGetProtocolVersionUpgradeStateRequestV0 - * @property {boolean|null} [prove] GetProtocolVersionUpgradeStateRequestV0 prove - */ - - /** - * Constructs a new GetProtocolVersionUpgradeStateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest - * @classdesc Represents a GetProtocolVersionUpgradeStateRequestV0. - * @implements IGetProtocolVersionUpgradeStateRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeStateRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeStateRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @instance - */ - GetProtocolVersionUpgradeStateRequestV0.prototype.prove = false; - - /** - * Creates a new GetProtocolVersionUpgradeStateRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 instance - */ - GetProtocolVersionUpgradeStateRequestV0.create = function create(properties) { - return new GetProtocolVersionUpgradeStateRequestV0(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeStateRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeStateRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeStateRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 - */ - GetProtocolVersionUpgradeStateRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeStateRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeStateRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.prove = false; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeStateRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeStateRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetProtocolVersionUpgradeStateRequestV0; - })(); - - return GetProtocolVersionUpgradeStateRequest; - })(); - - v0.GetProtocolVersionUpgradeStateResponse = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeStateResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProtocolVersionUpgradeStateResponse - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null} [v0] GetProtocolVersionUpgradeStateResponse v0 - */ - - /** - * Constructs a new GetProtocolVersionUpgradeStateResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProtocolVersionUpgradeStateResponse. - * @implements IGetProtocolVersionUpgradeStateResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeStateResponse v0. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @instance - */ - GetProtocolVersionUpgradeStateResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeStateResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeStateResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeStateResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse instance - */ - GetProtocolVersionUpgradeStateResponse.create = function create(properties) { - return new GetProtocolVersionUpgradeStateResponse(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeStateResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse - */ - GetProtocolVersionUpgradeStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeStateResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeStateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @interface IGetProtocolVersionUpgradeStateResponseV0 - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null} [versions] GetProtocolVersionUpgradeStateResponseV0 versions - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeStateResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeStateResponseV0 metadata - */ - - /** - * Constructs a new GetProtocolVersionUpgradeStateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse - * @classdesc Represents a GetProtocolVersionUpgradeStateResponseV0. - * @implements IGetProtocolVersionUpgradeStateResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeStateResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeStateResponseV0 versions. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null|undefined} versions - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - */ - GetProtocolVersionUpgradeStateResponseV0.prototype.versions = null; - - /** - * GetProtocolVersionUpgradeStateResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - */ - GetProtocolVersionUpgradeStateResponseV0.prototype.proof = null; - - /** - * GetProtocolVersionUpgradeStateResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - */ - GetProtocolVersionUpgradeStateResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeStateResponseV0 result. - * @member {"versions"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeStateResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeStateResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 instance - */ - GetProtocolVersionUpgradeStateResponseV0.create = function create(properties) { - return new GetProtocolVersionUpgradeStateResponseV0(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeStateResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeStateResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeStateResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.versions != null && message.hasOwnProperty("versions")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify(message.versions); - if (error) - return "versions." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeStateResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 - */ - GetProtocolVersionUpgradeStateResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); - if (object.versions != null) { - if (typeof object.versions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.versions: object expected"); - message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.fromObject(object.versions); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeStateResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeStateResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.versions != null && message.hasOwnProperty("versions")) { - object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.toObject(message.versions, options); - if (options.oneofs) - object.result = "versions"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeStateResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeStateResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeStateResponseV0.Versions = (function() { - - /** - * Properties of a Versions. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @interface IVersions - * @property {Array.|null} [versions] Versions versions - */ - - /** - * Constructs a new Versions. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @classdesc Represents a Versions. - * @implements IVersions - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set - */ - function Versions(properties) { - this.versions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Versions versions. - * @member {Array.} versions - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @instance - */ - Versions.prototype.versions = $util.emptyArray; - - /** - * Creates a new Versions instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions instance - */ - Versions.create = function create(properties) { - return new Versions(properties); - }; - - /** - * Encodes the specified Versions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Versions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versions != null && message.versions.length) - for (var i = 0; i < message.versions.length; ++i) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.encode(message.versions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Versions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Versions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Versions message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Versions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Versions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Versions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Versions message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Versions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (var i = 0; i < message.versions.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify(message.versions[i]); - if (error) - return "versions." + error; - } - } - return null; - }; - - /** - * Creates a Versions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions - */ - Versions.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: array expected"); - message.versions = []; - for (var i = 0; i < object.versions.length; ++i) { - if (typeof object.versions[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: object expected"); - message.versions[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.fromObject(object.versions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Versions message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} message Versions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Versions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (message.versions && message.versions.length) { - object.versions = []; - for (var j = 0; j < message.versions.length; ++j) - object.versions[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.toObject(message.versions[j], options); - } - return object; - }; - - /** - * Converts this Versions to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions - * @instance - * @returns {Object.} JSON object - */ - Versions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Versions; - })(); - - GetProtocolVersionUpgradeStateResponseV0.VersionEntry = (function() { - - /** - * Properties of a VersionEntry. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @interface IVersionEntry - * @property {number|null} [versionNumber] VersionEntry versionNumber - * @property {number|null} [voteCount] VersionEntry voteCount - */ - - /** - * Constructs a new VersionEntry. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 - * @classdesc Represents a VersionEntry. - * @implements IVersionEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set - */ - function VersionEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionEntry versionNumber. - * @member {number} versionNumber - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @instance - */ - VersionEntry.prototype.versionNumber = 0; - - /** - * VersionEntry voteCount. - * @member {number} voteCount - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @instance - */ - VersionEntry.prototype.voteCount = 0; - - /** - * Creates a new VersionEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry instance - */ - VersionEntry.create = function create(properties) { - return new VersionEntry(properties); - }; - - /** - * Encodes the specified VersionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.versionNumber); - if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); - return writer; - }; - - /** - * Encodes the specified VersionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.versionNumber = reader.uint32(); - break; - case 2: - message.voteCount = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) - if (!$util.isInteger(message.versionNumber)) - return "versionNumber: integer expected"; - if (message.voteCount != null && message.hasOwnProperty("voteCount")) - if (!$util.isInteger(message.voteCount)) - return "voteCount: integer expected"; - return null; - }; - - /** - * Creates a VersionEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry - */ - VersionEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); - if (object.versionNumber != null) - message.versionNumber = object.versionNumber >>> 0; - if (object.voteCount != null) - message.voteCount = object.voteCount >>> 0; - return message; - }; - - /** - * Creates a plain object from a VersionEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} message VersionEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.versionNumber = 0; - object.voteCount = 0; - } - if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) - object.versionNumber = message.versionNumber; - if (message.voteCount != null && message.hasOwnProperty("voteCount")) - object.voteCount = message.voteCount; - return object; - }; - - /** - * Converts this VersionEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry - * @instance - * @returns {Object.} JSON object - */ - VersionEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VersionEntry; - })(); - - return GetProtocolVersionUpgradeStateResponseV0; - })(); - - return GetProtocolVersionUpgradeStateResponse; - })(); - - v0.GetProtocolVersionUpgradeVoteStatusRequest = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeVoteStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProtocolVersionUpgradeVoteStatusRequest - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null} [v0] GetProtocolVersionUpgradeVoteStatusRequest v0 - */ - - /** - * Constructs a new GetProtocolVersionUpgradeVoteStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequest. - * @implements IGetProtocolVersionUpgradeVoteStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeVoteStatusRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeVoteStatusRequest v0. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @instance - */ - GetProtocolVersionUpgradeVoteStatusRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeVoteStatusRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeVoteStatusRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeVoteStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest instance - */ - GetProtocolVersionUpgradeVoteStatusRequest.create = function create(properties) { - return new GetProtocolVersionUpgradeVoteStatusRequest(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeVoteStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeVoteStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeVoteStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest - */ - GetProtocolVersionUpgradeVoteStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeVoteStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeVoteStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeVoteStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeVoteStatusRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @interface IGetProtocolVersionUpgradeVoteStatusRequestV0 - * @property {Uint8Array|null} [startProTxHash] GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash - * @property {number|null} [count] GetProtocolVersionUpgradeVoteStatusRequestV0 count - * @property {boolean|null} [prove] GetProtocolVersionUpgradeVoteStatusRequestV0 prove - */ - - /** - * Constructs a new GetProtocolVersionUpgradeVoteStatusRequestV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest - * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequestV0. - * @implements IGetProtocolVersionUpgradeVoteStatusRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeVoteStatusRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash. - * @member {Uint8Array} startProTxHash - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.startProTxHash = $util.newBuffer([]); - - /** - * GetProtocolVersionUpgradeVoteStatusRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.count = 0; - - /** - * GetProtocolVersionUpgradeVoteStatusRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.prove = false; - - /** - * Creates a new GetProtocolVersionUpgradeVoteStatusRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 instance - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.create = function create(properties) { - return new GetProtocolVersionUpgradeVoteStatusRequestV0(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startProTxHash != null && Object.hasOwnProperty.call(message, "startProTxHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startProTxHash); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startProTxHash = reader.bytes(); - break; - case 2: - message.count = reader.uint32(); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeVoteStatusRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) - if (!(message.startProTxHash && typeof message.startProTxHash.length === "number" || $util.isString(message.startProTxHash))) - return "startProTxHash: buffer expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeVoteStatusRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); - if (object.startProTxHash != null) - if (typeof object.startProTxHash === "string") - $util.base64.decode(object.startProTxHash, message.startProTxHash = $util.newBuffer($util.base64.length(object.startProTxHash)), 0); - else if (object.startProTxHash.length >= 0) - message.startProTxHash = object.startProTxHash; - if (object.count != null) - message.count = object.count >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startProTxHash = ""; - else { - object.startProTxHash = []; - if (options.bytes !== Array) - object.startProTxHash = $util.newBuffer(object.startProTxHash); - } - object.count = 0; - object.prove = false; - } - if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) - object.startProTxHash = options.bytes === String ? $util.base64.encode(message.startProTxHash, 0, message.startProTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.startProTxHash) : message.startProTxHash; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeVoteStatusRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetProtocolVersionUpgradeVoteStatusRequestV0; - })(); - - return GetProtocolVersionUpgradeVoteStatusRequest; - })(); - - v0.GetProtocolVersionUpgradeVoteStatusResponse = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeVoteStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetProtocolVersionUpgradeVoteStatusResponse - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null} [v0] GetProtocolVersionUpgradeVoteStatusResponse v0 - */ - - /** - * Constructs a new GetProtocolVersionUpgradeVoteStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponse. - * @implements IGetProtocolVersionUpgradeVoteStatusResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeVoteStatusResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeVoteStatusResponse v0. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @instance - */ - GetProtocolVersionUpgradeVoteStatusResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeVoteStatusResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeVoteStatusResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse instance - */ - GetProtocolVersionUpgradeVoteStatusResponse.create = function create(properties) { - return new GetProtocolVersionUpgradeVoteStatusResponse(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeVoteStatusResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeVoteStatusResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeVoteStatusResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse - */ - GetProtocolVersionUpgradeVoteStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeVoteStatusResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeVoteStatusResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeVoteStatusResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 = (function() { - - /** - * Properties of a GetProtocolVersionUpgradeVoteStatusResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @interface IGetProtocolVersionUpgradeVoteStatusResponseV0 - * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null} [versions] GetProtocolVersionUpgradeVoteStatusResponseV0 versions - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeVoteStatusResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeVoteStatusResponseV0 metadata - */ - - /** - * Constructs a new GetProtocolVersionUpgradeVoteStatusResponseV0. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse - * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponseV0. - * @implements IGetProtocolVersionUpgradeVoteStatusResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set - */ - function GetProtocolVersionUpgradeVoteStatusResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProtocolVersionUpgradeVoteStatusResponseV0 versions. - * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null|undefined} versions - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.versions = null; - - /** - * GetProtocolVersionUpgradeVoteStatusResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.proof = null; - - /** - * GetProtocolVersionUpgradeVoteStatusResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetProtocolVersionUpgradeVoteStatusResponseV0 result. - * @member {"versions"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - */ - Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetProtocolVersionUpgradeVoteStatusResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 instance - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.create = function create(properties) { - return new GetProtocolVersionUpgradeVoteStatusResponseV0(properties); - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProtocolVersionUpgradeVoteStatusResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.versions != null && message.hasOwnProperty("versions")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify(message.versions); - if (error) - return "versions." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetProtocolVersionUpgradeVoteStatusResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); - if (object.versions != null) { - if (typeof object.versions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.versions: object expected"); - message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.fromObject(object.versions); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.versions != null && message.hasOwnProperty("versions")) { - object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.toObject(message.versions, options); - if (options.oneofs) - object.result = "versions"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetProtocolVersionUpgradeVoteStatusResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals = (function() { - - /** - * Properties of a VersionSignals. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @interface IVersionSignals - * @property {Array.|null} [versionSignals] VersionSignals versionSignals - */ - - /** - * Constructs a new VersionSignals. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @classdesc Represents a VersionSignals. - * @implements IVersionSignals - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set - */ - function VersionSignals(properties) { - this.versionSignals = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionSignals versionSignals. - * @member {Array.} versionSignals - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @instance - */ - VersionSignals.prototype.versionSignals = $util.emptyArray; - - /** - * Creates a new VersionSignals instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals instance - */ - VersionSignals.create = function create(properties) { - return new VersionSignals(properties); - }; - - /** - * Encodes the specified VersionSignals message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionSignals.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versionSignals != null && message.versionSignals.length) - for (var i = 0; i < message.versionSignals.length; ++i) - $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.encode(message.versionSignals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VersionSignals message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionSignals.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionSignals message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionSignals.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.versionSignals && message.versionSignals.length)) - message.versionSignals = []; - message.versionSignals.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionSignals message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionSignals.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionSignals message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionSignals.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.versionSignals != null && message.hasOwnProperty("versionSignals")) { - if (!Array.isArray(message.versionSignals)) - return "versionSignals: array expected"; - for (var i = 0; i < message.versionSignals.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify(message.versionSignals[i]); - if (error) - return "versionSignals." + error; - } - } - return null; - }; - - /** - * Creates a VersionSignals message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals - */ - VersionSignals.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); - if (object.versionSignals) { - if (!Array.isArray(object.versionSignals)) - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: array expected"); - message.versionSignals = []; - for (var i = 0; i < object.versionSignals.length; ++i) { - if (typeof object.versionSignals[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: object expected"); - message.versionSignals[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.fromObject(object.versionSignals[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a VersionSignals message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} message VersionSignals - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionSignals.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versionSignals = []; - if (message.versionSignals && message.versionSignals.length) { - object.versionSignals = []; - for (var j = 0; j < message.versionSignals.length; ++j) - object.versionSignals[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.toObject(message.versionSignals[j], options); - } - return object; - }; - - /** - * Converts this VersionSignals to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals - * @instance - * @returns {Object.} JSON object - */ - VersionSignals.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VersionSignals; - })(); - - GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal = (function() { - - /** - * Properties of a VersionSignal. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @interface IVersionSignal - * @property {Uint8Array|null} [proTxHash] VersionSignal proTxHash - * @property {number|null} [version] VersionSignal version - */ - - /** - * Constructs a new VersionSignal. - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 - * @classdesc Represents a VersionSignal. - * @implements IVersionSignal - * @constructor - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set - */ - function VersionSignal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionSignal proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @instance - */ - VersionSignal.prototype.proTxHash = $util.newBuffer([]); - - /** - * VersionSignal version. - * @member {number} version - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @instance - */ - VersionSignal.prototype.version = 0; - - /** - * Creates a new VersionSignal instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal instance - */ - VersionSignal.create = function create(properties) { - return new VersionSignal(properties); - }; - - /** - * Encodes the specified VersionSignal message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionSignal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.version); - return writer; - }; - - /** - * Encodes the specified VersionSignal message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionSignal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionSignal message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionSignal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proTxHash = reader.bytes(); - break; - case 2: - message.version = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionSignal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionSignal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionSignal message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionSignal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - return null; - }; - - /** - * Creates a VersionSignal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal - */ - VersionSignal.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - if (object.version != null) - message.version = object.version >>> 0; - return message; - }; - - /** - * Creates a plain object from a VersionSignal message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @static - * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} message VersionSignal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionSignal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - object.version = 0; - } - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this VersionSignal to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal - * @instance - * @returns {Object.} JSON object - */ - VersionSignal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VersionSignal; - })(); - - return GetProtocolVersionUpgradeVoteStatusResponseV0; - })(); - - return GetProtocolVersionUpgradeVoteStatusResponse; - })(); - - v0.GetEpochsInfoRequest = (function() { - - /** - * Properties of a GetEpochsInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEpochsInfoRequest - * @property {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null} [v0] GetEpochsInfoRequest v0 - */ - - /** - * Constructs a new GetEpochsInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEpochsInfoRequest. - * @implements IGetEpochsInfoRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set - */ - function GetEpochsInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEpochsInfoRequest v0. - * @member {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @instance - */ - GetEpochsInfoRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEpochsInfoRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @instance - */ - Object.defineProperty(GetEpochsInfoRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEpochsInfoRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest instance - */ - GetEpochsInfoRequest.create = function create(properties) { - return new GetEpochsInfoRequest(properties); - }; - - /** - * Encodes the specified GetEpochsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEpochsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEpochsInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEpochsInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEpochsInfoRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEpochsInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEpochsInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest - */ - GetEpochsInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEpochsInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest} message GetEpochsInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEpochsInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEpochsInfoRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetEpochsInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEpochsInfoRequest.GetEpochsInfoRequestV0 = (function() { - - /** - * Properties of a GetEpochsInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @interface IGetEpochsInfoRequestV0 - * @property {google.protobuf.IUInt32Value|null} [startEpoch] GetEpochsInfoRequestV0 startEpoch - * @property {number|null} [count] GetEpochsInfoRequestV0 count - * @property {boolean|null} [ascending] GetEpochsInfoRequestV0 ascending - * @property {boolean|null} [prove] GetEpochsInfoRequestV0 prove - */ - - /** - * Constructs a new GetEpochsInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest - * @classdesc Represents a GetEpochsInfoRequestV0. - * @implements IGetEpochsInfoRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set - */ - function GetEpochsInfoRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEpochsInfoRequestV0 startEpoch. - * @member {google.protobuf.IUInt32Value|null|undefined} startEpoch - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - */ - GetEpochsInfoRequestV0.prototype.startEpoch = null; - - /** - * GetEpochsInfoRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - */ - GetEpochsInfoRequestV0.prototype.count = 0; - - /** - * GetEpochsInfoRequestV0 ascending. - * @member {boolean} ascending - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - */ - GetEpochsInfoRequestV0.prototype.ascending = false; - - /** - * GetEpochsInfoRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - */ - GetEpochsInfoRequestV0.prototype.prove = false; - - /** - * Creates a new GetEpochsInfoRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 instance - */ - GetEpochsInfoRequestV0.create = function create(properties) { - return new GetEpochsInfoRequestV0(properties); - }; - - /** - * Encodes the specified GetEpochsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startEpoch != null && Object.hasOwnProperty.call(message, "startEpoch")) - $root.google.protobuf.UInt32Value.encode(message.startEpoch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); - if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ascending); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetEpochsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startEpoch = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 2: - message.count = reader.uint32(); - break; - case 3: - message.ascending = reader.bool(); - break; - case 4: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEpochsInfoRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEpochsInfoRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) { - var error = $root.google.protobuf.UInt32Value.verify(message.startEpoch); - if (error) - return "startEpoch." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.ascending != null && message.hasOwnProperty("ascending")) - if (typeof message.ascending !== "boolean") - return "ascending: boolean expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetEpochsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 - */ - GetEpochsInfoRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); - if (object.startEpoch != null) { - if (typeof object.startEpoch !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.startEpoch: object expected"); - message.startEpoch = $root.google.protobuf.UInt32Value.fromObject(object.startEpoch); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.ascending != null) - message.ascending = Boolean(object.ascending); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetEpochsInfoRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEpochsInfoRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startEpoch = null; - object.count = 0; - object.ascending = false; - object.prove = false; - } - if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) - object.startEpoch = $root.google.protobuf.UInt32Value.toObject(message.startEpoch, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.ascending != null && message.hasOwnProperty("ascending")) - object.ascending = message.ascending; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetEpochsInfoRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetEpochsInfoRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetEpochsInfoRequestV0; - })(); - - return GetEpochsInfoRequest; - })(); - - v0.GetEpochsInfoResponse = (function() { - - /** - * Properties of a GetEpochsInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetEpochsInfoResponse - * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null} [v0] GetEpochsInfoResponse v0 - */ - - /** - * Constructs a new GetEpochsInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetEpochsInfoResponse. - * @implements IGetEpochsInfoResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set - */ - function GetEpochsInfoResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEpochsInfoResponse v0. - * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @instance - */ - GetEpochsInfoResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEpochsInfoResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @instance - */ - Object.defineProperty(GetEpochsInfoResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEpochsInfoResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse instance - */ - GetEpochsInfoResponse.create = function create(properties) { - return new GetEpochsInfoResponse(properties); - }; - - /** - * Encodes the specified GetEpochsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEpochsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEpochsInfoResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEpochsInfoResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEpochsInfoResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEpochsInfoResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetEpochsInfoResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse - */ - GetEpochsInfoResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetEpochsInfoResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} message GetEpochsInfoResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEpochsInfoResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetEpochsInfoResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @instance - * @returns {Object.} JSON object - */ - GetEpochsInfoResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEpochsInfoResponse.GetEpochsInfoResponseV0 = (function() { - - /** - * Properties of a GetEpochsInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @interface IGetEpochsInfoResponseV0 - * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null} [epochs] GetEpochsInfoResponseV0 epochs - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEpochsInfoResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEpochsInfoResponseV0 metadata - */ - - /** - * Constructs a new GetEpochsInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse - * @classdesc Represents a GetEpochsInfoResponseV0. - * @implements IGetEpochsInfoResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set - */ - function GetEpochsInfoResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEpochsInfoResponseV0 epochs. - * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null|undefined} epochs - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - */ - GetEpochsInfoResponseV0.prototype.epochs = null; - - /** - * GetEpochsInfoResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - */ - GetEpochsInfoResponseV0.prototype.proof = null; - - /** - * GetEpochsInfoResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - */ - GetEpochsInfoResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetEpochsInfoResponseV0 result. - * @member {"epochs"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - */ - Object.defineProperty(GetEpochsInfoResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["epochs", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetEpochsInfoResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 instance - */ - GetEpochsInfoResponseV0.create = function create(properties) { - return new GetEpochsInfoResponseV0(properties); - }; - - /** - * Encodes the specified GetEpochsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.epochs != null && Object.hasOwnProperty.call(message, "epochs")) - $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.encode(message.epochs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetEpochsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEpochsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEpochsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEpochsInfoResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEpochsInfoResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.epochs != null && message.hasOwnProperty("epochs")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify(message.epochs); - if (error) - return "epochs." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetEpochsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 - */ - GetEpochsInfoResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); - if (object.epochs != null) { - if (typeof object.epochs !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.epochs: object expected"); - message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.fromObject(object.epochs); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetEpochsInfoResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEpochsInfoResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.epochs != null && message.hasOwnProperty("epochs")) { - object.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.toObject(message.epochs, options); - if (options.oneofs) - object.result = "epochs"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetEpochsInfoResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetEpochsInfoResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetEpochsInfoResponseV0.EpochInfos = (function() { - - /** - * Properties of an EpochInfos. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @interface IEpochInfos - * @property {Array.|null} [epochInfos] EpochInfos epochInfos - */ - - /** - * Constructs a new EpochInfos. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @classdesc Represents an EpochInfos. - * @implements IEpochInfos - * @constructor - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set - */ - function EpochInfos(properties) { - this.epochInfos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EpochInfos epochInfos. - * @member {Array.} epochInfos - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @instance - */ - EpochInfos.prototype.epochInfos = $util.emptyArray; - - /** - * Creates a new EpochInfos instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos instance - */ - EpochInfos.create = function create(properties) { - return new EpochInfos(properties); - }; - - /** - * Encodes the specified EpochInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EpochInfos.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.epochInfos != null && message.epochInfos.length) - for (var i = 0; i < message.epochInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.encode(message.epochInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EpochInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EpochInfos.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EpochInfos message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EpochInfos.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.epochInfos && message.epochInfos.length)) - message.epochInfos = []; - message.epochInfos.push($root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EpochInfos message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EpochInfos.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EpochInfos message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EpochInfos.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.epochInfos != null && message.hasOwnProperty("epochInfos")) { - if (!Array.isArray(message.epochInfos)) - return "epochInfos: array expected"; - for (var i = 0; i < message.epochInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify(message.epochInfos[i]); - if (error) - return "epochInfos." + error; - } - } - return null; - }; - - /** - * Creates an EpochInfos message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos - */ - EpochInfos.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); - if (object.epochInfos) { - if (!Array.isArray(object.epochInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: array expected"); - message.epochInfos = []; - for (var i = 0; i < object.epochInfos.length; ++i) { - if (typeof object.epochInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: object expected"); - message.epochInfos[i] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.fromObject(object.epochInfos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EpochInfos message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} message EpochInfos - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EpochInfos.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.epochInfos = []; - if (message.epochInfos && message.epochInfos.length) { - object.epochInfos = []; - for (var j = 0; j < message.epochInfos.length; ++j) - object.epochInfos[j] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.toObject(message.epochInfos[j], options); - } - return object; - }; - - /** - * Converts this EpochInfos to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos - * @instance - * @returns {Object.} JSON object - */ - EpochInfos.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EpochInfos; - })(); - - GetEpochsInfoResponseV0.EpochInfo = (function() { - - /** - * Properties of an EpochInfo. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @interface IEpochInfo - * @property {number|null} [number] EpochInfo number - * @property {number|Long|null} [firstBlockHeight] EpochInfo firstBlockHeight - * @property {number|null} [firstCoreBlockHeight] EpochInfo firstCoreBlockHeight - * @property {number|Long|null} [startTime] EpochInfo startTime - * @property {number|null} [feeMultiplier] EpochInfo feeMultiplier - * @property {number|null} [protocolVersion] EpochInfo protocolVersion - */ - - /** - * Constructs a new EpochInfo. - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 - * @classdesc Represents an EpochInfo. - * @implements IEpochInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set - */ - function EpochInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EpochInfo number. - * @member {number} number - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.number = 0; - - /** - * EpochInfo firstBlockHeight. - * @member {number|Long} firstBlockHeight - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.firstBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * EpochInfo firstCoreBlockHeight. - * @member {number} firstCoreBlockHeight - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.firstCoreBlockHeight = 0; - - /** - * EpochInfo startTime. - * @member {number|Long} startTime - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * EpochInfo feeMultiplier. - * @member {number} feeMultiplier - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.feeMultiplier = 0; - - /** - * EpochInfo protocolVersion. - * @member {number} protocolVersion - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - */ - EpochInfo.prototype.protocolVersion = 0; - - /** - * Creates a new EpochInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo instance - */ - EpochInfo.create = function create(properties) { - return new EpochInfo(properties); - }; - - /** - * Encodes the specified EpochInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EpochInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.number); - if (message.firstBlockHeight != null && Object.hasOwnProperty.call(message, "firstBlockHeight")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.firstBlockHeight); - if (message.firstCoreBlockHeight != null && Object.hasOwnProperty.call(message, "firstCoreBlockHeight")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.firstCoreBlockHeight); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startTime); - if (message.feeMultiplier != null && Object.hasOwnProperty.call(message, "feeMultiplier")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.feeMultiplier); - if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.protocolVersion); - return writer; - }; - - /** - * Encodes the specified EpochInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EpochInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EpochInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EpochInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.number = reader.uint32(); - break; - case 2: - message.firstBlockHeight = reader.uint64(); - break; - case 3: - message.firstCoreBlockHeight = reader.uint32(); - break; - case 4: - message.startTime = reader.uint64(); - break; - case 5: - message.feeMultiplier = reader.double(); - break; - case 6: - message.protocolVersion = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EpochInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EpochInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EpochInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EpochInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) - if (!$util.isInteger(message.firstBlockHeight) && !(message.firstBlockHeight && $util.isInteger(message.firstBlockHeight.low) && $util.isInteger(message.firstBlockHeight.high))) - return "firstBlockHeight: integer|Long expected"; - if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) - if (!$util.isInteger(message.firstCoreBlockHeight)) - return "firstCoreBlockHeight: integer expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) - if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) - return "startTime: integer|Long expected"; - if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) - if (typeof message.feeMultiplier !== "number") - return "feeMultiplier: number expected"; - if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) - if (!$util.isInteger(message.protocolVersion)) - return "protocolVersion: integer expected"; - return null; - }; - - /** - * Creates an EpochInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo - */ - EpochInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); - if (object.number != null) - message.number = object.number >>> 0; - if (object.firstBlockHeight != null) - if ($util.Long) - (message.firstBlockHeight = $util.Long.fromValue(object.firstBlockHeight)).unsigned = true; - else if (typeof object.firstBlockHeight === "string") - message.firstBlockHeight = parseInt(object.firstBlockHeight, 10); - else if (typeof object.firstBlockHeight === "number") - message.firstBlockHeight = object.firstBlockHeight; - else if (typeof object.firstBlockHeight === "object") - message.firstBlockHeight = new $util.LongBits(object.firstBlockHeight.low >>> 0, object.firstBlockHeight.high >>> 0).toNumber(true); - if (object.firstCoreBlockHeight != null) - message.firstCoreBlockHeight = object.firstCoreBlockHeight >>> 0; - if (object.startTime != null) - if ($util.Long) - (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = true; - else if (typeof object.startTime === "string") - message.startTime = parseInt(object.startTime, 10); - else if (typeof object.startTime === "number") - message.startTime = object.startTime; - else if (typeof object.startTime === "object") - message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(true); - if (object.feeMultiplier != null) - message.feeMultiplier = Number(object.feeMultiplier); - if (object.protocolVersion != null) - message.protocolVersion = object.protocolVersion >>> 0; - return message; - }; - - /** - * Creates a plain object from an EpochInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @static - * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} message EpochInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EpochInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.firstBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.firstBlockHeight = options.longs === String ? "0" : 0; - object.firstCoreBlockHeight = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startTime = options.longs === String ? "0" : 0; - object.feeMultiplier = 0; - object.protocolVersion = 0; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) - if (typeof message.firstBlockHeight === "number") - object.firstBlockHeight = options.longs === String ? String(message.firstBlockHeight) : message.firstBlockHeight; - else - object.firstBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.firstBlockHeight) : options.longs === Number ? new $util.LongBits(message.firstBlockHeight.low >>> 0, message.firstBlockHeight.high >>> 0).toNumber(true) : message.firstBlockHeight; - if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) - object.firstCoreBlockHeight = message.firstCoreBlockHeight; - if (message.startTime != null && message.hasOwnProperty("startTime")) - if (typeof message.startTime === "number") - object.startTime = options.longs === String ? String(message.startTime) : message.startTime; - else - object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber(true) : message.startTime; - if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) - object.feeMultiplier = options.json && !isFinite(message.feeMultiplier) ? String(message.feeMultiplier) : message.feeMultiplier; - if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) - object.protocolVersion = message.protocolVersion; - return object; - }; - - /** - * Converts this EpochInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo - * @instance - * @returns {Object.} JSON object - */ - EpochInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EpochInfo; - })(); - - return GetEpochsInfoResponseV0; - })(); - - return GetEpochsInfoResponse; - })(); - - v0.GetContestedResourcesRequest = (function() { - - /** - * Properties of a GetContestedResourcesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourcesRequest - * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null} [v0] GetContestedResourcesRequest v0 - */ - - /** - * Constructs a new GetContestedResourcesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourcesRequest. - * @implements IGetContestedResourcesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set - */ - function GetContestedResourcesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourcesRequest v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @instance - */ - GetContestedResourcesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourcesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @instance - */ - Object.defineProperty(GetContestedResourcesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourcesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest instance - */ - GetContestedResourcesRequest.create = function create(properties) { - return new GetContestedResourcesRequest(properties); - }; - - /** - * Encodes the specified GetContestedResourcesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourcesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourcesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourcesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest - */ - GetContestedResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest} message GetContestedResourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourcesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourcesRequest.GetContestedResourcesRequestV0 = (function() { - - /** - * Properties of a GetContestedResourcesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @interface IGetContestedResourcesRequestV0 - * @property {Uint8Array|null} [contractId] GetContestedResourcesRequestV0 contractId - * @property {string|null} [documentTypeName] GetContestedResourcesRequestV0 documentTypeName - * @property {string|null} [indexName] GetContestedResourcesRequestV0 indexName - * @property {Array.|null} [startIndexValues] GetContestedResourcesRequestV0 startIndexValues - * @property {Array.|null} [endIndexValues] GetContestedResourcesRequestV0 endIndexValues - * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null} [startAtValueInfo] GetContestedResourcesRequestV0 startAtValueInfo - * @property {number|null} [count] GetContestedResourcesRequestV0 count - * @property {boolean|null} [orderAscending] GetContestedResourcesRequestV0 orderAscending - * @property {boolean|null} [prove] GetContestedResourcesRequestV0 prove - */ - - /** - * Constructs a new GetContestedResourcesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest - * @classdesc Represents a GetContestedResourcesRequestV0. - * @implements IGetContestedResourcesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set - */ - function GetContestedResourcesRequestV0(properties) { - this.startIndexValues = []; - this.endIndexValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourcesRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetContestedResourcesRequestV0 documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.documentTypeName = ""; - - /** - * GetContestedResourcesRequestV0 indexName. - * @member {string} indexName - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.indexName = ""; - - /** - * GetContestedResourcesRequestV0 startIndexValues. - * @member {Array.} startIndexValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.startIndexValues = $util.emptyArray; - - /** - * GetContestedResourcesRequestV0 endIndexValues. - * @member {Array.} endIndexValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.endIndexValues = $util.emptyArray; - - /** - * GetContestedResourcesRequestV0 startAtValueInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null|undefined} startAtValueInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.startAtValueInfo = null; - - /** - * GetContestedResourcesRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.count = 0; - - /** - * GetContestedResourcesRequestV0 orderAscending. - * @member {boolean} orderAscending - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.orderAscending = false; - - /** - * GetContestedResourcesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - */ - GetContestedResourcesRequestV0.prototype.prove = false; - - /** - * Creates a new GetContestedResourcesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 instance - */ - GetContestedResourcesRequestV0.create = function create(properties) { - return new GetContestedResourcesRequestV0(properties); - }; - - /** - * Encodes the specified GetContestedResourcesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); - if (message.startIndexValues != null && message.startIndexValues.length) - for (var i = 0; i < message.startIndexValues.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startIndexValues[i]); - if (message.endIndexValues != null && message.endIndexValues.length) - for (var i = 0; i < message.endIndexValues.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.endIndexValues[i]); - if (message.startAtValueInfo != null && Object.hasOwnProperty.call(message, "startAtValueInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.encode(message.startAtValueInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); - if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetContestedResourcesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - message.indexName = reader.string(); - break; - case 4: - if (!(message.startIndexValues && message.startIndexValues.length)) - message.startIndexValues = []; - message.startIndexValues.push(reader.bytes()); - break; - case 5: - if (!(message.endIndexValues && message.endIndexValues.length)) - message.endIndexValues = []; - message.endIndexValues.push(reader.bytes()); - break; - case 6: - message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.decode(reader, reader.uint32()); - break; - case 7: - message.count = reader.uint32(); - break; - case 8: - message.orderAscending = reader.bool(); - break; - case 9: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourcesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourcesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.indexName != null && message.hasOwnProperty("indexName")) - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - if (message.startIndexValues != null && message.hasOwnProperty("startIndexValues")) { - if (!Array.isArray(message.startIndexValues)) - return "startIndexValues: array expected"; - for (var i = 0; i < message.startIndexValues.length; ++i) - if (!(message.startIndexValues[i] && typeof message.startIndexValues[i].length === "number" || $util.isString(message.startIndexValues[i]))) - return "startIndexValues: buffer[] expected"; - } - if (message.endIndexValues != null && message.hasOwnProperty("endIndexValues")) { - if (!Array.isArray(message.endIndexValues)) - return "endIndexValues: array expected"; - for (var i = 0; i < message.endIndexValues.length; ++i) - if (!(message.endIndexValues[i] && typeof message.endIndexValues[i].length === "number" || $util.isString(message.endIndexValues[i]))) - return "endIndexValues: buffer[] expected"; - } - if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify(message.startAtValueInfo); - if (error) - return "startAtValueInfo." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - if (typeof message.orderAscending !== "boolean") - return "orderAscending: boolean expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetContestedResourcesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 - */ - GetContestedResourcesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.startIndexValues) { - if (!Array.isArray(object.startIndexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startIndexValues: array expected"); - message.startIndexValues = []; - for (var i = 0; i < object.startIndexValues.length; ++i) - if (typeof object.startIndexValues[i] === "string") - $util.base64.decode(object.startIndexValues[i], message.startIndexValues[i] = $util.newBuffer($util.base64.length(object.startIndexValues[i])), 0); - else if (object.startIndexValues[i].length >= 0) - message.startIndexValues[i] = object.startIndexValues[i]; - } - if (object.endIndexValues) { - if (!Array.isArray(object.endIndexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.endIndexValues: array expected"); - message.endIndexValues = []; - for (var i = 0; i < object.endIndexValues.length; ++i) - if (typeof object.endIndexValues[i] === "string") - $util.base64.decode(object.endIndexValues[i], message.endIndexValues[i] = $util.newBuffer($util.base64.length(object.endIndexValues[i])), 0); - else if (object.endIndexValues[i].length >= 0) - message.endIndexValues[i] = object.endIndexValues[i]; - } - if (object.startAtValueInfo != null) { - if (typeof object.startAtValueInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startAtValueInfo: object expected"); - message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.fromObject(object.startAtValueInfo); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.orderAscending != null) - message.orderAscending = Boolean(object.orderAscending); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetContestedResourcesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourcesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.startIndexValues = []; - object.endIndexValues = []; - } - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.indexName = ""; - object.startAtValueInfo = null; - object.count = 0; - object.orderAscending = false; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.indexName != null && message.hasOwnProperty("indexName")) - object.indexName = message.indexName; - if (message.startIndexValues && message.startIndexValues.length) { - object.startIndexValues = []; - for (var j = 0; j < message.startIndexValues.length; ++j) - object.startIndexValues[j] = options.bytes === String ? $util.base64.encode(message.startIndexValues[j], 0, message.startIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.startIndexValues[j]) : message.startIndexValues[j]; - } - if (message.endIndexValues && message.endIndexValues.length) { - object.endIndexValues = []; - for (var j = 0; j < message.endIndexValues.length; ++j) - object.endIndexValues[j] = options.bytes === String ? $util.base64.encode(message.endIndexValues[j], 0, message.endIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.endIndexValues[j]) : message.endIndexValues[j]; - } - if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) - object.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.toObject(message.startAtValueInfo, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - object.orderAscending = message.orderAscending; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetContestedResourcesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourcesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourcesRequestV0.StartAtValueInfo = (function() { - - /** - * Properties of a StartAtValueInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @interface IStartAtValueInfo - * @property {Uint8Array|null} [startValue] StartAtValueInfo startValue - * @property {boolean|null} [startValueIncluded] StartAtValueInfo startValueIncluded - */ - - /** - * Constructs a new StartAtValueInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 - * @classdesc Represents a StartAtValueInfo. - * @implements IStartAtValueInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set - */ - function StartAtValueInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtValueInfo startValue. - * @member {Uint8Array} startValue - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @instance - */ - StartAtValueInfo.prototype.startValue = $util.newBuffer([]); - - /** - * StartAtValueInfo startValueIncluded. - * @member {boolean} startValueIncluded - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @instance - */ - StartAtValueInfo.prototype.startValueIncluded = false; - - /** - * Creates a new StartAtValueInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo instance - */ - StartAtValueInfo.create = function create(properties) { - return new StartAtValueInfo(properties); - }; - - /** - * Encodes the specified StartAtValueInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtValueInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startValue != null && Object.hasOwnProperty.call(message, "startValue")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startValue); - if (message.startValueIncluded != null && Object.hasOwnProperty.call(message, "startValueIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startValueIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtValueInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtValueInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtValueInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtValueInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startValue = reader.bytes(); - break; - case 2: - message.startValueIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtValueInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtValueInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtValueInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtValueInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startValue != null && message.hasOwnProperty("startValue")) - if (!(message.startValue && typeof message.startValue.length === "number" || $util.isString(message.startValue))) - return "startValue: buffer expected"; - if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) - if (typeof message.startValueIncluded !== "boolean") - return "startValueIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtValueInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo - */ - StartAtValueInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); - if (object.startValue != null) - if (typeof object.startValue === "string") - $util.base64.decode(object.startValue, message.startValue = $util.newBuffer($util.base64.length(object.startValue)), 0); - else if (object.startValue.length >= 0) - message.startValue = object.startValue; - if (object.startValueIncluded != null) - message.startValueIncluded = Boolean(object.startValueIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtValueInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} message StartAtValueInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtValueInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startValue = ""; - else { - object.startValue = []; - if (options.bytes !== Array) - object.startValue = $util.newBuffer(object.startValue); - } - object.startValueIncluded = false; - } - if (message.startValue != null && message.hasOwnProperty("startValue")) - object.startValue = options.bytes === String ? $util.base64.encode(message.startValue, 0, message.startValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValue) : message.startValue; - if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) - object.startValueIncluded = message.startValueIncluded; - return object; - }; - - /** - * Converts this StartAtValueInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtValueInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtValueInfo; - })(); - - return GetContestedResourcesRequestV0; - })(); - - return GetContestedResourcesRequest; - })(); - - v0.GetContestedResourcesResponse = (function() { - - /** - * Properties of a GetContestedResourcesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourcesResponse - * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null} [v0] GetContestedResourcesResponse v0 - */ - - /** - * Constructs a new GetContestedResourcesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourcesResponse. - * @implements IGetContestedResourcesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set - */ - function GetContestedResourcesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourcesResponse v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @instance - */ - GetContestedResourcesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourcesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @instance - */ - Object.defineProperty(GetContestedResourcesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourcesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse instance - */ - GetContestedResourcesResponse.create = function create(properties) { - return new GetContestedResourcesResponse(properties); - }; - - /** - * Encodes the specified GetContestedResourcesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourcesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourcesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse - */ - GetContestedResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} message GetContestedResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourcesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourcesResponse.GetContestedResourcesResponseV0 = (function() { - - /** - * Properties of a GetContestedResourcesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @interface IGetContestedResourcesResponseV0 - * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null} [contestedResourceValues] GetContestedResourcesResponseV0 contestedResourceValues - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourcesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourcesResponseV0 metadata - */ - - /** - * Constructs a new GetContestedResourcesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse - * @classdesc Represents a GetContestedResourcesResponseV0. - * @implements IGetContestedResourcesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set - */ - function GetContestedResourcesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourcesResponseV0 contestedResourceValues. - * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null|undefined} contestedResourceValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - */ - GetContestedResourcesResponseV0.prototype.contestedResourceValues = null; - - /** - * GetContestedResourcesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - */ - GetContestedResourcesResponseV0.prototype.proof = null; - - /** - * GetContestedResourcesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - */ - GetContestedResourcesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourcesResponseV0 result. - * @member {"contestedResourceValues"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - */ - Object.defineProperty(GetContestedResourcesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["contestedResourceValues", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourcesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 instance - */ - GetContestedResourcesResponseV0.create = function create(properties) { - return new GetContestedResourcesResponseV0(properties); - }; - - /** - * Encodes the specified GetContestedResourcesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceValues != null && Object.hasOwnProperty.call(message, "contestedResourceValues")) - $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.encode(message.contestedResourceValues, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourcesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourcesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourcesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourcesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourcesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify(message.contestedResourceValues); - if (error) - return "contestedResourceValues." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetContestedResourcesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 - */ - GetContestedResourcesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); - if (object.contestedResourceValues != null) { - if (typeof object.contestedResourceValues !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.contestedResourceValues: object expected"); - message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.fromObject(object.contestedResourceValues); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourcesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourcesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { - object.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.toObject(message.contestedResourceValues, options); - if (options.oneofs) - object.result = "contestedResourceValues"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetContestedResourcesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourcesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourcesResponseV0.ContestedResourceValues = (function() { - - /** - * Properties of a ContestedResourceValues. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @interface IContestedResourceValues - * @property {Array.|null} [contestedResourceValues] ContestedResourceValues contestedResourceValues - */ - - /** - * Constructs a new ContestedResourceValues. - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 - * @classdesc Represents a ContestedResourceValues. - * @implements IContestedResourceValues - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set - */ - function ContestedResourceValues(properties) { - this.contestedResourceValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceValues contestedResourceValues. - * @member {Array.} contestedResourceValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @instance - */ - ContestedResourceValues.prototype.contestedResourceValues = $util.emptyArray; - - /** - * Creates a new ContestedResourceValues instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues instance - */ - ContestedResourceValues.create = function create(properties) { - return new ContestedResourceValues(properties); - }; - - /** - * Encodes the specified ContestedResourceValues message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceValues != null && message.contestedResourceValues.length) - for (var i = 0; i < message.contestedResourceValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contestedResourceValues[i]); - return writer; - }; - - /** - * Encodes the specified ContestedResourceValues message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceValues message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceValues.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.contestedResourceValues && message.contestedResourceValues.length)) - message.contestedResourceValues = []; - message.contestedResourceValues.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceValues message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { - if (!Array.isArray(message.contestedResourceValues)) - return "contestedResourceValues: array expected"; - for (var i = 0; i < message.contestedResourceValues.length; ++i) - if (!(message.contestedResourceValues[i] && typeof message.contestedResourceValues[i].length === "number" || $util.isString(message.contestedResourceValues[i]))) - return "contestedResourceValues: buffer[] expected"; - } - return null; - }; - - /** - * Creates a ContestedResourceValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues - */ - ContestedResourceValues.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); - if (object.contestedResourceValues) { - if (!Array.isArray(object.contestedResourceValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.contestedResourceValues: array expected"); - message.contestedResourceValues = []; - for (var i = 0; i < object.contestedResourceValues.length; ++i) - if (typeof object.contestedResourceValues[i] === "string") - $util.base64.decode(object.contestedResourceValues[i], message.contestedResourceValues[i] = $util.newBuffer($util.base64.length(object.contestedResourceValues[i])), 0); - else if (object.contestedResourceValues[i].length >= 0) - message.contestedResourceValues[i] = object.contestedResourceValues[i]; - } - return message; - }; - - /** - * Creates a plain object from a ContestedResourceValues message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} message ContestedResourceValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.contestedResourceValues = []; - if (message.contestedResourceValues && message.contestedResourceValues.length) { - object.contestedResourceValues = []; - for (var j = 0; j < message.contestedResourceValues.length; ++j) - object.contestedResourceValues[j] = options.bytes === String ? $util.base64.encode(message.contestedResourceValues[j], 0, message.contestedResourceValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.contestedResourceValues[j]) : message.contestedResourceValues[j]; - } - return object; - }; - - /** - * Converts this ContestedResourceValues to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceValues; - })(); - - return GetContestedResourcesResponseV0; - })(); - - return GetContestedResourcesResponse; - })(); - - v0.GetVotePollsByEndDateRequest = (function() { - - /** - * Properties of a GetVotePollsByEndDateRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetVotePollsByEndDateRequest - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null} [v0] GetVotePollsByEndDateRequest v0 - */ - - /** - * Constructs a new GetVotePollsByEndDateRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetVotePollsByEndDateRequest. - * @implements IGetVotePollsByEndDateRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set - */ - function GetVotePollsByEndDateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetVotePollsByEndDateRequest v0. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @instance - */ - GetVotePollsByEndDateRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetVotePollsByEndDateRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @instance - */ - Object.defineProperty(GetVotePollsByEndDateRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetVotePollsByEndDateRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest instance - */ - GetVotePollsByEndDateRequest.create = function create(properties) { - return new GetVotePollsByEndDateRequest(properties); - }; - - /** - * Encodes the specified GetVotePollsByEndDateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetVotePollsByEndDateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVotePollsByEndDateRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVotePollsByEndDateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetVotePollsByEndDateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest - */ - GetVotePollsByEndDateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetVotePollsByEndDateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVotePollsByEndDateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetVotePollsByEndDateRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @instance - * @returns {Object.} JSON object - */ - GetVotePollsByEndDateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 = (function() { - - /** - * Properties of a GetVotePollsByEndDateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @interface IGetVotePollsByEndDateRequestV0 - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null} [startTimeInfo] GetVotePollsByEndDateRequestV0 startTimeInfo - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null} [endTimeInfo] GetVotePollsByEndDateRequestV0 endTimeInfo - * @property {number|null} [limit] GetVotePollsByEndDateRequestV0 limit - * @property {number|null} [offset] GetVotePollsByEndDateRequestV0 offset - * @property {boolean|null} [ascending] GetVotePollsByEndDateRequestV0 ascending - * @property {boolean|null} [prove] GetVotePollsByEndDateRequestV0 prove - */ - - /** - * Constructs a new GetVotePollsByEndDateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest - * @classdesc Represents a GetVotePollsByEndDateRequestV0. - * @implements IGetVotePollsByEndDateRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set - */ - function GetVotePollsByEndDateRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetVotePollsByEndDateRequestV0 startTimeInfo. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null|undefined} startTimeInfo - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.startTimeInfo = null; - - /** - * GetVotePollsByEndDateRequestV0 endTimeInfo. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null|undefined} endTimeInfo - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.endTimeInfo = null; - - /** - * GetVotePollsByEndDateRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.limit = 0; - - /** - * GetVotePollsByEndDateRequestV0 offset. - * @member {number} offset - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.offset = 0; - - /** - * GetVotePollsByEndDateRequestV0 ascending. - * @member {boolean} ascending - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.ascending = false; - - /** - * GetVotePollsByEndDateRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - */ - GetVotePollsByEndDateRequestV0.prototype.prove = false; - - /** - * Creates a new GetVotePollsByEndDateRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 instance - */ - GetVotePollsByEndDateRequestV0.create = function create(properties) { - return new GetVotePollsByEndDateRequestV0(properties); - }; - - /** - * Encodes the specified GetVotePollsByEndDateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimeInfo != null && Object.hasOwnProperty.call(message, "startTimeInfo")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.encode(message.startTimeInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTimeInfo != null && Object.hasOwnProperty.call(message, "endTimeInfo")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.encode(message.endTimeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.offset); - if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ascending); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetVotePollsByEndDateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.decode(reader, reader.uint32()); - break; - case 2: - message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.decode(reader, reader.uint32()); - break; - case 3: - message.limit = reader.uint32(); - break; - case 4: - message.offset = reader.uint32(); - break; - case 5: - message.ascending = reader.bool(); - break; - case 6: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVotePollsByEndDateRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVotePollsByEndDateRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify(message.startTimeInfo); - if (error) - return "startTimeInfo." + error; - } - if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify(message.endTimeInfo); - if (error) - return "endTimeInfo." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.ascending != null && message.hasOwnProperty("ascending")) - if (typeof message.ascending !== "boolean") - return "ascending: boolean expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetVotePollsByEndDateRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 - */ - GetVotePollsByEndDateRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); - if (object.startTimeInfo != null) { - if (typeof object.startTimeInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.startTimeInfo: object expected"); - message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.fromObject(object.startTimeInfo); - } - if (object.endTimeInfo != null) { - if (typeof object.endTimeInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.endTimeInfo: object expected"); - message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.fromObject(object.endTimeInfo); - } - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.offset != null) - message.offset = object.offset >>> 0; - if (object.ascending != null) - message.ascending = Boolean(object.ascending); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetVotePollsByEndDateRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVotePollsByEndDateRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTimeInfo = null; - object.endTimeInfo = null; - object.limit = 0; - object.offset = 0; - object.ascending = false; - object.prove = false; - } - if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) - object.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.toObject(message.startTimeInfo, options); - if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) - object.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.toObject(message.endTimeInfo, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.ascending != null && message.hasOwnProperty("ascending")) - object.ascending = message.ascending; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetVotePollsByEndDateRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetVotePollsByEndDateRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetVotePollsByEndDateRequestV0.StartAtTimeInfo = (function() { - - /** - * Properties of a StartAtTimeInfo. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @interface IStartAtTimeInfo - * @property {number|Long|null} [startTimeMs] StartAtTimeInfo startTimeMs - * @property {boolean|null} [startTimeIncluded] StartAtTimeInfo startTimeIncluded - */ - - /** - * Constructs a new StartAtTimeInfo. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @classdesc Represents a StartAtTimeInfo. - * @implements IStartAtTimeInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set - */ - function StartAtTimeInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtTimeInfo startTimeMs. - * @member {number|Long} startTimeMs - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @instance - */ - StartAtTimeInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StartAtTimeInfo startTimeIncluded. - * @member {boolean} startTimeIncluded - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @instance - */ - StartAtTimeInfo.prototype.startTimeIncluded = false; - - /** - * Creates a new StartAtTimeInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo instance - */ - StartAtTimeInfo.create = function create(properties) { - return new StartAtTimeInfo(properties); - }; - - /** - * Encodes the specified StartAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtTimeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); - if (message.startTimeIncluded != null && Object.hasOwnProperty.call(message, "startTimeIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startTimeIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtTimeInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtTimeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTimeMs = reader.uint64(); - break; - case 2: - message.startTimeIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtTimeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtTimeInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtTimeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) - if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) - return "startTimeMs: integer|Long expected"; - if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) - if (typeof message.startTimeIncluded !== "boolean") - return "startTimeIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtTimeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo - */ - StartAtTimeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); - if (object.startTimeMs != null) - if ($util.Long) - (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; - else if (typeof object.startTimeMs === "string") - message.startTimeMs = parseInt(object.startTimeMs, 10); - else if (typeof object.startTimeMs === "number") - message.startTimeMs = object.startTimeMs; - else if (typeof object.startTimeMs === "object") - message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); - if (object.startTimeIncluded != null) - message.startTimeIncluded = Boolean(object.startTimeIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtTimeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} message StartAtTimeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtTimeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startTimeMs = options.longs === String ? "0" : 0; - object.startTimeIncluded = false; - } - if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) - if (typeof message.startTimeMs === "number") - object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; - else - object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; - if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) - object.startTimeIncluded = message.startTimeIncluded; - return object; - }; - - /** - * Converts this StartAtTimeInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtTimeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtTimeInfo; - })(); - - GetVotePollsByEndDateRequestV0.EndAtTimeInfo = (function() { - - /** - * Properties of an EndAtTimeInfo. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @interface IEndAtTimeInfo - * @property {number|Long|null} [endTimeMs] EndAtTimeInfo endTimeMs - * @property {boolean|null} [endTimeIncluded] EndAtTimeInfo endTimeIncluded - */ - - /** - * Constructs a new EndAtTimeInfo. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 - * @classdesc Represents an EndAtTimeInfo. - * @implements IEndAtTimeInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set - */ - function EndAtTimeInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EndAtTimeInfo endTimeMs. - * @member {number|Long} endTimeMs - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @instance - */ - EndAtTimeInfo.prototype.endTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * EndAtTimeInfo endTimeIncluded. - * @member {boolean} endTimeIncluded - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @instance - */ - EndAtTimeInfo.prototype.endTimeIncluded = false; - - /** - * Creates a new EndAtTimeInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo instance - */ - EndAtTimeInfo.create = function create(properties) { - return new EndAtTimeInfo(properties); - }; - - /** - * Encodes the specified EndAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndAtTimeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.endTimeMs != null && Object.hasOwnProperty.call(message, "endTimeMs")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.endTimeMs); - if (message.endTimeIncluded != null && Object.hasOwnProperty.call(message, "endTimeIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.endTimeIncluded); - return writer; - }; - - /** - * Encodes the specified EndAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EndAtTimeInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndAtTimeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.endTimeMs = reader.uint64(); - break; - case 2: - message.endTimeIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EndAtTimeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EndAtTimeInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EndAtTimeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) - if (!$util.isInteger(message.endTimeMs) && !(message.endTimeMs && $util.isInteger(message.endTimeMs.low) && $util.isInteger(message.endTimeMs.high))) - return "endTimeMs: integer|Long expected"; - if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) - if (typeof message.endTimeIncluded !== "boolean") - return "endTimeIncluded: boolean expected"; - return null; - }; - - /** - * Creates an EndAtTimeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo - */ - EndAtTimeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); - if (object.endTimeMs != null) - if ($util.Long) - (message.endTimeMs = $util.Long.fromValue(object.endTimeMs)).unsigned = true; - else if (typeof object.endTimeMs === "string") - message.endTimeMs = parseInt(object.endTimeMs, 10); - else if (typeof object.endTimeMs === "number") - message.endTimeMs = object.endTimeMs; - else if (typeof object.endTimeMs === "object") - message.endTimeMs = new $util.LongBits(object.endTimeMs.low >>> 0, object.endTimeMs.high >>> 0).toNumber(true); - if (object.endTimeIncluded != null) - message.endTimeIncluded = Boolean(object.endTimeIncluded); - return message; - }; - - /** - * Creates a plain object from an EndAtTimeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} message EndAtTimeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EndAtTimeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.endTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.endTimeMs = options.longs === String ? "0" : 0; - object.endTimeIncluded = false; - } - if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) - if (typeof message.endTimeMs === "number") - object.endTimeMs = options.longs === String ? String(message.endTimeMs) : message.endTimeMs; - else - object.endTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeMs) : options.longs === Number ? new $util.LongBits(message.endTimeMs.low >>> 0, message.endTimeMs.high >>> 0).toNumber(true) : message.endTimeMs; - if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) - object.endTimeIncluded = message.endTimeIncluded; - return object; - }; - - /** - * Converts this EndAtTimeInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo - * @instance - * @returns {Object.} JSON object - */ - EndAtTimeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EndAtTimeInfo; - })(); - - return GetVotePollsByEndDateRequestV0; - })(); - - return GetVotePollsByEndDateRequest; - })(); - - v0.GetVotePollsByEndDateResponse = (function() { - - /** - * Properties of a GetVotePollsByEndDateResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetVotePollsByEndDateResponse - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null} [v0] GetVotePollsByEndDateResponse v0 - */ - - /** - * Constructs a new GetVotePollsByEndDateResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetVotePollsByEndDateResponse. - * @implements IGetVotePollsByEndDateResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set - */ - function GetVotePollsByEndDateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetVotePollsByEndDateResponse v0. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @instance - */ - GetVotePollsByEndDateResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetVotePollsByEndDateResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @instance - */ - Object.defineProperty(GetVotePollsByEndDateResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetVotePollsByEndDateResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse instance - */ - GetVotePollsByEndDateResponse.create = function create(properties) { - return new GetVotePollsByEndDateResponse(properties); - }; - - /** - * Encodes the specified GetVotePollsByEndDateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetVotePollsByEndDateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVotePollsByEndDateResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVotePollsByEndDateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetVotePollsByEndDateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse - */ - GetVotePollsByEndDateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetVotePollsByEndDateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVotePollsByEndDateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetVotePollsByEndDateResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @instance - * @returns {Object.} JSON object - */ - GetVotePollsByEndDateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 = (function() { - - /** - * Properties of a GetVotePollsByEndDateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @interface IGetVotePollsByEndDateResponseV0 - * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null} [votePollsByTimestamps] GetVotePollsByEndDateResponseV0 votePollsByTimestamps - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetVotePollsByEndDateResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetVotePollsByEndDateResponseV0 metadata - */ - - /** - * Constructs a new GetVotePollsByEndDateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse - * @classdesc Represents a GetVotePollsByEndDateResponseV0. - * @implements IGetVotePollsByEndDateResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set - */ - function GetVotePollsByEndDateResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetVotePollsByEndDateResponseV0 votePollsByTimestamps. - * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null|undefined} votePollsByTimestamps - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - */ - GetVotePollsByEndDateResponseV0.prototype.votePollsByTimestamps = null; - - /** - * GetVotePollsByEndDateResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - */ - GetVotePollsByEndDateResponseV0.prototype.proof = null; - - /** - * GetVotePollsByEndDateResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - */ - GetVotePollsByEndDateResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetVotePollsByEndDateResponseV0 result. - * @member {"votePollsByTimestamps"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - */ - Object.defineProperty(GetVotePollsByEndDateResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["votePollsByTimestamps", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetVotePollsByEndDateResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 instance - */ - GetVotePollsByEndDateResponseV0.create = function create(properties) { - return new GetVotePollsByEndDateResponseV0(properties); - }; - - /** - * Encodes the specified GetVotePollsByEndDateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.votePollsByTimestamps != null && Object.hasOwnProperty.call(message, "votePollsByTimestamps")) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.encode(message.votePollsByTimestamps, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetVotePollsByEndDateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVotePollsByEndDateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVotePollsByEndDateResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVotePollsByEndDateResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVotePollsByEndDateResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify(message.votePollsByTimestamps); - if (error) - return "votePollsByTimestamps." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetVotePollsByEndDateResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 - */ - GetVotePollsByEndDateResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); - if (object.votePollsByTimestamps != null) { - if (typeof object.votePollsByTimestamps !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.votePollsByTimestamps: object expected"); - message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.fromObject(object.votePollsByTimestamps); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetVotePollsByEndDateResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVotePollsByEndDateResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { - object.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.toObject(message.votePollsByTimestamps, options); - if (options.oneofs) - object.result = "votePollsByTimestamps"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetVotePollsByEndDateResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetVotePollsByEndDateResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp = (function() { - - /** - * Properties of a SerializedVotePollsByTimestamp. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @interface ISerializedVotePollsByTimestamp - * @property {number|Long|null} [timestamp] SerializedVotePollsByTimestamp timestamp - * @property {Array.|null} [serializedVotePolls] SerializedVotePollsByTimestamp serializedVotePolls - */ - - /** - * Constructs a new SerializedVotePollsByTimestamp. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @classdesc Represents a SerializedVotePollsByTimestamp. - * @implements ISerializedVotePollsByTimestamp - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set - */ - function SerializedVotePollsByTimestamp(properties) { - this.serializedVotePolls = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SerializedVotePollsByTimestamp timestamp. - * @member {number|Long} timestamp - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @instance - */ - SerializedVotePollsByTimestamp.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SerializedVotePollsByTimestamp serializedVotePolls. - * @member {Array.} serializedVotePolls - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @instance - */ - SerializedVotePollsByTimestamp.prototype.serializedVotePolls = $util.emptyArray; - - /** - * Creates a new SerializedVotePollsByTimestamp instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp instance - */ - SerializedVotePollsByTimestamp.create = function create(properties) { - return new SerializedVotePollsByTimestamp(properties); - }; - - /** - * Encodes the specified SerializedVotePollsByTimestamp message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SerializedVotePollsByTimestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); - if (message.serializedVotePolls != null && message.serializedVotePolls.length) - for (var i = 0; i < message.serializedVotePolls.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.serializedVotePolls[i]); - return writer; - }; - - /** - * Encodes the specified SerializedVotePollsByTimestamp message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SerializedVotePollsByTimestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SerializedVotePollsByTimestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.timestamp = reader.uint64(); - break; - case 2: - if (!(message.serializedVotePolls && message.serializedVotePolls.length)) - message.serializedVotePolls = []; - message.serializedVotePolls.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SerializedVotePollsByTimestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SerializedVotePollsByTimestamp message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SerializedVotePollsByTimestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.serializedVotePolls != null && message.hasOwnProperty("serializedVotePolls")) { - if (!Array.isArray(message.serializedVotePolls)) - return "serializedVotePolls: array expected"; - for (var i = 0; i < message.serializedVotePolls.length; ++i) - if (!(message.serializedVotePolls[i] && typeof message.serializedVotePolls[i].length === "number" || $util.isString(message.serializedVotePolls[i]))) - return "serializedVotePolls: buffer[] expected"; - } - return null; - }; - - /** - * Creates a SerializedVotePollsByTimestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp - */ - SerializedVotePollsByTimestamp.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.serializedVotePolls) { - if (!Array.isArray(object.serializedVotePolls)) - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.serializedVotePolls: array expected"); - message.serializedVotePolls = []; - for (var i = 0; i < object.serializedVotePolls.length; ++i) - if (typeof object.serializedVotePolls[i] === "string") - $util.base64.decode(object.serializedVotePolls[i], message.serializedVotePolls[i] = $util.newBuffer($util.base64.length(object.serializedVotePolls[i])), 0); - else if (object.serializedVotePolls[i].length >= 0) - message.serializedVotePolls[i] = object.serializedVotePolls[i]; - } - return message; - }; - - /** - * Creates a plain object from a SerializedVotePollsByTimestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SerializedVotePollsByTimestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.serializedVotePolls = []; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.serializedVotePolls && message.serializedVotePolls.length) { - object.serializedVotePolls = []; - for (var j = 0; j < message.serializedVotePolls.length; ++j) - object.serializedVotePolls[j] = options.bytes === String ? $util.base64.encode(message.serializedVotePolls[j], 0, message.serializedVotePolls[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedVotePolls[j]) : message.serializedVotePolls[j]; - } - return object; - }; - - /** - * Converts this SerializedVotePollsByTimestamp to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp - * @instance - * @returns {Object.} JSON object - */ - SerializedVotePollsByTimestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SerializedVotePollsByTimestamp; - })(); - - GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps = (function() { - - /** - * Properties of a SerializedVotePollsByTimestamps. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @interface ISerializedVotePollsByTimestamps - * @property {Array.|null} [votePollsByTimestamps] SerializedVotePollsByTimestamps votePollsByTimestamps - * @property {boolean|null} [finishedResults] SerializedVotePollsByTimestamps finishedResults - */ - - /** - * Constructs a new SerializedVotePollsByTimestamps. - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 - * @classdesc Represents a SerializedVotePollsByTimestamps. - * @implements ISerializedVotePollsByTimestamps - * @constructor - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set - */ - function SerializedVotePollsByTimestamps(properties) { - this.votePollsByTimestamps = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SerializedVotePollsByTimestamps votePollsByTimestamps. - * @member {Array.} votePollsByTimestamps - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @instance - */ - SerializedVotePollsByTimestamps.prototype.votePollsByTimestamps = $util.emptyArray; - - /** - * SerializedVotePollsByTimestamps finishedResults. - * @member {boolean} finishedResults - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @instance - */ - SerializedVotePollsByTimestamps.prototype.finishedResults = false; - - /** - * Creates a new SerializedVotePollsByTimestamps instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps instance - */ - SerializedVotePollsByTimestamps.create = function create(properties) { - return new SerializedVotePollsByTimestamps(properties); - }; - - /** - * Encodes the specified SerializedVotePollsByTimestamps message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SerializedVotePollsByTimestamps.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.votePollsByTimestamps != null && message.votePollsByTimestamps.length) - for (var i = 0; i < message.votePollsByTimestamps.length; ++i) - $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.encode(message.votePollsByTimestamps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); - return writer; - }; - - /** - * Encodes the specified SerializedVotePollsByTimestamps message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SerializedVotePollsByTimestamps.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SerializedVotePollsByTimestamps.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.votePollsByTimestamps && message.votePollsByTimestamps.length)) - message.votePollsByTimestamps = []; - message.votePollsByTimestamps.push($root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.decode(reader, reader.uint32())); - break; - case 2: - message.finishedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SerializedVotePollsByTimestamps.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SerializedVotePollsByTimestamps message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SerializedVotePollsByTimestamps.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { - if (!Array.isArray(message.votePollsByTimestamps)) - return "votePollsByTimestamps: array expected"; - for (var i = 0; i < message.votePollsByTimestamps.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify(message.votePollsByTimestamps[i]); - if (error) - return "votePollsByTimestamps." + error; - } - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - if (typeof message.finishedResults !== "boolean") - return "finishedResults: boolean expected"; - return null; - }; - - /** - * Creates a SerializedVotePollsByTimestamps message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps - */ - SerializedVotePollsByTimestamps.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); - if (object.votePollsByTimestamps) { - if (!Array.isArray(object.votePollsByTimestamps)) - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: array expected"); - message.votePollsByTimestamps = []; - for (var i = 0; i < object.votePollsByTimestamps.length; ++i) { - if (typeof object.votePollsByTimestamps[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: object expected"); - message.votePollsByTimestamps[i] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.fromObject(object.votePollsByTimestamps[i]); - } - } - if (object.finishedResults != null) - message.finishedResults = Boolean(object.finishedResults); - return message; - }; - - /** - * Creates a plain object from a SerializedVotePollsByTimestamps message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @static - * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SerializedVotePollsByTimestamps.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.votePollsByTimestamps = []; - if (options.defaults) - object.finishedResults = false; - if (message.votePollsByTimestamps && message.votePollsByTimestamps.length) { - object.votePollsByTimestamps = []; - for (var j = 0; j < message.votePollsByTimestamps.length; ++j) - object.votePollsByTimestamps[j] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.toObject(message.votePollsByTimestamps[j], options); - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - object.finishedResults = message.finishedResults; - return object; - }; - - /** - * Converts this SerializedVotePollsByTimestamps to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps - * @instance - * @returns {Object.} JSON object - */ - SerializedVotePollsByTimestamps.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SerializedVotePollsByTimestamps; - })(); - - return GetVotePollsByEndDateResponseV0; - })(); - - return GetVotePollsByEndDateResponse; - })(); - - v0.GetContestedResourceVoteStateRequest = (function() { - - /** - * Properties of a GetContestedResourceVoteStateRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceVoteStateRequest - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null} [v0] GetContestedResourceVoteStateRequest v0 - */ - - /** - * Constructs a new GetContestedResourceVoteStateRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceVoteStateRequest. - * @implements IGetContestedResourceVoteStateRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set - */ - function GetContestedResourceVoteStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVoteStateRequest v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @instance - */ - GetContestedResourceVoteStateRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVoteStateRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @instance - */ - Object.defineProperty(GetContestedResourceVoteStateRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVoteStateRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest instance - */ - GetContestedResourceVoteStateRequest.create = function create(properties) { - return new GetContestedResourceVoteStateRequest(properties); - }; - - /** - * Encodes the specified GetContestedResourceVoteStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVoteStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVoteStateRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVoteStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceVoteStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest - */ - GetContestedResourceVoteStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVoteStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVoteStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceVoteStateRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVoteStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 = (function() { - - /** - * Properties of a GetContestedResourceVoteStateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @interface IGetContestedResourceVoteStateRequestV0 - * @property {Uint8Array|null} [contractId] GetContestedResourceVoteStateRequestV0 contractId - * @property {string|null} [documentTypeName] GetContestedResourceVoteStateRequestV0 documentTypeName - * @property {string|null} [indexName] GetContestedResourceVoteStateRequestV0 indexName - * @property {Array.|null} [indexValues] GetContestedResourceVoteStateRequestV0 indexValues - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType|null} [resultType] GetContestedResourceVoteStateRequestV0 resultType - * @property {boolean|null} [allowIncludeLockedAndAbstainingVoteTally] GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo - * @property {number|null} [count] GetContestedResourceVoteStateRequestV0 count - * @property {boolean|null} [prove] GetContestedResourceVoteStateRequestV0 prove - */ - - /** - * Constructs a new GetContestedResourceVoteStateRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest - * @classdesc Represents a GetContestedResourceVoteStateRequestV0. - * @implements IGetContestedResourceVoteStateRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set - */ - function GetContestedResourceVoteStateRequestV0(properties) { - this.indexValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVoteStateRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetContestedResourceVoteStateRequestV0 documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.documentTypeName = ""; - - /** - * GetContestedResourceVoteStateRequestV0 indexName. - * @member {string} indexName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.indexName = ""; - - /** - * GetContestedResourceVoteStateRequestV0 indexValues. - * @member {Array.} indexValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.indexValues = $util.emptyArray; - - /** - * GetContestedResourceVoteStateRequestV0 resultType. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType} resultType - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.resultType = 0; - - /** - * GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally. - * @member {boolean} allowIncludeLockedAndAbstainingVoteTally - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.allowIncludeLockedAndAbstainingVoteTally = false; - - /** - * GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.startAtIdentifierInfo = null; - - /** - * GetContestedResourceVoteStateRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.count = 0; - - /** - * GetContestedResourceVoteStateRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - */ - GetContestedResourceVoteStateRequestV0.prototype.prove = false; - - /** - * Creates a new GetContestedResourceVoteStateRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 instance - */ - GetContestedResourceVoteStateRequestV0.create = function create(properties) { - return new GetContestedResourceVoteStateRequestV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceVoteStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); - if (message.indexValues != null && message.indexValues.length) - for (var i = 0; i < message.indexValues.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); - if (message.resultType != null && Object.hasOwnProperty.call(message, "resultType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resultType); - if (message.allowIncludeLockedAndAbstainingVoteTally != null && Object.hasOwnProperty.call(message, "allowIncludeLockedAndAbstainingVoteTally")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowIncludeLockedAndAbstainingVoteTally); - if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.count); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVoteStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - message.indexName = reader.string(); - break; - case 4: - if (!(message.indexValues && message.indexValues.length)) - message.indexValues = []; - message.indexValues.push(reader.bytes()); - break; - case 5: - message.resultType = reader.int32(); - break; - case 6: - message.allowIncludeLockedAndAbstainingVoteTally = reader.bool(); - break; - case 7: - message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); - break; - case 8: - message.count = reader.uint32(); - break; - case 9: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVoteStateRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVoteStateRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.indexName != null && message.hasOwnProperty("indexName")) - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - if (message.indexValues != null && message.hasOwnProperty("indexValues")) { - if (!Array.isArray(message.indexValues)) - return "indexValues: array expected"; - for (var i = 0; i < message.indexValues.length; ++i) - if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) - return "indexValues: buffer[] expected"; - } - if (message.resultType != null && message.hasOwnProperty("resultType")) - switch (message.resultType) { - default: - return "resultType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) - if (typeof message.allowIncludeLockedAndAbstainingVoteTally !== "boolean") - return "allowIncludeLockedAndAbstainingVoteTally: boolean expected"; - if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); - if (error) - return "startAtIdentifierInfo." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetContestedResourceVoteStateRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 - */ - GetContestedResourceVoteStateRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.indexValues) { - if (!Array.isArray(object.indexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.indexValues: array expected"); - message.indexValues = []; - for (var i = 0; i < object.indexValues.length; ++i) - if (typeof object.indexValues[i] === "string") - $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); - else if (object.indexValues[i].length >= 0) - message.indexValues[i] = object.indexValues[i]; - } - switch (object.resultType) { - case "DOCUMENTS": - case 0: - message.resultType = 0; - break; - case "VOTE_TALLY": - case 1: - message.resultType = 1; - break; - case "DOCUMENTS_AND_VOTE_TALLY": - case 2: - message.resultType = 2; - break; - } - if (object.allowIncludeLockedAndAbstainingVoteTally != null) - message.allowIncludeLockedAndAbstainingVoteTally = Boolean(object.allowIncludeLockedAndAbstainingVoteTally); - if (object.startAtIdentifierInfo != null) { - if (typeof object.startAtIdentifierInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.startAtIdentifierInfo: object expected"); - message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVoteStateRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVoteStateRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexValues = []; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.indexName = ""; - object.resultType = options.enums === String ? "DOCUMENTS" : 0; - object.allowIncludeLockedAndAbstainingVoteTally = false; - object.startAtIdentifierInfo = null; - object.count = 0; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.indexName != null && message.hasOwnProperty("indexName")) - object.indexName = message.indexName; - if (message.indexValues && message.indexValues.length) { - object.indexValues = []; - for (var j = 0; j < message.indexValues.length; ++j) - object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; - } - if (message.resultType != null && message.hasOwnProperty("resultType")) - object.resultType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType[message.resultType] : message.resultType; - if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) - object.allowIncludeLockedAndAbstainingVoteTally = message.allowIncludeLockedAndAbstainingVoteTally; - if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) - object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetContestedResourceVoteStateRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVoteStateRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo = (function() { - - /** - * Properties of a StartAtIdentifierInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @interface IStartAtIdentifierInfo - * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier - * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded - */ - - /** - * Constructs a new StartAtIdentifierInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 - * @classdesc Represents a StartAtIdentifierInfo. - * @implements IStartAtIdentifierInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set - */ - function StartAtIdentifierInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtIdentifierInfo startIdentifier. - * @member {Uint8Array} startIdentifier - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @instance - */ - StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); - - /** - * StartAtIdentifierInfo startIdentifierIncluded. - * @member {boolean} startIdentifierIncluded - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @instance - */ - StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; - - /** - * Creates a new StartAtIdentifierInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance - */ - StartAtIdentifierInfo.create = function create(properties) { - return new StartAtIdentifierInfo(properties); - }; - - /** - * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtIdentifierInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); - if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtIdentifierInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startIdentifier = reader.bytes(); - break; - case 2: - message.startIdentifierIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtIdentifierInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtIdentifierInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) - if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) - return "startIdentifier: buffer expected"; - if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) - if (typeof message.startIdentifierIncluded !== "boolean") - return "startIdentifierIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - */ - StartAtIdentifierInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); - if (object.startIdentifier != null) - if (typeof object.startIdentifier === "string") - $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); - else if (object.startIdentifier.length >= 0) - message.startIdentifier = object.startIdentifier; - if (object.startIdentifierIncluded != null) - message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtIdentifierInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startIdentifier = ""; - else { - object.startIdentifier = []; - if (options.bytes !== Array) - object.startIdentifier = $util.newBuffer(object.startIdentifier); - } - object.startIdentifierIncluded = false; - } - if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) - object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; - if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) - object.startIdentifierIncluded = message.startIdentifierIncluded; - return object; - }; - - /** - * Converts this StartAtIdentifierInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtIdentifierInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtIdentifierInfo; - })(); - - /** - * ResultType enum. - * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType - * @enum {number} - * @property {number} DOCUMENTS=0 DOCUMENTS value - * @property {number} VOTE_TALLY=1 VOTE_TALLY value - * @property {number} DOCUMENTS_AND_VOTE_TALLY=2 DOCUMENTS_AND_VOTE_TALLY value - */ - GetContestedResourceVoteStateRequestV0.ResultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DOCUMENTS"] = 0; - values[valuesById[1] = "VOTE_TALLY"] = 1; - values[valuesById[2] = "DOCUMENTS_AND_VOTE_TALLY"] = 2; - return values; - })(); - - return GetContestedResourceVoteStateRequestV0; - })(); - - return GetContestedResourceVoteStateRequest; - })(); - - v0.GetContestedResourceVoteStateResponse = (function() { - - /** - * Properties of a GetContestedResourceVoteStateResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceVoteStateResponse - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null} [v0] GetContestedResourceVoteStateResponse v0 - */ - - /** - * Constructs a new GetContestedResourceVoteStateResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceVoteStateResponse. - * @implements IGetContestedResourceVoteStateResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set - */ - function GetContestedResourceVoteStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVoteStateResponse v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @instance - */ - GetContestedResourceVoteStateResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVoteStateResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @instance - */ - Object.defineProperty(GetContestedResourceVoteStateResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVoteStateResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse instance - */ - GetContestedResourceVoteStateResponse.create = function create(properties) { - return new GetContestedResourceVoteStateResponse(properties); - }; - - /** - * Encodes the specified GetContestedResourceVoteStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVoteStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVoteStateResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVoteStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceVoteStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse - */ - GetContestedResourceVoteStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVoteStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVoteStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceVoteStateResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVoteStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 = (function() { - - /** - * Properties of a GetContestedResourceVoteStateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @interface IGetContestedResourceVoteStateResponseV0 - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null} [contestedResourceContenders] GetContestedResourceVoteStateResponseV0 contestedResourceContenders - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVoteStateResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVoteStateResponseV0 metadata - */ - - /** - * Constructs a new GetContestedResourceVoteStateResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse - * @classdesc Represents a GetContestedResourceVoteStateResponseV0. - * @implements IGetContestedResourceVoteStateResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set - */ - function GetContestedResourceVoteStateResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVoteStateResponseV0 contestedResourceContenders. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null|undefined} contestedResourceContenders - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - */ - GetContestedResourceVoteStateResponseV0.prototype.contestedResourceContenders = null; - - /** - * GetContestedResourceVoteStateResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - */ - GetContestedResourceVoteStateResponseV0.prototype.proof = null; - - /** - * GetContestedResourceVoteStateResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - */ - GetContestedResourceVoteStateResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVoteStateResponseV0 result. - * @member {"contestedResourceContenders"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - */ - Object.defineProperty(GetContestedResourceVoteStateResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["contestedResourceContenders", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVoteStateResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 instance - */ - GetContestedResourceVoteStateResponseV0.create = function create(properties) { - return new GetContestedResourceVoteStateResponseV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceVoteStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceContenders != null && Object.hasOwnProperty.call(message, "contestedResourceContenders")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.encode(message.contestedResourceContenders, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVoteStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVoteStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVoteStateResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVoteStateResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVoteStateResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify(message.contestedResourceContenders); - if (error) - return "contestedResourceContenders." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetContestedResourceVoteStateResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 - */ - GetContestedResourceVoteStateResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); - if (object.contestedResourceContenders != null) { - if (typeof object.contestedResourceContenders !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.contestedResourceContenders: object expected"); - message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.fromObject(object.contestedResourceContenders); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVoteStateResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVoteStateResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { - object.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.toObject(message.contestedResourceContenders, options); - if (options.oneofs) - object.result = "contestedResourceContenders"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetContestedResourceVoteStateResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVoteStateResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVoteStateResponseV0.FinishedVoteInfo = (function() { - - /** - * Properties of a FinishedVoteInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @interface IFinishedVoteInfo - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome|null} [finishedVoteOutcome] FinishedVoteInfo finishedVoteOutcome - * @property {Uint8Array|null} [wonByIdentityId] FinishedVoteInfo wonByIdentityId - * @property {number|Long|null} [finishedAtBlockHeight] FinishedVoteInfo finishedAtBlockHeight - * @property {number|null} [finishedAtCoreBlockHeight] FinishedVoteInfo finishedAtCoreBlockHeight - * @property {number|Long|null} [finishedAtBlockTimeMs] FinishedVoteInfo finishedAtBlockTimeMs - * @property {number|null} [finishedAtEpoch] FinishedVoteInfo finishedAtEpoch - */ - - /** - * Constructs a new FinishedVoteInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @classdesc Represents a FinishedVoteInfo. - * @implements IFinishedVoteInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set - */ - function FinishedVoteInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FinishedVoteInfo finishedVoteOutcome. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome} finishedVoteOutcome - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedVoteOutcome = 0; - - /** - * FinishedVoteInfo wonByIdentityId. - * @member {Uint8Array} wonByIdentityId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.wonByIdentityId = $util.newBuffer([]); - - /** - * FinishedVoteInfo finishedAtBlockHeight. - * @member {number|Long} finishedAtBlockHeight - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedAtBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * FinishedVoteInfo finishedAtCoreBlockHeight. - * @member {number} finishedAtCoreBlockHeight - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedAtCoreBlockHeight = 0; - - /** - * FinishedVoteInfo finishedAtBlockTimeMs. - * @member {number|Long} finishedAtBlockTimeMs - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedAtBlockTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * FinishedVoteInfo finishedAtEpoch. - * @member {number} finishedAtEpoch - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - */ - FinishedVoteInfo.prototype.finishedAtEpoch = 0; - - /** - * Creates a new FinishedVoteInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo instance - */ - FinishedVoteInfo.create = function create(properties) { - return new FinishedVoteInfo(properties); - }; - - /** - * Encodes the specified FinishedVoteInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FinishedVoteInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.finishedVoteOutcome != null && Object.hasOwnProperty.call(message, "finishedVoteOutcome")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.finishedVoteOutcome); - if (message.wonByIdentityId != null && Object.hasOwnProperty.call(message, "wonByIdentityId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.wonByIdentityId); - if (message.finishedAtBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtBlockHeight")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.finishedAtBlockHeight); - if (message.finishedAtCoreBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtCoreBlockHeight")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.finishedAtCoreBlockHeight); - if (message.finishedAtBlockTimeMs != null && Object.hasOwnProperty.call(message, "finishedAtBlockTimeMs")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.finishedAtBlockTimeMs); - if (message.finishedAtEpoch != null && Object.hasOwnProperty.call(message, "finishedAtEpoch")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.finishedAtEpoch); - return writer; - }; - - /** - * Encodes the specified FinishedVoteInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FinishedVoteInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FinishedVoteInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FinishedVoteInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.finishedVoteOutcome = reader.int32(); - break; - case 2: - message.wonByIdentityId = reader.bytes(); - break; - case 3: - message.finishedAtBlockHeight = reader.uint64(); - break; - case 4: - message.finishedAtCoreBlockHeight = reader.uint32(); - break; - case 5: - message.finishedAtBlockTimeMs = reader.uint64(); - break; - case 6: - message.finishedAtEpoch = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FinishedVoteInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FinishedVoteInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FinishedVoteInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FinishedVoteInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) - switch (message.finishedVoteOutcome) { - default: - return "finishedVoteOutcome: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) - if (!(message.wonByIdentityId && typeof message.wonByIdentityId.length === "number" || $util.isString(message.wonByIdentityId))) - return "wonByIdentityId: buffer expected"; - if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) - if (!$util.isInteger(message.finishedAtBlockHeight) && !(message.finishedAtBlockHeight && $util.isInteger(message.finishedAtBlockHeight.low) && $util.isInteger(message.finishedAtBlockHeight.high))) - return "finishedAtBlockHeight: integer|Long expected"; - if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) - if (!$util.isInteger(message.finishedAtCoreBlockHeight)) - return "finishedAtCoreBlockHeight: integer expected"; - if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) - if (!$util.isInteger(message.finishedAtBlockTimeMs) && !(message.finishedAtBlockTimeMs && $util.isInteger(message.finishedAtBlockTimeMs.low) && $util.isInteger(message.finishedAtBlockTimeMs.high))) - return "finishedAtBlockTimeMs: integer|Long expected"; - if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) - if (!$util.isInteger(message.finishedAtEpoch)) - return "finishedAtEpoch: integer expected"; - return null; - }; - - /** - * Creates a FinishedVoteInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo - */ - FinishedVoteInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); - switch (object.finishedVoteOutcome) { - case "TOWARDS_IDENTITY": - case 0: - message.finishedVoteOutcome = 0; - break; - case "LOCKED": - case 1: - message.finishedVoteOutcome = 1; - break; - case "NO_PREVIOUS_WINNER": - case 2: - message.finishedVoteOutcome = 2; - break; - } - if (object.wonByIdentityId != null) - if (typeof object.wonByIdentityId === "string") - $util.base64.decode(object.wonByIdentityId, message.wonByIdentityId = $util.newBuffer($util.base64.length(object.wonByIdentityId)), 0); - else if (object.wonByIdentityId.length >= 0) - message.wonByIdentityId = object.wonByIdentityId; - if (object.finishedAtBlockHeight != null) - if ($util.Long) - (message.finishedAtBlockHeight = $util.Long.fromValue(object.finishedAtBlockHeight)).unsigned = true; - else if (typeof object.finishedAtBlockHeight === "string") - message.finishedAtBlockHeight = parseInt(object.finishedAtBlockHeight, 10); - else if (typeof object.finishedAtBlockHeight === "number") - message.finishedAtBlockHeight = object.finishedAtBlockHeight; - else if (typeof object.finishedAtBlockHeight === "object") - message.finishedAtBlockHeight = new $util.LongBits(object.finishedAtBlockHeight.low >>> 0, object.finishedAtBlockHeight.high >>> 0).toNumber(true); - if (object.finishedAtCoreBlockHeight != null) - message.finishedAtCoreBlockHeight = object.finishedAtCoreBlockHeight >>> 0; - if (object.finishedAtBlockTimeMs != null) - if ($util.Long) - (message.finishedAtBlockTimeMs = $util.Long.fromValue(object.finishedAtBlockTimeMs)).unsigned = true; - else if (typeof object.finishedAtBlockTimeMs === "string") - message.finishedAtBlockTimeMs = parseInt(object.finishedAtBlockTimeMs, 10); - else if (typeof object.finishedAtBlockTimeMs === "number") - message.finishedAtBlockTimeMs = object.finishedAtBlockTimeMs; - else if (typeof object.finishedAtBlockTimeMs === "object") - message.finishedAtBlockTimeMs = new $util.LongBits(object.finishedAtBlockTimeMs.low >>> 0, object.finishedAtBlockTimeMs.high >>> 0).toNumber(true); - if (object.finishedAtEpoch != null) - message.finishedAtEpoch = object.finishedAtEpoch >>> 0; - return message; - }; - - /** - * Creates a plain object from a FinishedVoteInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} message FinishedVoteInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FinishedVoteInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.finishedVoteOutcome = options.enums === String ? "TOWARDS_IDENTITY" : 0; - if (options.bytes === String) - object.wonByIdentityId = ""; - else { - object.wonByIdentityId = []; - if (options.bytes !== Array) - object.wonByIdentityId = $util.newBuffer(object.wonByIdentityId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.finishedAtBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.finishedAtBlockHeight = options.longs === String ? "0" : 0; - object.finishedAtCoreBlockHeight = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.finishedAtBlockTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.finishedAtBlockTimeMs = options.longs === String ? "0" : 0; - object.finishedAtEpoch = 0; - } - if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) - object.finishedVoteOutcome = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome[message.finishedVoteOutcome] : message.finishedVoteOutcome; - if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) - object.wonByIdentityId = options.bytes === String ? $util.base64.encode(message.wonByIdentityId, 0, message.wonByIdentityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.wonByIdentityId) : message.wonByIdentityId; - if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) - if (typeof message.finishedAtBlockHeight === "number") - object.finishedAtBlockHeight = options.longs === String ? String(message.finishedAtBlockHeight) : message.finishedAtBlockHeight; - else - object.finishedAtBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockHeight) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockHeight.low >>> 0, message.finishedAtBlockHeight.high >>> 0).toNumber(true) : message.finishedAtBlockHeight; - if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) - object.finishedAtCoreBlockHeight = message.finishedAtCoreBlockHeight; - if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) - if (typeof message.finishedAtBlockTimeMs === "number") - object.finishedAtBlockTimeMs = options.longs === String ? String(message.finishedAtBlockTimeMs) : message.finishedAtBlockTimeMs; - else - object.finishedAtBlockTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockTimeMs) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockTimeMs.low >>> 0, message.finishedAtBlockTimeMs.high >>> 0).toNumber(true) : message.finishedAtBlockTimeMs; - if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) - object.finishedAtEpoch = message.finishedAtEpoch; - return object; - }; - - /** - * Converts this FinishedVoteInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo - * @instance - * @returns {Object.} JSON object - */ - FinishedVoteInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * FinishedVoteOutcome enum. - * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome - * @enum {number} - * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value - * @property {number} LOCKED=1 LOCKED value - * @property {number} NO_PREVIOUS_WINNER=2 NO_PREVIOUS_WINNER value - */ - FinishedVoteInfo.FinishedVoteOutcome = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; - values[valuesById[1] = "LOCKED"] = 1; - values[valuesById[2] = "NO_PREVIOUS_WINNER"] = 2; - return values; - })(); - - return FinishedVoteInfo; - })(); - - GetContestedResourceVoteStateResponseV0.ContestedResourceContenders = (function() { - - /** - * Properties of a ContestedResourceContenders. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @interface IContestedResourceContenders - * @property {Array.|null} [contenders] ContestedResourceContenders contenders - * @property {number|null} [abstainVoteTally] ContestedResourceContenders abstainVoteTally - * @property {number|null} [lockVoteTally] ContestedResourceContenders lockVoteTally - * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null} [finishedVoteInfo] ContestedResourceContenders finishedVoteInfo - */ - - /** - * Constructs a new ContestedResourceContenders. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @classdesc Represents a ContestedResourceContenders. - * @implements IContestedResourceContenders - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set - */ - function ContestedResourceContenders(properties) { - this.contenders = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceContenders contenders. - * @member {Array.} contenders - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - */ - ContestedResourceContenders.prototype.contenders = $util.emptyArray; - - /** - * ContestedResourceContenders abstainVoteTally. - * @member {number} abstainVoteTally - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - */ - ContestedResourceContenders.prototype.abstainVoteTally = 0; - - /** - * ContestedResourceContenders lockVoteTally. - * @member {number} lockVoteTally - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - */ - ContestedResourceContenders.prototype.lockVoteTally = 0; - - /** - * ContestedResourceContenders finishedVoteInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null|undefined} finishedVoteInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - */ - ContestedResourceContenders.prototype.finishedVoteInfo = null; - - /** - * Creates a new ContestedResourceContenders instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders instance - */ - ContestedResourceContenders.create = function create(properties) { - return new ContestedResourceContenders(properties); - }; - - /** - * Encodes the specified ContestedResourceContenders message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceContenders.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contenders != null && message.contenders.length) - for (var i = 0; i < message.contenders.length; ++i) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.encode(message.contenders[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.abstainVoteTally != null && Object.hasOwnProperty.call(message, "abstainVoteTally")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.abstainVoteTally); - if (message.lockVoteTally != null && Object.hasOwnProperty.call(message, "lockVoteTally")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.lockVoteTally); - if (message.finishedVoteInfo != null && Object.hasOwnProperty.call(message, "finishedVoteInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.encode(message.finishedVoteInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContestedResourceContenders message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceContenders.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceContenders message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceContenders.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.contenders && message.contenders.length)) - message.contenders = []; - message.contenders.push($root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.decode(reader, reader.uint32())); - break; - case 2: - message.abstainVoteTally = reader.uint32(); - break; - case 3: - message.lockVoteTally = reader.uint32(); - break; - case 4: - message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceContenders message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceContenders.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceContenders message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceContenders.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contenders != null && message.hasOwnProperty("contenders")) { - if (!Array.isArray(message.contenders)) - return "contenders: array expected"; - for (var i = 0; i < message.contenders.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify(message.contenders[i]); - if (error) - return "contenders." + error; - } - } - if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) - if (!$util.isInteger(message.abstainVoteTally)) - return "abstainVoteTally: integer expected"; - if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) - if (!$util.isInteger(message.lockVoteTally)) - return "lockVoteTally: integer expected"; - if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify(message.finishedVoteInfo); - if (error) - return "finishedVoteInfo." + error; - } - return null; - }; - - /** - * Creates a ContestedResourceContenders message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders - */ - ContestedResourceContenders.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); - if (object.contenders) { - if (!Array.isArray(object.contenders)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: array expected"); - message.contenders = []; - for (var i = 0; i < object.contenders.length; ++i) { - if (typeof object.contenders[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: object expected"); - message.contenders[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.fromObject(object.contenders[i]); - } - } - if (object.abstainVoteTally != null) - message.abstainVoteTally = object.abstainVoteTally >>> 0; - if (object.lockVoteTally != null) - message.lockVoteTally = object.lockVoteTally >>> 0; - if (object.finishedVoteInfo != null) { - if (typeof object.finishedVoteInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.finishedVoteInfo: object expected"); - message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.fromObject(object.finishedVoteInfo); - } - return message; - }; - - /** - * Creates a plain object from a ContestedResourceContenders message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} message ContestedResourceContenders - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceContenders.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.contenders = []; - if (options.defaults) { - object.abstainVoteTally = 0; - object.lockVoteTally = 0; - object.finishedVoteInfo = null; - } - if (message.contenders && message.contenders.length) { - object.contenders = []; - for (var j = 0; j < message.contenders.length; ++j) - object.contenders[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.toObject(message.contenders[j], options); - } - if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) - object.abstainVoteTally = message.abstainVoteTally; - if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) - object.lockVoteTally = message.lockVoteTally; - if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) - object.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.toObject(message.finishedVoteInfo, options); - return object; - }; - - /** - * Converts this ContestedResourceContenders to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceContenders.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceContenders; - })(); - - GetContestedResourceVoteStateResponseV0.Contender = (function() { - - /** - * Properties of a Contender. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @interface IContender - * @property {Uint8Array|null} [identifier] Contender identifier - * @property {number|null} [voteCount] Contender voteCount - * @property {Uint8Array|null} [document] Contender document - */ - - /** - * Constructs a new Contender. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 - * @classdesc Represents a Contender. - * @implements IContender - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set - */ - function Contender(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Contender identifier. - * @member {Uint8Array} identifier - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @instance - */ - Contender.prototype.identifier = $util.newBuffer([]); - - /** - * Contender voteCount. - * @member {number} voteCount - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @instance - */ - Contender.prototype.voteCount = 0; - - /** - * Contender document. - * @member {Uint8Array} document - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @instance - */ - Contender.prototype.document = $util.newBuffer([]); - - /** - * Creates a new Contender instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender instance - */ - Contender.create = function create(properties) { - return new Contender(properties); - }; - - /** - * Encodes the specified Contender message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Contender.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); - if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.document); - return writer; - }; - - /** - * Encodes the specified Contender message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Contender.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Contender message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Contender.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identifier = reader.bytes(); - break; - case 2: - message.voteCount = reader.uint32(); - break; - case 3: - message.document = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Contender message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Contender.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Contender message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Contender.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identifier != null && message.hasOwnProperty("identifier")) - if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) - return "identifier: buffer expected"; - if (message.voteCount != null && message.hasOwnProperty("voteCount")) - if (!$util.isInteger(message.voteCount)) - return "voteCount: integer expected"; - if (message.document != null && message.hasOwnProperty("document")) - if (!(message.document && typeof message.document.length === "number" || $util.isString(message.document))) - return "document: buffer expected"; - return null; - }; - - /** - * Creates a Contender message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender - */ - Contender.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); - if (object.identifier != null) - if (typeof object.identifier === "string") - $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); - else if (object.identifier.length >= 0) - message.identifier = object.identifier; - if (object.voteCount != null) - message.voteCount = object.voteCount >>> 0; - if (object.document != null) - if (typeof object.document === "string") - $util.base64.decode(object.document, message.document = $util.newBuffer($util.base64.length(object.document)), 0); - else if (object.document.length >= 0) - message.document = object.document; - return message; - }; - - /** - * Creates a plain object from a Contender message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} message Contender - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Contender.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identifier = ""; - else { - object.identifier = []; - if (options.bytes !== Array) - object.identifier = $util.newBuffer(object.identifier); - } - object.voteCount = 0; - if (options.bytes === String) - object.document = ""; - else { - object.document = []; - if (options.bytes !== Array) - object.document = $util.newBuffer(object.document); - } - } - if (message.identifier != null && message.hasOwnProperty("identifier")) - object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; - if (message.voteCount != null && message.hasOwnProperty("voteCount")) - object.voteCount = message.voteCount; - if (message.document != null && message.hasOwnProperty("document")) - object.document = options.bytes === String ? $util.base64.encode(message.document, 0, message.document.length) : options.bytes === Array ? Array.prototype.slice.call(message.document) : message.document; - return object; - }; - - /** - * Converts this Contender to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender - * @instance - * @returns {Object.} JSON object - */ - Contender.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Contender; - })(); - - return GetContestedResourceVoteStateResponseV0; - })(); - - return GetContestedResourceVoteStateResponse; - })(); - - v0.GetContestedResourceVotersForIdentityRequest = (function() { - - /** - * Properties of a GetContestedResourceVotersForIdentityRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceVotersForIdentityRequest - * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null} [v0] GetContestedResourceVotersForIdentityRequest v0 - */ - - /** - * Constructs a new GetContestedResourceVotersForIdentityRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceVotersForIdentityRequest. - * @implements IGetContestedResourceVotersForIdentityRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set - */ - function GetContestedResourceVotersForIdentityRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVotersForIdentityRequest v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @instance - */ - GetContestedResourceVotersForIdentityRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVotersForIdentityRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @instance - */ - Object.defineProperty(GetContestedResourceVotersForIdentityRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVotersForIdentityRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest instance - */ - GetContestedResourceVotersForIdentityRequest.create = function create(properties) { - return new GetContestedResourceVotersForIdentityRequest(properties); - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVotersForIdentityRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVotersForIdentityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceVotersForIdentityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest - */ - GetContestedResourceVotersForIdentityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVotersForIdentityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVotersForIdentityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceVotersForIdentityRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVotersForIdentityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 = (function() { - - /** - * Properties of a GetContestedResourceVotersForIdentityRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @interface IGetContestedResourceVotersForIdentityRequestV0 - * @property {Uint8Array|null} [contractId] GetContestedResourceVotersForIdentityRequestV0 contractId - * @property {string|null} [documentTypeName] GetContestedResourceVotersForIdentityRequestV0 documentTypeName - * @property {string|null} [indexName] GetContestedResourceVotersForIdentityRequestV0 indexName - * @property {Array.|null} [indexValues] GetContestedResourceVotersForIdentityRequestV0 indexValues - * @property {Uint8Array|null} [contestantId] GetContestedResourceVotersForIdentityRequestV0 contestantId - * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo - * @property {number|null} [count] GetContestedResourceVotersForIdentityRequestV0 count - * @property {boolean|null} [orderAscending] GetContestedResourceVotersForIdentityRequestV0 orderAscending - * @property {boolean|null} [prove] GetContestedResourceVotersForIdentityRequestV0 prove - */ - - /** - * Constructs a new GetContestedResourceVotersForIdentityRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest - * @classdesc Represents a GetContestedResourceVotersForIdentityRequestV0. - * @implements IGetContestedResourceVotersForIdentityRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set - */ - function GetContestedResourceVotersForIdentityRequestV0(properties) { - this.indexValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVotersForIdentityRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetContestedResourceVotersForIdentityRequestV0 documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.documentTypeName = ""; - - /** - * GetContestedResourceVotersForIdentityRequestV0 indexName. - * @member {string} indexName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.indexName = ""; - - /** - * GetContestedResourceVotersForIdentityRequestV0 indexValues. - * @member {Array.} indexValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.indexValues = $util.emptyArray; - - /** - * GetContestedResourceVotersForIdentityRequestV0 contestantId. - * @member {Uint8Array} contestantId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.contestantId = $util.newBuffer([]); - - /** - * GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.startAtIdentifierInfo = null; - - /** - * GetContestedResourceVotersForIdentityRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.count = 0; - - /** - * GetContestedResourceVotersForIdentityRequestV0 orderAscending. - * @member {boolean} orderAscending - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.orderAscending = false; - - /** - * GetContestedResourceVotersForIdentityRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.prove = false; - - /** - * Creates a new GetContestedResourceVotersForIdentityRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 instance - */ - GetContestedResourceVotersForIdentityRequestV0.create = function create(properties) { - return new GetContestedResourceVotersForIdentityRequestV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); - if (message.indexValues != null && message.indexValues.length) - for (var i = 0; i < message.indexValues.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); - if (message.contestantId != null && Object.hasOwnProperty.call(message, "contestantId")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.contestantId); - if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); - if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - message.indexName = reader.string(); - break; - case 4: - if (!(message.indexValues && message.indexValues.length)) - message.indexValues = []; - message.indexValues.push(reader.bytes()); - break; - case 5: - message.contestantId = reader.bytes(); - break; - case 6: - message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); - break; - case 7: - message.count = reader.uint32(); - break; - case 8: - message.orderAscending = reader.bool(); - break; - case 9: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVotersForIdentityRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVotersForIdentityRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.indexName != null && message.hasOwnProperty("indexName")) - if (!$util.isString(message.indexName)) - return "indexName: string expected"; - if (message.indexValues != null && message.hasOwnProperty("indexValues")) { - if (!Array.isArray(message.indexValues)) - return "indexValues: array expected"; - for (var i = 0; i < message.indexValues.length; ++i) - if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) - return "indexValues: buffer[] expected"; - } - if (message.contestantId != null && message.hasOwnProperty("contestantId")) - if (!(message.contestantId && typeof message.contestantId.length === "number" || $util.isString(message.contestantId))) - return "contestantId: buffer expected"; - if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); - if (error) - return "startAtIdentifierInfo." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - if (typeof message.orderAscending !== "boolean") - return "orderAscending: boolean expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetContestedResourceVotersForIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 - */ - GetContestedResourceVotersForIdentityRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.indexName != null) - message.indexName = String(object.indexName); - if (object.indexValues) { - if (!Array.isArray(object.indexValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.indexValues: array expected"); - message.indexValues = []; - for (var i = 0; i < object.indexValues.length; ++i) - if (typeof object.indexValues[i] === "string") - $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); - else if (object.indexValues[i].length >= 0) - message.indexValues[i] = object.indexValues[i]; - } - if (object.contestantId != null) - if (typeof object.contestantId === "string") - $util.base64.decode(object.contestantId, message.contestantId = $util.newBuffer($util.base64.length(object.contestantId)), 0); - else if (object.contestantId.length >= 0) - message.contestantId = object.contestantId; - if (object.startAtIdentifierInfo != null) { - if (typeof object.startAtIdentifierInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.startAtIdentifierInfo: object expected"); - message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.orderAscending != null) - message.orderAscending = Boolean(object.orderAscending); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVotersForIdentityRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVotersForIdentityRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexValues = []; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.indexName = ""; - if (options.bytes === String) - object.contestantId = ""; - else { - object.contestantId = []; - if (options.bytes !== Array) - object.contestantId = $util.newBuffer(object.contestantId); - } - object.startAtIdentifierInfo = null; - object.count = 0; - object.orderAscending = false; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.indexName != null && message.hasOwnProperty("indexName")) - object.indexName = message.indexName; - if (message.indexValues && message.indexValues.length) { - object.indexValues = []; - for (var j = 0; j < message.indexValues.length; ++j) - object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; - } - if (message.contestantId != null && message.hasOwnProperty("contestantId")) - object.contestantId = options.bytes === String ? $util.base64.encode(message.contestantId, 0, message.contestantId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contestantId) : message.contestantId; - if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) - object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - object.orderAscending = message.orderAscending; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetContestedResourceVotersForIdentityRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVotersForIdentityRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo = (function() { - - /** - * Properties of a StartAtIdentifierInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @interface IStartAtIdentifierInfo - * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier - * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded - */ - - /** - * Constructs a new StartAtIdentifierInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 - * @classdesc Represents a StartAtIdentifierInfo. - * @implements IStartAtIdentifierInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set - */ - function StartAtIdentifierInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtIdentifierInfo startIdentifier. - * @member {Uint8Array} startIdentifier - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @instance - */ - StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); - - /** - * StartAtIdentifierInfo startIdentifierIncluded. - * @member {boolean} startIdentifierIncluded - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @instance - */ - StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; - - /** - * Creates a new StartAtIdentifierInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance - */ - StartAtIdentifierInfo.create = function create(properties) { - return new StartAtIdentifierInfo(properties); - }; - - /** - * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtIdentifierInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); - if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtIdentifierInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startIdentifier = reader.bytes(); - break; - case 2: - message.startIdentifierIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtIdentifierInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtIdentifierInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) - if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) - return "startIdentifier: buffer expected"; - if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) - if (typeof message.startIdentifierIncluded !== "boolean") - return "startIdentifierIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo - */ - StartAtIdentifierInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); - if (object.startIdentifier != null) - if (typeof object.startIdentifier === "string") - $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); - else if (object.startIdentifier.length >= 0) - message.startIdentifier = object.startIdentifier; - if (object.startIdentifierIncluded != null) - message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtIdentifierInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startIdentifier = ""; - else { - object.startIdentifier = []; - if (options.bytes !== Array) - object.startIdentifier = $util.newBuffer(object.startIdentifier); - } - object.startIdentifierIncluded = false; - } - if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) - object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; - if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) - object.startIdentifierIncluded = message.startIdentifierIncluded; - return object; - }; - - /** - * Converts this StartAtIdentifierInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtIdentifierInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtIdentifierInfo; - })(); - - return GetContestedResourceVotersForIdentityRequestV0; - })(); - - return GetContestedResourceVotersForIdentityRequest; - })(); - - v0.GetContestedResourceVotersForIdentityResponse = (function() { - - /** - * Properties of a GetContestedResourceVotersForIdentityResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceVotersForIdentityResponse - * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null} [v0] GetContestedResourceVotersForIdentityResponse v0 - */ - - /** - * Constructs a new GetContestedResourceVotersForIdentityResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceVotersForIdentityResponse. - * @implements IGetContestedResourceVotersForIdentityResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set - */ - function GetContestedResourceVotersForIdentityResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVotersForIdentityResponse v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @instance - */ - GetContestedResourceVotersForIdentityResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVotersForIdentityResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @instance - */ - Object.defineProperty(GetContestedResourceVotersForIdentityResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVotersForIdentityResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse instance - */ - GetContestedResourceVotersForIdentityResponse.create = function create(properties) { - return new GetContestedResourceVotersForIdentityResponse(properties); - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVotersForIdentityResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVotersForIdentityResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceVotersForIdentityResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse - */ - GetContestedResourceVotersForIdentityResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVotersForIdentityResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVotersForIdentityResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceVotersForIdentityResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVotersForIdentityResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 = (function() { - - /** - * Properties of a GetContestedResourceVotersForIdentityResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @interface IGetContestedResourceVotersForIdentityResponseV0 - * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null} [contestedResourceVoters] GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVotersForIdentityResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVotersForIdentityResponseV0 metadata - */ - - /** - * Constructs a new GetContestedResourceVotersForIdentityResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse - * @classdesc Represents a GetContestedResourceVotersForIdentityResponseV0. - * @implements IGetContestedResourceVotersForIdentityResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set - */ - function GetContestedResourceVotersForIdentityResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters. - * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null|undefined} contestedResourceVoters - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - */ - GetContestedResourceVotersForIdentityResponseV0.prototype.contestedResourceVoters = null; - - /** - * GetContestedResourceVotersForIdentityResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - */ - GetContestedResourceVotersForIdentityResponseV0.prototype.proof = null; - - /** - * GetContestedResourceVotersForIdentityResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - */ - GetContestedResourceVotersForIdentityResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceVotersForIdentityResponseV0 result. - * @member {"contestedResourceVoters"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - */ - Object.defineProperty(GetContestedResourceVotersForIdentityResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["contestedResourceVoters", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceVotersForIdentityResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 instance - */ - GetContestedResourceVotersForIdentityResponseV0.create = function create(properties) { - return new GetContestedResourceVotersForIdentityResponseV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceVoters != null && Object.hasOwnProperty.call(message, "contestedResourceVoters")) - $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.encode(message.contestedResourceVoters, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceVotersForIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceVotersForIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceVotersForIdentityResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceVotersForIdentityResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify(message.contestedResourceVoters); - if (error) - return "contestedResourceVoters." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetContestedResourceVotersForIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 - */ - GetContestedResourceVotersForIdentityResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); - if (object.contestedResourceVoters != null) { - if (typeof object.contestedResourceVoters !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.contestedResourceVoters: object expected"); - message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.fromObject(object.contestedResourceVoters); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceVotersForIdentityResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceVotersForIdentityResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { - object.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.toObject(message.contestedResourceVoters, options); - if (options.oneofs) - object.result = "contestedResourceVoters"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetContestedResourceVotersForIdentityResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceVotersForIdentityResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters = (function() { - - /** - * Properties of a ContestedResourceVoters. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @interface IContestedResourceVoters - * @property {Array.|null} [voters] ContestedResourceVoters voters - * @property {boolean|null} [finishedResults] ContestedResourceVoters finishedResults - */ - - /** - * Constructs a new ContestedResourceVoters. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 - * @classdesc Represents a ContestedResourceVoters. - * @implements IContestedResourceVoters - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set - */ - function ContestedResourceVoters(properties) { - this.voters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceVoters voters. - * @member {Array.} voters - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @instance - */ - ContestedResourceVoters.prototype.voters = $util.emptyArray; - - /** - * ContestedResourceVoters finishedResults. - * @member {boolean} finishedResults - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @instance - */ - ContestedResourceVoters.prototype.finishedResults = false; - - /** - * Creates a new ContestedResourceVoters instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters instance - */ - ContestedResourceVoters.create = function create(properties) { - return new ContestedResourceVoters(properties); - }; - - /** - * Encodes the specified ContestedResourceVoters message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceVoters.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voters != null && message.voters.length) - for (var i = 0; i < message.voters.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.voters[i]); - if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); - return writer; - }; - - /** - * Encodes the specified ContestedResourceVoters message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceVoters.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceVoters message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceVoters.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.voters && message.voters.length)) - message.voters = []; - message.voters.push(reader.bytes()); - break; - case 2: - message.finishedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceVoters message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceVoters.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceVoters message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceVoters.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voters != null && message.hasOwnProperty("voters")) { - if (!Array.isArray(message.voters)) - return "voters: array expected"; - for (var i = 0; i < message.voters.length; ++i) - if (!(message.voters[i] && typeof message.voters[i].length === "number" || $util.isString(message.voters[i]))) - return "voters: buffer[] expected"; - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - if (typeof message.finishedResults !== "boolean") - return "finishedResults: boolean expected"; - return null; - }; - - /** - * Creates a ContestedResourceVoters message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters - */ - ContestedResourceVoters.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); - if (object.voters) { - if (!Array.isArray(object.voters)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.voters: array expected"); - message.voters = []; - for (var i = 0; i < object.voters.length; ++i) - if (typeof object.voters[i] === "string") - $util.base64.decode(object.voters[i], message.voters[i] = $util.newBuffer($util.base64.length(object.voters[i])), 0); - else if (object.voters[i].length >= 0) - message.voters[i] = object.voters[i]; - } - if (object.finishedResults != null) - message.finishedResults = Boolean(object.finishedResults); - return message; - }; - - /** - * Creates a plain object from a ContestedResourceVoters message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} message ContestedResourceVoters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceVoters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.voters = []; - if (options.defaults) - object.finishedResults = false; - if (message.voters && message.voters.length) { - object.voters = []; - for (var j = 0; j < message.voters.length; ++j) - object.voters[j] = options.bytes === String ? $util.base64.encode(message.voters[j], 0, message.voters[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.voters[j]) : message.voters[j]; - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - object.finishedResults = message.finishedResults; - return object; - }; - - /** - * Converts this ContestedResourceVoters to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceVoters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceVoters; - })(); - - return GetContestedResourceVotersForIdentityResponseV0; - })(); - - return GetContestedResourceVotersForIdentityResponse; - })(); - - v0.GetContestedResourceIdentityVotesRequest = (function() { - - /** - * Properties of a GetContestedResourceIdentityVotesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceIdentityVotesRequest - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null} [v0] GetContestedResourceIdentityVotesRequest v0 - */ - - /** - * Constructs a new GetContestedResourceIdentityVotesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceIdentityVotesRequest. - * @implements IGetContestedResourceIdentityVotesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set - */ - function GetContestedResourceIdentityVotesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceIdentityVotesRequest v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @instance - */ - GetContestedResourceIdentityVotesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceIdentityVotesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @instance - */ - Object.defineProperty(GetContestedResourceIdentityVotesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceIdentityVotesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest instance - */ - GetContestedResourceIdentityVotesRequest.create = function create(properties) { - return new GetContestedResourceIdentityVotesRequest(properties); - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceIdentityVotesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceIdentityVotesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceIdentityVotesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest - */ - GetContestedResourceIdentityVotesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceIdentityVotesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceIdentityVotesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceIdentityVotesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceIdentityVotesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 = (function() { - - /** - * Properties of a GetContestedResourceIdentityVotesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @interface IGetContestedResourceIdentityVotesRequestV0 - * @property {Uint8Array|null} [identityId] GetContestedResourceIdentityVotesRequestV0 identityId - * @property {google.protobuf.IUInt32Value|null} [limit] GetContestedResourceIdentityVotesRequestV0 limit - * @property {google.protobuf.IUInt32Value|null} [offset] GetContestedResourceIdentityVotesRequestV0 offset - * @property {boolean|null} [orderAscending] GetContestedResourceIdentityVotesRequestV0 orderAscending - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null} [startAtVotePollIdInfo] GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo - * @property {boolean|null} [prove] GetContestedResourceIdentityVotesRequestV0 prove - */ - - /** - * Constructs a new GetContestedResourceIdentityVotesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest - * @classdesc Represents a GetContestedResourceIdentityVotesRequestV0. - * @implements IGetContestedResourceIdentityVotesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set - */ - function GetContestedResourceIdentityVotesRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceIdentityVotesRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetContestedResourceIdentityVotesRequestV0 limit. - * @member {google.protobuf.IUInt32Value|null|undefined} limit - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.limit = null; - - /** - * GetContestedResourceIdentityVotesRequestV0 offset. - * @member {google.protobuf.IUInt32Value|null|undefined} offset - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.offset = null; - - /** - * GetContestedResourceIdentityVotesRequestV0 orderAscending. - * @member {boolean} orderAscending - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.orderAscending = false; - - /** - * GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null|undefined} startAtVotePollIdInfo - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.startAtVotePollIdInfo = null; - - /** - * GetContestedResourceIdentityVotesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - */ - GetContestedResourceIdentityVotesRequestV0.prototype.prove = false; - - /** - * Creates a new GetContestedResourceIdentityVotesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 instance - */ - GetContestedResourceIdentityVotesRequestV0.create = function create(properties) { - return new GetContestedResourceIdentityVotesRequestV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.orderAscending); - if (message.startAtVotePollIdInfo != null && Object.hasOwnProperty.call(message, "startAtVotePollIdInfo")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.encode(message.startAtVotePollIdInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 3: - message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); - break; - case 4: - message.orderAscending = reader.bool(); - break; - case 5: - message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.decode(reader, reader.uint32()); - break; - case 6: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceIdentityVotesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceIdentityVotesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.UInt32Value.verify(message.limit); - if (error) - return "limit." + error; - } - if (message.offset != null && message.hasOwnProperty("offset")) { - var error = $root.google.protobuf.UInt32Value.verify(message.offset); - if (error) - return "offset." + error; - } - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - if (typeof message.orderAscending !== "boolean") - return "orderAscending: boolean expected"; - if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify(message.startAtVotePollIdInfo); - if (error) - return "startAtVotePollIdInfo." + error; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetContestedResourceIdentityVotesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 - */ - GetContestedResourceIdentityVotesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.limit: object expected"); - message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); - } - if (object.offset != null) { - if (typeof object.offset !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.offset: object expected"); - message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); - } - if (object.orderAscending != null) - message.orderAscending = Boolean(object.orderAscending); - if (object.startAtVotePollIdInfo != null) { - if (typeof object.startAtVotePollIdInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.startAtVotePollIdInfo: object expected"); - message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.fromObject(object.startAtVotePollIdInfo); - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceIdentityVotesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceIdentityVotesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.limit = null; - object.offset = null; - object.orderAscending = false; - object.startAtVotePollIdInfo = null; - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); - if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) - object.orderAscending = message.orderAscending; - if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) - object.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.toObject(message.startAtVotePollIdInfo, options); - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetContestedResourceIdentityVotesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceIdentityVotesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo = (function() { - - /** - * Properties of a StartAtVotePollIdInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @interface IStartAtVotePollIdInfo - * @property {Uint8Array|null} [startAtPollIdentifier] StartAtVotePollIdInfo startAtPollIdentifier - * @property {boolean|null} [startPollIdentifierIncluded] StartAtVotePollIdInfo startPollIdentifierIncluded - */ - - /** - * Constructs a new StartAtVotePollIdInfo. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 - * @classdesc Represents a StartAtVotePollIdInfo. - * @implements IStartAtVotePollIdInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set - */ - function StartAtVotePollIdInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtVotePollIdInfo startAtPollIdentifier. - * @member {Uint8Array} startAtPollIdentifier - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @instance - */ - StartAtVotePollIdInfo.prototype.startAtPollIdentifier = $util.newBuffer([]); - - /** - * StartAtVotePollIdInfo startPollIdentifierIncluded. - * @member {boolean} startPollIdentifierIncluded - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @instance - */ - StartAtVotePollIdInfo.prototype.startPollIdentifierIncluded = false; - - /** - * Creates a new StartAtVotePollIdInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo instance - */ - StartAtVotePollIdInfo.create = function create(properties) { - return new StartAtVotePollIdInfo(properties); - }; - - /** - * Encodes the specified StartAtVotePollIdInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtVotePollIdInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startAtPollIdentifier != null && Object.hasOwnProperty.call(message, "startAtPollIdentifier")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startAtPollIdentifier); - if (message.startPollIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startPollIdentifierIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startPollIdentifierIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtVotePollIdInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtVotePollIdInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtVotePollIdInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startAtPollIdentifier = reader.bytes(); - break; - case 2: - message.startPollIdentifierIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtVotePollIdInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtVotePollIdInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtVotePollIdInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) - if (!(message.startAtPollIdentifier && typeof message.startAtPollIdentifier.length === "number" || $util.isString(message.startAtPollIdentifier))) - return "startAtPollIdentifier: buffer expected"; - if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) - if (typeof message.startPollIdentifierIncluded !== "boolean") - return "startPollIdentifierIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtVotePollIdInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo - */ - StartAtVotePollIdInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); - if (object.startAtPollIdentifier != null) - if (typeof object.startAtPollIdentifier === "string") - $util.base64.decode(object.startAtPollIdentifier, message.startAtPollIdentifier = $util.newBuffer($util.base64.length(object.startAtPollIdentifier)), 0); - else if (object.startAtPollIdentifier.length >= 0) - message.startAtPollIdentifier = object.startAtPollIdentifier; - if (object.startPollIdentifierIncluded != null) - message.startPollIdentifierIncluded = Boolean(object.startPollIdentifierIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtVotePollIdInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} message StartAtVotePollIdInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtVotePollIdInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startAtPollIdentifier = ""; - else { - object.startAtPollIdentifier = []; - if (options.bytes !== Array) - object.startAtPollIdentifier = $util.newBuffer(object.startAtPollIdentifier); - } - object.startPollIdentifierIncluded = false; - } - if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) - object.startAtPollIdentifier = options.bytes === String ? $util.base64.encode(message.startAtPollIdentifier, 0, message.startAtPollIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAtPollIdentifier) : message.startAtPollIdentifier; - if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) - object.startPollIdentifierIncluded = message.startPollIdentifierIncluded; - return object; - }; - - /** - * Converts this StartAtVotePollIdInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtVotePollIdInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtVotePollIdInfo; - })(); - - return GetContestedResourceIdentityVotesRequestV0; - })(); - - return GetContestedResourceIdentityVotesRequest; - })(); - - v0.GetContestedResourceIdentityVotesResponse = (function() { - - /** - * Properties of a GetContestedResourceIdentityVotesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetContestedResourceIdentityVotesResponse - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null} [v0] GetContestedResourceIdentityVotesResponse v0 - */ - - /** - * Constructs a new GetContestedResourceIdentityVotesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetContestedResourceIdentityVotesResponse. - * @implements IGetContestedResourceIdentityVotesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set - */ - function GetContestedResourceIdentityVotesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceIdentityVotesResponse v0. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @instance - */ - GetContestedResourceIdentityVotesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceIdentityVotesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @instance - */ - Object.defineProperty(GetContestedResourceIdentityVotesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceIdentityVotesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse instance - */ - GetContestedResourceIdentityVotesResponse.create = function create(properties) { - return new GetContestedResourceIdentityVotesResponse(properties); - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceIdentityVotesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceIdentityVotesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetContestedResourceIdentityVotesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse - */ - GetContestedResourceIdentityVotesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceIdentityVotesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceIdentityVotesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetContestedResourceIdentityVotesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceIdentityVotesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 = (function() { - - /** - * Properties of a GetContestedResourceIdentityVotesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @interface IGetContestedResourceIdentityVotesResponseV0 - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null} [votes] GetContestedResourceIdentityVotesResponseV0 votes - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceIdentityVotesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceIdentityVotesResponseV0 metadata - */ - - /** - * Constructs a new GetContestedResourceIdentityVotesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse - * @classdesc Represents a GetContestedResourceIdentityVotesResponseV0. - * @implements IGetContestedResourceIdentityVotesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set - */ - function GetContestedResourceIdentityVotesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetContestedResourceIdentityVotesResponseV0 votes. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null|undefined} votes - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - */ - GetContestedResourceIdentityVotesResponseV0.prototype.votes = null; - - /** - * GetContestedResourceIdentityVotesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - */ - GetContestedResourceIdentityVotesResponseV0.prototype.proof = null; - - /** - * GetContestedResourceIdentityVotesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - */ - GetContestedResourceIdentityVotesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetContestedResourceIdentityVotesResponseV0 result. - * @member {"votes"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - */ - Object.defineProperty(GetContestedResourceIdentityVotesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["votes", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetContestedResourceIdentityVotesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 instance - */ - GetContestedResourceIdentityVotesResponseV0.create = function create(properties) { - return new GetContestedResourceIdentityVotesResponseV0(properties); - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.votes != null && Object.hasOwnProperty.call(message, "votes")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.encode(message.votes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetContestedResourceIdentityVotesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetContestedResourceIdentityVotesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetContestedResourceIdentityVotesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetContestedResourceIdentityVotesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.votes != null && message.hasOwnProperty("votes")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify(message.votes); - if (error) - return "votes." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetContestedResourceIdentityVotesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 - */ - GetContestedResourceIdentityVotesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); - if (object.votes != null) { - if (typeof object.votes !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.votes: object expected"); - message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.fromObject(object.votes); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetContestedResourceIdentityVotesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetContestedResourceIdentityVotesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.votes != null && message.hasOwnProperty("votes")) { - object.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.toObject(message.votes, options); - if (options.oneofs) - object.result = "votes"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetContestedResourceIdentityVotesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetContestedResourceIdentityVotesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes = (function() { - - /** - * Properties of a ContestedResourceIdentityVotes. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @interface IContestedResourceIdentityVotes - * @property {Array.|null} [contestedResourceIdentityVotes] ContestedResourceIdentityVotes contestedResourceIdentityVotes - * @property {boolean|null} [finishedResults] ContestedResourceIdentityVotes finishedResults - */ - - /** - * Constructs a new ContestedResourceIdentityVotes. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @classdesc Represents a ContestedResourceIdentityVotes. - * @implements IContestedResourceIdentityVotes - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set - */ - function ContestedResourceIdentityVotes(properties) { - this.contestedResourceIdentityVotes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceIdentityVotes contestedResourceIdentityVotes. - * @member {Array.} contestedResourceIdentityVotes - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @instance - */ - ContestedResourceIdentityVotes.prototype.contestedResourceIdentityVotes = $util.emptyArray; - - /** - * ContestedResourceIdentityVotes finishedResults. - * @member {boolean} finishedResults - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @instance - */ - ContestedResourceIdentityVotes.prototype.finishedResults = false; - - /** - * Creates a new ContestedResourceIdentityVotes instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes instance - */ - ContestedResourceIdentityVotes.create = function create(properties) { - return new ContestedResourceIdentityVotes(properties); - }; - - /** - * Encodes the specified ContestedResourceIdentityVotes message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceIdentityVotes.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contestedResourceIdentityVotes != null && message.contestedResourceIdentityVotes.length) - for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.encode(message.contestedResourceIdentityVotes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); - return writer; - }; - - /** - * Encodes the specified ContestedResourceIdentityVotes message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceIdentityVotes.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceIdentityVotes.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length)) - message.contestedResourceIdentityVotes = []; - message.contestedResourceIdentityVotes.push($root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.decode(reader, reader.uint32())); - break; - case 2: - message.finishedResults = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceIdentityVotes.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceIdentityVotes message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceIdentityVotes.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contestedResourceIdentityVotes != null && message.hasOwnProperty("contestedResourceIdentityVotes")) { - if (!Array.isArray(message.contestedResourceIdentityVotes)) - return "contestedResourceIdentityVotes: array expected"; - for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify(message.contestedResourceIdentityVotes[i]); - if (error) - return "contestedResourceIdentityVotes." + error; - } - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - if (typeof message.finishedResults !== "boolean") - return "finishedResults: boolean expected"; - return null; - }; - - /** - * Creates a ContestedResourceIdentityVotes message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes - */ - ContestedResourceIdentityVotes.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); - if (object.contestedResourceIdentityVotes) { - if (!Array.isArray(object.contestedResourceIdentityVotes)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: array expected"); - message.contestedResourceIdentityVotes = []; - for (var i = 0; i < object.contestedResourceIdentityVotes.length; ++i) { - if (typeof object.contestedResourceIdentityVotes[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: object expected"); - message.contestedResourceIdentityVotes[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.fromObject(object.contestedResourceIdentityVotes[i]); - } - } - if (object.finishedResults != null) - message.finishedResults = Boolean(object.finishedResults); - return message; - }; - - /** - * Creates a plain object from a ContestedResourceIdentityVotes message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} message ContestedResourceIdentityVotes - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceIdentityVotes.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.contestedResourceIdentityVotes = []; - if (options.defaults) - object.finishedResults = false; - if (message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length) { - object.contestedResourceIdentityVotes = []; - for (var j = 0; j < message.contestedResourceIdentityVotes.length; ++j) - object.contestedResourceIdentityVotes[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.toObject(message.contestedResourceIdentityVotes[j], options); - } - if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) - object.finishedResults = message.finishedResults; - return object; - }; - - /** - * Converts this ContestedResourceIdentityVotes to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceIdentityVotes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceIdentityVotes; - })(); - - GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice = (function() { - - /** - * Properties of a ResourceVoteChoice. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @interface IResourceVoteChoice - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType|null} [voteChoiceType] ResourceVoteChoice voteChoiceType - * @property {Uint8Array|null} [identityId] ResourceVoteChoice identityId - */ - - /** - * Constructs a new ResourceVoteChoice. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @classdesc Represents a ResourceVoteChoice. - * @implements IResourceVoteChoice - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set - */ - function ResourceVoteChoice(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceVoteChoice voteChoiceType. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType} voteChoiceType - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @instance - */ - ResourceVoteChoice.prototype.voteChoiceType = 0; - - /** - * ResourceVoteChoice identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @instance - */ - ResourceVoteChoice.prototype.identityId = $util.newBuffer([]); - - /** - * Creates a new ResourceVoteChoice instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice instance - */ - ResourceVoteChoice.create = function create(properties) { - return new ResourceVoteChoice(properties); - }; - - /** - * Encodes the specified ResourceVoteChoice message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceVoteChoice.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voteChoiceType != null && Object.hasOwnProperty.call(message, "voteChoiceType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.voteChoiceType); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityId); - return writer; - }; - - /** - * Encodes the specified ResourceVoteChoice message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceVoteChoice.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceVoteChoice message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceVoteChoice.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.voteChoiceType = reader.int32(); - break; - case 2: - message.identityId = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceVoteChoice message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceVoteChoice.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceVoteChoice message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceVoteChoice.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) - switch (message.voteChoiceType) { - default: - return "voteChoiceType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - return null; - }; - - /** - * Creates a ResourceVoteChoice message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice - */ - ResourceVoteChoice.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); - switch (object.voteChoiceType) { - case "TOWARDS_IDENTITY": - case 0: - message.voteChoiceType = 0; - break; - case "ABSTAIN": - case 1: - message.voteChoiceType = 1; - break; - case "LOCK": - case 2: - message.voteChoiceType = 2; - break; - } - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - return message; - }; - - /** - * Creates a plain object from a ResourceVoteChoice message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} message ResourceVoteChoice - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceVoteChoice.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.voteChoiceType = options.enums === String ? "TOWARDS_IDENTITY" : 0; - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - } - if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) - object.voteChoiceType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType[message.voteChoiceType] : message.voteChoiceType; - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - return object; - }; - - /** - * Converts this ResourceVoteChoice to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice - * @instance - * @returns {Object.} JSON object - */ - ResourceVoteChoice.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * VoteChoiceType enum. - * @name org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType - * @enum {number} - * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value - * @property {number} ABSTAIN=1 ABSTAIN value - * @property {number} LOCK=2 LOCK value - */ - ResourceVoteChoice.VoteChoiceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; - values[valuesById[1] = "ABSTAIN"] = 1; - values[valuesById[2] = "LOCK"] = 2; - return values; - })(); - - return ResourceVoteChoice; - })(); - - GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote = (function() { - - /** - * Properties of a ContestedResourceIdentityVote. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @interface IContestedResourceIdentityVote - * @property {Uint8Array|null} [contractId] ContestedResourceIdentityVote contractId - * @property {string|null} [documentTypeName] ContestedResourceIdentityVote documentTypeName - * @property {Array.|null} [serializedIndexStorageValues] ContestedResourceIdentityVote serializedIndexStorageValues - * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null} [voteChoice] ContestedResourceIdentityVote voteChoice - */ - - /** - * Constructs a new ContestedResourceIdentityVote. - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 - * @classdesc Represents a ContestedResourceIdentityVote. - * @implements IContestedResourceIdentityVote - * @constructor - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set - */ - function ContestedResourceIdentityVote(properties) { - this.serializedIndexStorageValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContestedResourceIdentityVote contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - */ - ContestedResourceIdentityVote.prototype.contractId = $util.newBuffer([]); - - /** - * ContestedResourceIdentityVote documentTypeName. - * @member {string} documentTypeName - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - */ - ContestedResourceIdentityVote.prototype.documentTypeName = ""; - - /** - * ContestedResourceIdentityVote serializedIndexStorageValues. - * @member {Array.} serializedIndexStorageValues - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - */ - ContestedResourceIdentityVote.prototype.serializedIndexStorageValues = $util.emptyArray; - - /** - * ContestedResourceIdentityVote voteChoice. - * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null|undefined} voteChoice - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - */ - ContestedResourceIdentityVote.prototype.voteChoice = null; - - /** - * Creates a new ContestedResourceIdentityVote instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote instance - */ - ContestedResourceIdentityVote.create = function create(properties) { - return new ContestedResourceIdentityVote(properties); - }; - - /** - * Encodes the specified ContestedResourceIdentityVote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceIdentityVote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); - if (message.serializedIndexStorageValues != null && message.serializedIndexStorageValues.length) - for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.serializedIndexStorageValues[i]); - if (message.voteChoice != null && Object.hasOwnProperty.call(message, "voteChoice")) - $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.encode(message.voteChoice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContestedResourceIdentityVote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContestedResourceIdentityVote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceIdentityVote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.documentTypeName = reader.string(); - break; - case 3: - if (!(message.serializedIndexStorageValues && message.serializedIndexStorageValues.length)) - message.serializedIndexStorageValues = []; - message.serializedIndexStorageValues.push(reader.bytes()); - break; - case 4: - message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContestedResourceIdentityVote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContestedResourceIdentityVote message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContestedResourceIdentityVote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - if (!$util.isString(message.documentTypeName)) - return "documentTypeName: string expected"; - if (message.serializedIndexStorageValues != null && message.hasOwnProperty("serializedIndexStorageValues")) { - if (!Array.isArray(message.serializedIndexStorageValues)) - return "serializedIndexStorageValues: array expected"; - for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) - if (!(message.serializedIndexStorageValues[i] && typeof message.serializedIndexStorageValues[i].length === "number" || $util.isString(message.serializedIndexStorageValues[i]))) - return "serializedIndexStorageValues: buffer[] expected"; - } - if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) { - var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify(message.voteChoice); - if (error) - return "voteChoice." + error; - } - return null; - }; - - /** - * Creates a ContestedResourceIdentityVote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote - */ - ContestedResourceIdentityVote.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.documentTypeName != null) - message.documentTypeName = String(object.documentTypeName); - if (object.serializedIndexStorageValues) { - if (!Array.isArray(object.serializedIndexStorageValues)) - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.serializedIndexStorageValues: array expected"); - message.serializedIndexStorageValues = []; - for (var i = 0; i < object.serializedIndexStorageValues.length; ++i) - if (typeof object.serializedIndexStorageValues[i] === "string") - $util.base64.decode(object.serializedIndexStorageValues[i], message.serializedIndexStorageValues[i] = $util.newBuffer($util.base64.length(object.serializedIndexStorageValues[i])), 0); - else if (object.serializedIndexStorageValues[i].length >= 0) - message.serializedIndexStorageValues[i] = object.serializedIndexStorageValues[i]; - } - if (object.voteChoice != null) { - if (typeof object.voteChoice !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.voteChoice: object expected"); - message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.fromObject(object.voteChoice); - } - return message; - }; - - /** - * Creates a plain object from a ContestedResourceIdentityVote message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @static - * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} message ContestedResourceIdentityVote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContestedResourceIdentityVote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.serializedIndexStorageValues = []; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.documentTypeName = ""; - object.voteChoice = null; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) - object.documentTypeName = message.documentTypeName; - if (message.serializedIndexStorageValues && message.serializedIndexStorageValues.length) { - object.serializedIndexStorageValues = []; - for (var j = 0; j < message.serializedIndexStorageValues.length; ++j) - object.serializedIndexStorageValues[j] = options.bytes === String ? $util.base64.encode(message.serializedIndexStorageValues[j], 0, message.serializedIndexStorageValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedIndexStorageValues[j]) : message.serializedIndexStorageValues[j]; - } - if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) - object.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.toObject(message.voteChoice, options); - return object; - }; - - /** - * Converts this ContestedResourceIdentityVote to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote - * @instance - * @returns {Object.} JSON object - */ - ContestedResourceIdentityVote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContestedResourceIdentityVote; - })(); - - return GetContestedResourceIdentityVotesResponseV0; - })(); - - return GetContestedResourceIdentityVotesResponse; - })(); - - v0.GetPrefundedSpecializedBalanceRequest = (function() { - - /** - * Properties of a GetPrefundedSpecializedBalanceRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetPrefundedSpecializedBalanceRequest - * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null} [v0] GetPrefundedSpecializedBalanceRequest v0 - */ - - /** - * Constructs a new GetPrefundedSpecializedBalanceRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetPrefundedSpecializedBalanceRequest. - * @implements IGetPrefundedSpecializedBalanceRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set - */ - function GetPrefundedSpecializedBalanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPrefundedSpecializedBalanceRequest v0. - * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @instance - */ - GetPrefundedSpecializedBalanceRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPrefundedSpecializedBalanceRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @instance - */ - Object.defineProperty(GetPrefundedSpecializedBalanceRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPrefundedSpecializedBalanceRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest instance - */ - GetPrefundedSpecializedBalanceRequest.create = function create(properties) { - return new GetPrefundedSpecializedBalanceRequest(properties); - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPrefundedSpecializedBalanceRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPrefundedSpecializedBalanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetPrefundedSpecializedBalanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest - */ - GetPrefundedSpecializedBalanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetPrefundedSpecializedBalanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPrefundedSpecializedBalanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetPrefundedSpecializedBalanceRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetPrefundedSpecializedBalanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 = (function() { - - /** - * Properties of a GetPrefundedSpecializedBalanceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @interface IGetPrefundedSpecializedBalanceRequestV0 - * @property {Uint8Array|null} [id] GetPrefundedSpecializedBalanceRequestV0 id - * @property {boolean|null} [prove] GetPrefundedSpecializedBalanceRequestV0 prove - */ - - /** - * Constructs a new GetPrefundedSpecializedBalanceRequestV0. - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest - * @classdesc Represents a GetPrefundedSpecializedBalanceRequestV0. - * @implements IGetPrefundedSpecializedBalanceRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set - */ - function GetPrefundedSpecializedBalanceRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPrefundedSpecializedBalanceRequestV0 id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @instance - */ - GetPrefundedSpecializedBalanceRequestV0.prototype.id = $util.newBuffer([]); - - /** - * GetPrefundedSpecializedBalanceRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @instance - */ - GetPrefundedSpecializedBalanceRequestV0.prototype.prove = false; - - /** - * Creates a new GetPrefundedSpecializedBalanceRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 instance - */ - GetPrefundedSpecializedBalanceRequestV0.create = function create(properties) { - return new GetPrefundedSpecializedBalanceRequestV0(properties); - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPrefundedSpecializedBalanceRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPrefundedSpecializedBalanceRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetPrefundedSpecializedBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 - */ - GetPrefundedSpecializedBalanceRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetPrefundedSpecializedBalanceRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPrefundedSpecializedBalanceRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetPrefundedSpecializedBalanceRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetPrefundedSpecializedBalanceRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetPrefundedSpecializedBalanceRequestV0; - })(); - - return GetPrefundedSpecializedBalanceRequest; - })(); - - v0.GetPrefundedSpecializedBalanceResponse = (function() { - - /** - * Properties of a GetPrefundedSpecializedBalanceResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetPrefundedSpecializedBalanceResponse - * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null} [v0] GetPrefundedSpecializedBalanceResponse v0 - */ - - /** - * Constructs a new GetPrefundedSpecializedBalanceResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetPrefundedSpecializedBalanceResponse. - * @implements IGetPrefundedSpecializedBalanceResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set - */ - function GetPrefundedSpecializedBalanceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPrefundedSpecializedBalanceResponse v0. - * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @instance - */ - GetPrefundedSpecializedBalanceResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPrefundedSpecializedBalanceResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @instance - */ - Object.defineProperty(GetPrefundedSpecializedBalanceResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPrefundedSpecializedBalanceResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse instance - */ - GetPrefundedSpecializedBalanceResponse.create = function create(properties) { - return new GetPrefundedSpecializedBalanceResponse(properties); - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPrefundedSpecializedBalanceResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPrefundedSpecializedBalanceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetPrefundedSpecializedBalanceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse - */ - GetPrefundedSpecializedBalanceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetPrefundedSpecializedBalanceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPrefundedSpecializedBalanceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetPrefundedSpecializedBalanceResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @instance - * @returns {Object.} JSON object - */ - GetPrefundedSpecializedBalanceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 = (function() { - - /** - * Properties of a GetPrefundedSpecializedBalanceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @interface IGetPrefundedSpecializedBalanceResponseV0 - * @property {number|Long|null} [balance] GetPrefundedSpecializedBalanceResponseV0 balance - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPrefundedSpecializedBalanceResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPrefundedSpecializedBalanceResponseV0 metadata - */ - - /** - * Constructs a new GetPrefundedSpecializedBalanceResponseV0. - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse - * @classdesc Represents a GetPrefundedSpecializedBalanceResponseV0. - * @implements IGetPrefundedSpecializedBalanceResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set - */ - function GetPrefundedSpecializedBalanceResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPrefundedSpecializedBalanceResponseV0 balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - */ - GetPrefundedSpecializedBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetPrefundedSpecializedBalanceResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - */ - GetPrefundedSpecializedBalanceResponseV0.prototype.proof = null; - - /** - * GetPrefundedSpecializedBalanceResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - */ - GetPrefundedSpecializedBalanceResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPrefundedSpecializedBalanceResponseV0 result. - * @member {"balance"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - */ - Object.defineProperty(GetPrefundedSpecializedBalanceResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPrefundedSpecializedBalanceResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 instance - */ - GetPrefundedSpecializedBalanceResponseV0.create = function create(properties) { - return new GetPrefundedSpecializedBalanceResponseV0(properties); - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPrefundedSpecializedBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.balance = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPrefundedSpecializedBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPrefundedSpecializedBalanceResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPrefundedSpecializedBalanceResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.balance != null && message.hasOwnProperty("balance")) { - properties.result = 1; - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetPrefundedSpecializedBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 - */ - GetPrefundedSpecializedBalanceResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetPrefundedSpecializedBalanceResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPrefundedSpecializedBalanceResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.balance != null && message.hasOwnProperty("balance")) { - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - if (options.oneofs) - object.result = "balance"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetPrefundedSpecializedBalanceResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetPrefundedSpecializedBalanceResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetPrefundedSpecializedBalanceResponseV0; - })(); - - return GetPrefundedSpecializedBalanceResponse; - })(); - - v0.GetTotalCreditsInPlatformRequest = (function() { - - /** - * Properties of a GetTotalCreditsInPlatformRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTotalCreditsInPlatformRequest - * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null} [v0] GetTotalCreditsInPlatformRequest v0 - */ - - /** - * Constructs a new GetTotalCreditsInPlatformRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTotalCreditsInPlatformRequest. - * @implements IGetTotalCreditsInPlatformRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set - */ - function GetTotalCreditsInPlatformRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTotalCreditsInPlatformRequest v0. - * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @instance - */ - GetTotalCreditsInPlatformRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTotalCreditsInPlatformRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @instance - */ - Object.defineProperty(GetTotalCreditsInPlatformRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTotalCreditsInPlatformRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest instance - */ - GetTotalCreditsInPlatformRequest.create = function create(properties) { - return new GetTotalCreditsInPlatformRequest(properties); - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTotalCreditsInPlatformRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTotalCreditsInPlatformRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTotalCreditsInPlatformRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest - */ - GetTotalCreditsInPlatformRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTotalCreditsInPlatformRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTotalCreditsInPlatformRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTotalCreditsInPlatformRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @instance - * @returns {Object.} JSON object - */ - GetTotalCreditsInPlatformRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 = (function() { - - /** - * Properties of a GetTotalCreditsInPlatformRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @interface IGetTotalCreditsInPlatformRequestV0 - * @property {boolean|null} [prove] GetTotalCreditsInPlatformRequestV0 prove - */ - - /** - * Constructs a new GetTotalCreditsInPlatformRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest - * @classdesc Represents a GetTotalCreditsInPlatformRequestV0. - * @implements IGetTotalCreditsInPlatformRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set - */ - function GetTotalCreditsInPlatformRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTotalCreditsInPlatformRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @instance - */ - GetTotalCreditsInPlatformRequestV0.prototype.prove = false; - - /** - * Creates a new GetTotalCreditsInPlatformRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 instance - */ - GetTotalCreditsInPlatformRequestV0.create = function create(properties) { - return new GetTotalCreditsInPlatformRequestV0(properties); - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTotalCreditsInPlatformRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTotalCreditsInPlatformRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTotalCreditsInPlatformRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 - */ - GetTotalCreditsInPlatformRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTotalCreditsInPlatformRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTotalCreditsInPlatformRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.prove = false; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTotalCreditsInPlatformRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTotalCreditsInPlatformRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTotalCreditsInPlatformRequestV0; - })(); - - return GetTotalCreditsInPlatformRequest; - })(); - - v0.GetTotalCreditsInPlatformResponse = (function() { - - /** - * Properties of a GetTotalCreditsInPlatformResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTotalCreditsInPlatformResponse - * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null} [v0] GetTotalCreditsInPlatformResponse v0 - */ - - /** - * Constructs a new GetTotalCreditsInPlatformResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTotalCreditsInPlatformResponse. - * @implements IGetTotalCreditsInPlatformResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set - */ - function GetTotalCreditsInPlatformResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTotalCreditsInPlatformResponse v0. - * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @instance - */ - GetTotalCreditsInPlatformResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTotalCreditsInPlatformResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @instance - */ - Object.defineProperty(GetTotalCreditsInPlatformResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTotalCreditsInPlatformResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse instance - */ - GetTotalCreditsInPlatformResponse.create = function create(properties) { - return new GetTotalCreditsInPlatformResponse(properties); - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTotalCreditsInPlatformResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTotalCreditsInPlatformResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTotalCreditsInPlatformResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse - */ - GetTotalCreditsInPlatformResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTotalCreditsInPlatformResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTotalCreditsInPlatformResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTotalCreditsInPlatformResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @instance - * @returns {Object.} JSON object - */ - GetTotalCreditsInPlatformResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 = (function() { - - /** - * Properties of a GetTotalCreditsInPlatformResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @interface IGetTotalCreditsInPlatformResponseV0 - * @property {number|Long|null} [credits] GetTotalCreditsInPlatformResponseV0 credits - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTotalCreditsInPlatformResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTotalCreditsInPlatformResponseV0 metadata - */ - - /** - * Constructs a new GetTotalCreditsInPlatformResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse - * @classdesc Represents a GetTotalCreditsInPlatformResponseV0. - * @implements IGetTotalCreditsInPlatformResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set - */ - function GetTotalCreditsInPlatformResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTotalCreditsInPlatformResponseV0 credits. - * @member {number|Long} credits - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - */ - GetTotalCreditsInPlatformResponseV0.prototype.credits = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GetTotalCreditsInPlatformResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - */ - GetTotalCreditsInPlatformResponseV0.prototype.proof = null; - - /** - * GetTotalCreditsInPlatformResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - */ - GetTotalCreditsInPlatformResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTotalCreditsInPlatformResponseV0 result. - * @member {"credits"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - */ - Object.defineProperty(GetTotalCreditsInPlatformResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["credits", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTotalCreditsInPlatformResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 instance - */ - GetTotalCreditsInPlatformResponseV0.create = function create(properties) { - return new GetTotalCreditsInPlatformResponseV0(properties); - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.credits != null && Object.hasOwnProperty.call(message, "credits")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.credits); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTotalCreditsInPlatformResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTotalCreditsInPlatformResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.credits = reader.uint64(); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTotalCreditsInPlatformResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTotalCreditsInPlatformResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTotalCreditsInPlatformResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.credits != null && message.hasOwnProperty("credits")) { - properties.result = 1; - if (!$util.isInteger(message.credits) && !(message.credits && $util.isInteger(message.credits.low) && $util.isInteger(message.credits.high))) - return "credits: integer|Long expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTotalCreditsInPlatformResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 - */ - GetTotalCreditsInPlatformResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); - if (object.credits != null) - if ($util.Long) - (message.credits = $util.Long.fromValue(object.credits)).unsigned = true; - else if (typeof object.credits === "string") - message.credits = parseInt(object.credits, 10); - else if (typeof object.credits === "number") - message.credits = object.credits; - else if (typeof object.credits === "object") - message.credits = new $util.LongBits(object.credits.low >>> 0, object.credits.high >>> 0).toNumber(true); - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTotalCreditsInPlatformResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTotalCreditsInPlatformResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.credits != null && message.hasOwnProperty("credits")) { - if (typeof message.credits === "number") - object.credits = options.longs === String ? String(message.credits) : message.credits; - else - object.credits = options.longs === String ? $util.Long.prototype.toString.call(message.credits) : options.longs === Number ? new $util.LongBits(message.credits.low >>> 0, message.credits.high >>> 0).toNumber(true) : message.credits; - if (options.oneofs) - object.result = "credits"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTotalCreditsInPlatformResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTotalCreditsInPlatformResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTotalCreditsInPlatformResponseV0; - })(); - - return GetTotalCreditsInPlatformResponse; - })(); - - v0.GetPathElementsRequest = (function() { - - /** - * Properties of a GetPathElementsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetPathElementsRequest - * @property {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null} [v0] GetPathElementsRequest v0 - */ - - /** - * Constructs a new GetPathElementsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetPathElementsRequest. - * @implements IGetPathElementsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set - */ - function GetPathElementsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPathElementsRequest v0. - * @member {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @instance - */ - GetPathElementsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPathElementsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @instance - */ - Object.defineProperty(GetPathElementsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPathElementsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest instance - */ - GetPathElementsRequest.create = function create(properties) { - return new GetPathElementsRequest(properties); - }; - - /** - * Encodes the specified GetPathElementsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPathElementsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPathElementsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPathElementsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPathElementsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPathElementsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetPathElementsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest - */ - GetPathElementsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetPathElementsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest} message GetPathElementsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPathElementsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetPathElementsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @instance - * @returns {Object.} JSON object - */ - GetPathElementsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPathElementsRequest.GetPathElementsRequestV0 = (function() { - - /** - * Properties of a GetPathElementsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @interface IGetPathElementsRequestV0 - * @property {Array.|null} [path] GetPathElementsRequestV0 path - * @property {Array.|null} [keys] GetPathElementsRequestV0 keys - * @property {boolean|null} [prove] GetPathElementsRequestV0 prove - */ - - /** - * Constructs a new GetPathElementsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest - * @classdesc Represents a GetPathElementsRequestV0. - * @implements IGetPathElementsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set - */ - function GetPathElementsRequestV0(properties) { - this.path = []; - this.keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPathElementsRequestV0 path. - * @member {Array.} path - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @instance - */ - GetPathElementsRequestV0.prototype.path = $util.emptyArray; - - /** - * GetPathElementsRequestV0 keys. - * @member {Array.} keys - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @instance - */ - GetPathElementsRequestV0.prototype.keys = $util.emptyArray; - - /** - * GetPathElementsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @instance - */ - GetPathElementsRequestV0.prototype.prove = false; - - /** - * Creates a new GetPathElementsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 instance - */ - GetPathElementsRequestV0.create = function create(properties) { - return new GetPathElementsRequestV0(properties); - }; - - /** - * Encodes the specified GetPathElementsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) - for (var i = 0; i < message.path.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path[i]); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keys[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetPathElementsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - message.path.push(reader.bytes()); - break; - case 2: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPathElementsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPathElementsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!(message.path[i] && typeof message.path[i].length === "number" || $util.isString(message.path[i]))) - return "path: buffer[] expected"; - } - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) - if (!(message.keys[i] && typeof message.keys[i].length === "number" || $util.isString(message.keys[i]))) - return "keys: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetPathElementsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 - */ - GetPathElementsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - if (typeof object.path[i] === "string") - $util.base64.decode(object.path[i], message.path[i] = $util.newBuffer($util.base64.length(object.path[i])), 0); - else if (object.path[i].length >= 0) - message.path[i] = object.path[i]; - } - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) - if (typeof object.keys[i] === "string") - $util.base64.decode(object.keys[i], message.keys[i] = $util.newBuffer($util.base64.length(object.keys[i])), 0); - else if (object.keys[i].length >= 0) - message.keys[i] = object.keys[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetPathElementsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} message GetPathElementsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPathElementsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.keys = []; - } - if (options.defaults) - object.prove = false; - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = options.bytes === String ? $util.base64.encode(message.path[j], 0, message.path[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.path[j]) : message.path[j]; - } - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = options.bytes === String ? $util.base64.encode(message.keys[j], 0, message.keys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keys[j]) : message.keys[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetPathElementsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetPathElementsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetPathElementsRequestV0; - })(); - - return GetPathElementsRequest; - })(); - - v0.GetPathElementsResponse = (function() { - - /** - * Properties of a GetPathElementsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetPathElementsResponse - * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null} [v0] GetPathElementsResponse v0 - */ - - /** - * Constructs a new GetPathElementsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetPathElementsResponse. - * @implements IGetPathElementsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set - */ - function GetPathElementsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPathElementsResponse v0. - * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @instance - */ - GetPathElementsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPathElementsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @instance - */ - Object.defineProperty(GetPathElementsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPathElementsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse instance - */ - GetPathElementsResponse.create = function create(properties) { - return new GetPathElementsResponse(properties); - }; - - /** - * Encodes the specified GetPathElementsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPathElementsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPathElementsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPathElementsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPathElementsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPathElementsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetPathElementsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse - */ - GetPathElementsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetPathElementsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} message GetPathElementsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPathElementsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetPathElementsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @instance - * @returns {Object.} JSON object - */ - GetPathElementsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPathElementsResponse.GetPathElementsResponseV0 = (function() { - - /** - * Properties of a GetPathElementsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @interface IGetPathElementsResponseV0 - * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null} [elements] GetPathElementsResponseV0 elements - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPathElementsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPathElementsResponseV0 metadata - */ - - /** - * Constructs a new GetPathElementsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse - * @classdesc Represents a GetPathElementsResponseV0. - * @implements IGetPathElementsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set - */ - function GetPathElementsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPathElementsResponseV0 elements. - * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null|undefined} elements - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - */ - GetPathElementsResponseV0.prototype.elements = null; - - /** - * GetPathElementsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - */ - GetPathElementsResponseV0.prototype.proof = null; - - /** - * GetPathElementsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - */ - GetPathElementsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetPathElementsResponseV0 result. - * @member {"elements"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - */ - Object.defineProperty(GetPathElementsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["elements", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetPathElementsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 instance - */ - GetPathElementsResponseV0.create = function create(properties) { - return new GetPathElementsResponseV0(properties); - }; - - /** - * Encodes the specified GetPathElementsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.elements != null && Object.hasOwnProperty.call(message, "elements")) - $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.encode(message.elements, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetPathElementsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPathElementsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPathElementsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPathElementsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPathElementsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.elements != null && message.hasOwnProperty("elements")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify(message.elements); - if (error) - return "elements." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetPathElementsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 - */ - GetPathElementsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); - if (object.elements != null) { - if (typeof object.elements !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.elements: object expected"); - message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.fromObject(object.elements); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetPathElementsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} message GetPathElementsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPathElementsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.elements != null && message.hasOwnProperty("elements")) { - object.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.toObject(message.elements, options); - if (options.oneofs) - object.result = "elements"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetPathElementsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetPathElementsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetPathElementsResponseV0.Elements = (function() { - - /** - * Properties of an Elements. - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @interface IElements - * @property {Array.|null} [elements] Elements elements - */ - - /** - * Constructs a new Elements. - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 - * @classdesc Represents an Elements. - * @implements IElements - * @constructor - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set - */ - function Elements(properties) { - this.elements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Elements elements. - * @member {Array.} elements - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @instance - */ - Elements.prototype.elements = $util.emptyArray; - - /** - * Creates a new Elements instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements instance - */ - Elements.create = function create(properties) { - return new Elements(properties); - }; - - /** - * Encodes the specified Elements message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Elements.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.elements != null && message.elements.length) - for (var i = 0; i < message.elements.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.elements[i]); - return writer; - }; - - /** - * Encodes the specified Elements message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Elements.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Elements message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Elements.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.elements && message.elements.length)) - message.elements = []; - message.elements.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Elements message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Elements.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Elements message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Elements.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.elements != null && message.hasOwnProperty("elements")) { - if (!Array.isArray(message.elements)) - return "elements: array expected"; - for (var i = 0; i < message.elements.length; ++i) - if (!(message.elements[i] && typeof message.elements[i].length === "number" || $util.isString(message.elements[i]))) - return "elements: buffer[] expected"; - } - return null; - }; - - /** - * Creates an Elements message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements - */ - Elements.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); - if (object.elements) { - if (!Array.isArray(object.elements)) - throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.elements: array expected"); - message.elements = []; - for (var i = 0; i < object.elements.length; ++i) - if (typeof object.elements[i] === "string") - $util.base64.decode(object.elements[i], message.elements[i] = $util.newBuffer($util.base64.length(object.elements[i])), 0); - else if (object.elements[i].length >= 0) - message.elements[i] = object.elements[i]; - } - return message; - }; - - /** - * Creates a plain object from an Elements message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @static - * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} message Elements - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Elements.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.elements = []; - if (message.elements && message.elements.length) { - object.elements = []; - for (var j = 0; j < message.elements.length; ++j) - object.elements[j] = options.bytes === String ? $util.base64.encode(message.elements[j], 0, message.elements[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.elements[j]) : message.elements[j]; - } - return object; - }; - - /** - * Converts this Elements to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements - * @instance - * @returns {Object.} JSON object - */ - Elements.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Elements; - })(); - - return GetPathElementsResponseV0; - })(); - - return GetPathElementsResponse; - })(); - - v0.GetStatusRequest = (function() { - - /** - * Properties of a GetStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetStatusRequest - * @property {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null} [v0] GetStatusRequest v0 - */ - - /** - * Constructs a new GetStatusRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetStatusRequest. - * @implements IGetStatusRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set - */ - function GetStatusRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetStatusRequest v0. - * @member {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @instance - */ - GetStatusRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetStatusRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @instance - */ - Object.defineProperty(GetStatusRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetStatusRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest instance - */ - GetStatusRequest.create = function create(properties) { - return new GetStatusRequest(properties); - }; - - /** - * Encodes the specified GetStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStatusRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest - */ - GetStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest} message GetStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetStatusRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @instance - * @returns {Object.} JSON object - */ - GetStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetStatusRequest.GetStatusRequestV0 = (function() { - - /** - * Properties of a GetStatusRequestV0. - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @interface IGetStatusRequestV0 - */ - - /** - * Constructs a new GetStatusRequestV0. - * @memberof org.dash.platform.dapi.v0.GetStatusRequest - * @classdesc Represents a GetStatusRequestV0. - * @implements IGetStatusRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set - */ - function GetStatusRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new GetStatusRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 instance - */ - GetStatusRequestV0.create = function create(properties) { - return new GetStatusRequestV0(properties); - }; - - /** - * Encodes the specified GetStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GetStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStatusRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetStatusRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStatusRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStatusRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GetStatusRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 - */ - GetStatusRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0) - return object; - return new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); - }; - - /** - * Creates a plain object from a GetStatusRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} message GetStatusRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStatusRequestV0.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GetStatusRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetStatusRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetStatusRequestV0; - })(); - - return GetStatusRequest; - })(); - - v0.GetStatusResponse = (function() { - - /** - * Properties of a GetStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetStatusResponse - * @property {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null} [v0] GetStatusResponse v0 - */ - - /** - * Constructs a new GetStatusResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetStatusResponse. - * @implements IGetStatusResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set - */ - function GetStatusResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetStatusResponse v0. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @instance - */ - GetStatusResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetStatusResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @instance - */ - Object.defineProperty(GetStatusResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetStatusResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse instance - */ - GetStatusResponse.create = function create(properties) { - return new GetStatusResponse(properties); - }; - - /** - * Encodes the specified GetStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStatusResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetStatusResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStatusResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStatusResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetStatusResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse - */ - GetStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetStatusResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse} message GetStatusResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStatusResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetStatusResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @instance - * @returns {Object.} JSON object - */ - GetStatusResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetStatusResponse.GetStatusResponseV0 = (function() { - - /** - * Properties of a GetStatusResponseV0. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @interface IGetStatusResponseV0 - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null} [version] GetStatusResponseV0 version - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null} [node] GetStatusResponseV0 node - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null} [chain] GetStatusResponseV0 chain - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null} [network] GetStatusResponseV0 network - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null} [stateSync] GetStatusResponseV0 stateSync - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null} [time] GetStatusResponseV0 time - */ - - /** - * Constructs a new GetStatusResponseV0. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse - * @classdesc Represents a GetStatusResponseV0. - * @implements IGetStatusResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set - */ - function GetStatusResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetStatusResponseV0 version. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null|undefined} version - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.version = null; - - /** - * GetStatusResponseV0 node. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null|undefined} node - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.node = null; - - /** - * GetStatusResponseV0 chain. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null|undefined} chain - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.chain = null; - - /** - * GetStatusResponseV0 network. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null|undefined} network - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.network = null; - - /** - * GetStatusResponseV0 stateSync. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null|undefined} stateSync - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.stateSync = null; - - /** - * GetStatusResponseV0 time. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null|undefined} time - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - */ - GetStatusResponseV0.prototype.time = null; - - /** - * Creates a new GetStatusResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 instance - */ - GetStatusResponseV0.create = function create(properties) { - return new GetStatusResponseV0(properties); - }; - - /** - * Encodes the specified GetStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.node != null && Object.hasOwnProperty.call(message, "node")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.encode(message.node, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.encode(message.chain, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.encode(message.network, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.stateSync != null && Object.hasOwnProperty.call(message, "stateSync")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.encode(message.stateSync, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.encode(message.time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStatusResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.decode(reader, reader.uint32()); - break; - case 2: - message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.decode(reader, reader.uint32()); - break; - case 3: - message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.decode(reader, reader.uint32()); - break; - case 4: - message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.decode(reader, reader.uint32()); - break; - case 5: - message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.decode(reader, reader.uint32()); - break; - case 6: - message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetStatusResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStatusResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStatusResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify(message.version); - if (error) - return "version." + error; - } - if (message.node != null && message.hasOwnProperty("node")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify(message.node); - if (error) - return "node." + error; - } - if (message.chain != null && message.hasOwnProperty("chain")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify(message.chain); - if (error) - return "chain." + error; - } - if (message.network != null && message.hasOwnProperty("network")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify(message.network); - if (error) - return "network." + error; - } - if (message.stateSync != null && message.hasOwnProperty("stateSync")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify(message.stateSync); - if (error) - return "stateSync." + error; - } - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify(message.time); - if (error) - return "time." + error; - } - return null; - }; - - /** - * Creates a GetStatusResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 - */ - GetStatusResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.version: object expected"); - message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.fromObject(object.version); - } - if (object.node != null) { - if (typeof object.node !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.node: object expected"); - message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.fromObject(object.node); - } - if (object.chain != null) { - if (typeof object.chain !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.chain: object expected"); - message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.fromObject(object.chain); - } - if (object.network != null) { - if (typeof object.network !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.network: object expected"); - message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.fromObject(object.network); - } - if (object.stateSync != null) { - if (typeof object.stateSync !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.stateSync: object expected"); - message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.fromObject(object.stateSync); - } - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.time: object expected"); - message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.fromObject(object.time); - } - return message; - }; - - /** - * Creates a plain object from a GetStatusResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} message GetStatusResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStatusResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = null; - object.node = null; - object.chain = null; - object.network = null; - object.stateSync = null; - object.time = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.toObject(message.version, options); - if (message.node != null && message.hasOwnProperty("node")) - object.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.toObject(message.node, options); - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.toObject(message.chain, options); - if (message.network != null && message.hasOwnProperty("network")) - object.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.toObject(message.network, options); - if (message.stateSync != null && message.hasOwnProperty("stateSync")) - object.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.toObject(message.stateSync, options); - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.toObject(message.time, options); - return object; - }; - - /** - * Converts this GetStatusResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetStatusResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetStatusResponseV0.Version = (function() { - - /** - * Properties of a Version. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface IVersion - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null} [software] Version software - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null} [protocol] Version protocol - */ - - /** - * Constructs a new Version. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Version. - * @implements IVersion - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set - */ - function Version(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Version software. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null|undefined} software - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @instance - */ - Version.prototype.software = null; - - /** - * Version protocol. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null|undefined} protocol - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @instance - */ - Version.prototype.protocol = null; - - /** - * Creates a new Version instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version instance - */ - Version.create = function create(properties) { - return new Version(properties); - }; - - /** - * Encodes the specified Version message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.software != null && Object.hasOwnProperty.call(message, "software")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.encode(message.software, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.encode(message.protocol, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Version message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.decode(reader, reader.uint32()); - break; - case 2: - message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Version message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Version message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Version.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.software != null && message.hasOwnProperty("software")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify(message.software); - if (error) - return "software." + error; - } - if (message.protocol != null && message.hasOwnProperty("protocol")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify(message.protocol); - if (error) - return "protocol." + error; - } - return null; - }; - - /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version - */ - Version.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); - if (object.software != null) { - if (typeof object.software !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.software: object expected"); - message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.fromObject(object.software); - } - if (object.protocol != null) { - if (typeof object.protocol !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.protocol: object expected"); - message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.fromObject(object.protocol); - } - return message; - }; - - /** - * Creates a plain object from a Version message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} message Version - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Version.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.software = null; - object.protocol = null; - } - if (message.software != null && message.hasOwnProperty("software")) - object.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.toObject(message.software, options); - if (message.protocol != null && message.hasOwnProperty("protocol")) - object.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.toObject(message.protocol, options); - return object; - }; - - /** - * Converts this Version to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @instance - * @returns {Object.} JSON object - */ - Version.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Version.Software = (function() { - - /** - * Properties of a Software. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @interface ISoftware - * @property {string|null} [dapi] Software dapi - * @property {string|null} [drive] Software drive - * @property {string|null} [tenderdash] Software tenderdash - */ - - /** - * Constructs a new Software. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @classdesc Represents a Software. - * @implements ISoftware - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set - */ - function Software(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Software dapi. - * @member {string} dapi - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @instance - */ - Software.prototype.dapi = ""; - - /** - * Software drive. - * @member {string} drive - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @instance - */ - Software.prototype.drive = ""; - - /** - * Software tenderdash. - * @member {string} tenderdash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @instance - */ - Software.prototype.tenderdash = ""; - - /** - * Creates a new Software instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software instance - */ - Software.create = function create(properties) { - return new Software(properties); - }; - - /** - * Encodes the specified Software message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Software.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dapi != null && Object.hasOwnProperty.call(message, "dapi")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dapi); - if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.drive); - if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tenderdash); - return writer; - }; - - /** - * Encodes the specified Software message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Software.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Software message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Software.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dapi = reader.string(); - break; - case 2: - message.drive = reader.string(); - break; - case 3: - message.tenderdash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Software message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Software.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Software message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Software.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dapi != null && message.hasOwnProperty("dapi")) - if (!$util.isString(message.dapi)) - return "dapi: string expected"; - if (message.drive != null && message.hasOwnProperty("drive")) - if (!$util.isString(message.drive)) - return "drive: string expected"; - if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) - if (!$util.isString(message.tenderdash)) - return "tenderdash: string expected"; - return null; - }; - - /** - * Creates a Software message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software - */ - Software.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); - if (object.dapi != null) - message.dapi = String(object.dapi); - if (object.drive != null) - message.drive = String(object.drive); - if (object.tenderdash != null) - message.tenderdash = String(object.tenderdash); - return message; - }; - - /** - * Creates a plain object from a Software message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} message Software - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Software.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dapi = ""; - object.drive = ""; - object.tenderdash = ""; - } - if (message.dapi != null && message.hasOwnProperty("dapi")) - object.dapi = message.dapi; - if (message.drive != null && message.hasOwnProperty("drive")) - object.drive = message.drive; - if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) - object.tenderdash = message.tenderdash; - return object; - }; - - /** - * Converts this Software to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software - * @instance - * @returns {Object.} JSON object - */ - Software.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Software; - })(); - - Version.Protocol = (function() { - - /** - * Properties of a Protocol. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @interface IProtocol - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null} [tenderdash] Protocol tenderdash - * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null} [drive] Protocol drive - */ - - /** - * Constructs a new Protocol. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version - * @classdesc Represents a Protocol. - * @implements IProtocol - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set - */ - function Protocol(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Protocol tenderdash. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null|undefined} tenderdash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @instance - */ - Protocol.prototype.tenderdash = null; - - /** - * Protocol drive. - * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null|undefined} drive - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @instance - */ - Protocol.prototype.drive = null; - - /** - * Creates a new Protocol instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol instance - */ - Protocol.create = function create(properties) { - return new Protocol(properties); - }; - - /** - * Encodes the specified Protocol message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Protocol.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.encode(message.tenderdash, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) - $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.encode(message.drive, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Protocol message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Protocol.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Protocol message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Protocol.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.decode(reader, reader.uint32()); - break; - case 2: - message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Protocol message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Protocol.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Protocol message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Protocol.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify(message.tenderdash); - if (error) - return "tenderdash." + error; - } - if (message.drive != null && message.hasOwnProperty("drive")) { - var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify(message.drive); - if (error) - return "drive." + error; - } - return null; - }; - - /** - * Creates a Protocol message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol - */ - Protocol.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); - if (object.tenderdash != null) { - if (typeof object.tenderdash !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.tenderdash: object expected"); - message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.fromObject(object.tenderdash); - } - if (object.drive != null) { - if (typeof object.drive !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.drive: object expected"); - message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.fromObject(object.drive); - } - return message; - }; - - /** - * Creates a plain object from a Protocol message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} message Protocol - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Protocol.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.tenderdash = null; - object.drive = null; - } - if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) - object.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.toObject(message.tenderdash, options); - if (message.drive != null && message.hasOwnProperty("drive")) - object.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.toObject(message.drive, options); - return object; - }; - - /** - * Converts this Protocol to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @instance - * @returns {Object.} JSON object - */ - Protocol.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Protocol.Tenderdash = (function() { - - /** - * Properties of a Tenderdash. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @interface ITenderdash - * @property {number|null} [p2p] Tenderdash p2p - * @property {number|null} [block] Tenderdash block - */ - - /** - * Constructs a new Tenderdash. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @classdesc Represents a Tenderdash. - * @implements ITenderdash - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set - */ - function Tenderdash(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Tenderdash p2p. - * @member {number} p2p - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @instance - */ - Tenderdash.prototype.p2p = 0; - - /** - * Tenderdash block. - * @member {number} block - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @instance - */ - Tenderdash.prototype.block = 0; - - /** - * Creates a new Tenderdash instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash instance - */ - Tenderdash.create = function create(properties) { - return new Tenderdash(properties); - }; - - /** - * Encodes the specified Tenderdash message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tenderdash.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.p2p); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.block); - return writer; - }; - - /** - * Encodes the specified Tenderdash message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tenderdash.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Tenderdash message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tenderdash.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.p2p = reader.uint32(); - break; - case 2: - message.block = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Tenderdash message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tenderdash.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Tenderdash message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Tenderdash.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.p2p != null && message.hasOwnProperty("p2p")) - if (!$util.isInteger(message.p2p)) - return "p2p: integer expected"; - if (message.block != null && message.hasOwnProperty("block")) - if (!$util.isInteger(message.block)) - return "block: integer expected"; - return null; - }; - - /** - * Creates a Tenderdash message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash - */ - Tenderdash.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); - if (object.p2p != null) - message.p2p = object.p2p >>> 0; - if (object.block != null) - message.block = object.block >>> 0; - return message; - }; - - /** - * Creates a plain object from a Tenderdash message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} message Tenderdash - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tenderdash.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.p2p = 0; - object.block = 0; - } - if (message.p2p != null && message.hasOwnProperty("p2p")) - object.p2p = message.p2p; - if (message.block != null && message.hasOwnProperty("block")) - object.block = message.block; - return object; - }; - - /** - * Converts this Tenderdash to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash - * @instance - * @returns {Object.} JSON object - */ - Tenderdash.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Tenderdash; - })(); - - Protocol.Drive = (function() { - - /** - * Properties of a Drive. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @interface IDrive - * @property {number|null} [latest] Drive latest - * @property {number|null} [current] Drive current - */ - - /** - * Constructs a new Drive. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol - * @classdesc Represents a Drive. - * @implements IDrive - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set - */ - function Drive(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Drive latest. - * @member {number} latest - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @instance - */ - Drive.prototype.latest = 0; - - /** - * Drive current. - * @member {number} current - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @instance - */ - Drive.prototype.current = 0; - - /** - * Creates a new Drive instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive instance - */ - Drive.create = function create(properties) { - return new Drive(properties); - }; - - /** - * Encodes the specified Drive message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Drive.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.latest != null && Object.hasOwnProperty.call(message, "latest")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.latest); - if (message.current != null && Object.hasOwnProperty.call(message, "current")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.current); - return writer; - }; - - /** - * Encodes the specified Drive message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Drive.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Drive message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Drive.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.latest = reader.uint32(); - break; - case 4: - message.current = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Drive message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Drive.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Drive message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Drive.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.latest != null && message.hasOwnProperty("latest")) - if (!$util.isInteger(message.latest)) - return "latest: integer expected"; - if (message.current != null && message.hasOwnProperty("current")) - if (!$util.isInteger(message.current)) - return "current: integer expected"; - return null; - }; - - /** - * Creates a Drive message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive - */ - Drive.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); - if (object.latest != null) - message.latest = object.latest >>> 0; - if (object.current != null) - message.current = object.current >>> 0; - return message; - }; - - /** - * Creates a plain object from a Drive message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} message Drive - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Drive.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.latest = 0; - object.current = 0; - } - if (message.latest != null && message.hasOwnProperty("latest")) - object.latest = message.latest; - if (message.current != null && message.hasOwnProperty("current")) - object.current = message.current; - return object; - }; - - /** - * Converts this Drive to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive - * @instance - * @returns {Object.} JSON object - */ - Drive.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Drive; - })(); - - return Protocol; - })(); - - return Version; - })(); - - GetStatusResponseV0.Time = (function() { - - /** - * Properties of a Time. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface ITime - * @property {number|Long|null} [local] Time local - * @property {number|Long|null} [block] Time block - * @property {number|Long|null} [genesis] Time genesis - * @property {number|null} [epoch] Time epoch - */ - - /** - * Constructs a new Time. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Time. - * @implements ITime - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set - */ - function Time(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Time local. - * @member {number|Long} local - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - */ - Time.prototype.local = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Time block. - * @member {number|Long} block - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - */ - Time.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Time genesis. - * @member {number|Long} genesis - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - */ - Time.prototype.genesis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Time epoch. - * @member {number} epoch - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - */ - Time.prototype.epoch = 0; - - /** - * Creates a new Time instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time instance - */ - Time.create = function create(properties) { - return new Time(properties); - }; - - /** - * Encodes the specified Time message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Time.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.local != null && Object.hasOwnProperty.call(message, "local")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.local); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block); - if (message.genesis != null && Object.hasOwnProperty.call(message, "genesis")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.genesis); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.epoch); - return writer; - }; - - /** - * Encodes the specified Time message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Time.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Time message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Time.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.local = reader.uint64(); - break; - case 2: - message.block = reader.uint64(); - break; - case 3: - message.genesis = reader.uint64(); - break; - case 4: - message.epoch = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Time message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Time.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Time message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Time.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.local != null && message.hasOwnProperty("local")) - if (!$util.isInteger(message.local) && !(message.local && $util.isInteger(message.local.low) && $util.isInteger(message.local.high))) - return "local: integer|Long expected"; - if (message.block != null && message.hasOwnProperty("block")) - if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) - return "block: integer|Long expected"; - if (message.genesis != null && message.hasOwnProperty("genesis")) - if (!$util.isInteger(message.genesis) && !(message.genesis && $util.isInteger(message.genesis.low) && $util.isInteger(message.genesis.high))) - return "genesis: integer|Long expected"; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - return null; - }; - - /** - * Creates a Time message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time - */ - Time.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); - if (object.local != null) - if ($util.Long) - (message.local = $util.Long.fromValue(object.local)).unsigned = true; - else if (typeof object.local === "string") - message.local = parseInt(object.local, 10); - else if (typeof object.local === "number") - message.local = object.local; - else if (typeof object.local === "object") - message.local = new $util.LongBits(object.local.low >>> 0, object.local.high >>> 0).toNumber(true); - if (object.block != null) - if ($util.Long) - (message.block = $util.Long.fromValue(object.block)).unsigned = true; - else if (typeof object.block === "string") - message.block = parseInt(object.block, 10); - else if (typeof object.block === "number") - message.block = object.block; - else if (typeof object.block === "object") - message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); - if (object.genesis != null) - if ($util.Long) - (message.genesis = $util.Long.fromValue(object.genesis)).unsigned = true; - else if (typeof object.genesis === "string") - message.genesis = parseInt(object.genesis, 10); - else if (typeof object.genesis === "number") - message.genesis = object.genesis; - else if (typeof object.genesis === "object") - message.genesis = new $util.LongBits(object.genesis.low >>> 0, object.genesis.high >>> 0).toNumber(true); - if (object.epoch != null) - message.epoch = object.epoch >>> 0; - return message; - }; - - /** - * Creates a plain object from a Time message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} message Time - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Time.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.local = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.local = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.genesis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.genesis = options.longs === String ? "0" : 0; - object.epoch = 0; - } - if (message.local != null && message.hasOwnProperty("local")) - if (typeof message.local === "number") - object.local = options.longs === String ? String(message.local) : message.local; - else - object.local = options.longs === String ? $util.Long.prototype.toString.call(message.local) : options.longs === Number ? new $util.LongBits(message.local.low >>> 0, message.local.high >>> 0).toNumber(true) : message.local; - if (message.block != null && message.hasOwnProperty("block")) - if (typeof message.block === "number") - object.block = options.longs === String ? String(message.block) : message.block; - else - object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; - if (message.genesis != null && message.hasOwnProperty("genesis")) - if (typeof message.genesis === "number") - object.genesis = options.longs === String ? String(message.genesis) : message.genesis; - else - object.genesis = options.longs === String ? $util.Long.prototype.toString.call(message.genesis) : options.longs === Number ? new $util.LongBits(message.genesis.low >>> 0, message.genesis.high >>> 0).toNumber(true) : message.genesis; - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - return object; - }; - - /** - * Converts this Time to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time - * @instance - * @returns {Object.} JSON object - */ - Time.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Time; - })(); - - GetStatusResponseV0.Node = (function() { - - /** - * Properties of a Node. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface INode - * @property {Uint8Array|null} [id] Node id - * @property {Uint8Array|null} [proTxHash] Node proTxHash - */ - - /** - * Constructs a new Node. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set - */ - function Node(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Node id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @instance - */ - Node.prototype.id = $util.newBuffer([]); - - /** - * Node proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @instance - */ - Node.prototype.proTxHash = $util.newBuffer([]); - - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node instance - */ - Node.create = function create(properties) { - return new Node(properties); - }; - - /** - * Encodes the specified Node message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proTxHash); - return writer; - }; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Node message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.bytes(); - break; - case 2: - message.proTxHash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Node message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - return null; - }; - - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - return message; - }; - - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} message Node - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - return object; - }; - - /** - * Converts this Node to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Node; - })(); - - GetStatusResponseV0.Chain = (function() { - - /** - * Properties of a Chain. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface IChain - * @property {boolean|null} [catchingUp] Chain catchingUp - * @property {Uint8Array|null} [latestBlockHash] Chain latestBlockHash - * @property {Uint8Array|null} [latestAppHash] Chain latestAppHash - * @property {number|Long|null} [latestBlockHeight] Chain latestBlockHeight - * @property {Uint8Array|null} [earliestBlockHash] Chain earliestBlockHash - * @property {Uint8Array|null} [earliestAppHash] Chain earliestAppHash - * @property {number|Long|null} [earliestBlockHeight] Chain earliestBlockHeight - * @property {number|Long|null} [maxPeerBlockHeight] Chain maxPeerBlockHeight - * @property {number|null} [coreChainLockedHeight] Chain coreChainLockedHeight - */ - - /** - * Constructs a new Chain. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Chain. - * @implements IChain - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set - */ - function Chain(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Chain catchingUp. - * @member {boolean} catchingUp - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.catchingUp = false; - - /** - * Chain latestBlockHash. - * @member {Uint8Array} latestBlockHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.latestBlockHash = $util.newBuffer([]); - - /** - * Chain latestAppHash. - * @member {Uint8Array} latestAppHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.latestAppHash = $util.newBuffer([]); - - /** - * Chain latestBlockHeight. - * @member {number|Long} latestBlockHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.latestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Chain earliestBlockHash. - * @member {Uint8Array} earliestBlockHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.earliestBlockHash = $util.newBuffer([]); - - /** - * Chain earliestAppHash. - * @member {Uint8Array} earliestAppHash - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.earliestAppHash = $util.newBuffer([]); - - /** - * Chain earliestBlockHeight. - * @member {number|Long} earliestBlockHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.earliestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Chain maxPeerBlockHeight. - * @member {number|Long} maxPeerBlockHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.maxPeerBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Chain coreChainLockedHeight. - * @member {number} coreChainLockedHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - */ - Chain.prototype.coreChainLockedHeight = 0; - - /** - * Creates a new Chain instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain instance - */ - Chain.create = function create(properties) { - return new Chain(properties); - }; - - /** - * Encodes the specified Chain message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.catchingUp != null && Object.hasOwnProperty.call(message, "catchingUp")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.catchingUp); - if (message.latestBlockHash != null && Object.hasOwnProperty.call(message, "latestBlockHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.latestBlockHash); - if (message.latestAppHash != null && Object.hasOwnProperty.call(message, "latestAppHash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.latestAppHash); - if (message.latestBlockHeight != null && Object.hasOwnProperty.call(message, "latestBlockHeight")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.latestBlockHeight); - if (message.earliestBlockHash != null && Object.hasOwnProperty.call(message, "earliestBlockHash")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.earliestBlockHash); - if (message.earliestAppHash != null && Object.hasOwnProperty.call(message, "earliestAppHash")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.earliestAppHash); - if (message.earliestBlockHeight != null && Object.hasOwnProperty.call(message, "earliestBlockHeight")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.earliestBlockHeight); - if (message.maxPeerBlockHeight != null && Object.hasOwnProperty.call(message, "maxPeerBlockHeight")) - writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.maxPeerBlockHeight); - if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) - writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.coreChainLockedHeight); - return writer; - }; - - /** - * Encodes the specified Chain message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Chain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Chain message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chain.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.catchingUp = reader.bool(); - break; - case 2: - message.latestBlockHash = reader.bytes(); - break; - case 3: - message.latestAppHash = reader.bytes(); - break; - case 4: - message.latestBlockHeight = reader.uint64(); - break; - case 5: - message.earliestBlockHash = reader.bytes(); - break; - case 6: - message.earliestAppHash = reader.bytes(); - break; - case 7: - message.earliestBlockHeight = reader.uint64(); - break; - case 9: - message.maxPeerBlockHeight = reader.uint64(); - break; - case 10: - message.coreChainLockedHeight = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Chain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Chain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Chain message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Chain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) - if (typeof message.catchingUp !== "boolean") - return "catchingUp: boolean expected"; - if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) - if (!(message.latestBlockHash && typeof message.latestBlockHash.length === "number" || $util.isString(message.latestBlockHash))) - return "latestBlockHash: buffer expected"; - if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) - if (!(message.latestAppHash && typeof message.latestAppHash.length === "number" || $util.isString(message.latestAppHash))) - return "latestAppHash: buffer expected"; - if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) - if (!$util.isInteger(message.latestBlockHeight) && !(message.latestBlockHeight && $util.isInteger(message.latestBlockHeight.low) && $util.isInteger(message.latestBlockHeight.high))) - return "latestBlockHeight: integer|Long expected"; - if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) - if (!(message.earliestBlockHash && typeof message.earliestBlockHash.length === "number" || $util.isString(message.earliestBlockHash))) - return "earliestBlockHash: buffer expected"; - if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) - if (!(message.earliestAppHash && typeof message.earliestAppHash.length === "number" || $util.isString(message.earliestAppHash))) - return "earliestAppHash: buffer expected"; - if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) - if (!$util.isInteger(message.earliestBlockHeight) && !(message.earliestBlockHeight && $util.isInteger(message.earliestBlockHeight.low) && $util.isInteger(message.earliestBlockHeight.high))) - return "earliestBlockHeight: integer|Long expected"; - if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) - if (!$util.isInteger(message.maxPeerBlockHeight) && !(message.maxPeerBlockHeight && $util.isInteger(message.maxPeerBlockHeight.low) && $util.isInteger(message.maxPeerBlockHeight.high))) - return "maxPeerBlockHeight: integer|Long expected"; - if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) - if (!$util.isInteger(message.coreChainLockedHeight)) - return "coreChainLockedHeight: integer expected"; - return null; - }; - - /** - * Creates a Chain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain - */ - Chain.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); - if (object.catchingUp != null) - message.catchingUp = Boolean(object.catchingUp); - if (object.latestBlockHash != null) - if (typeof object.latestBlockHash === "string") - $util.base64.decode(object.latestBlockHash, message.latestBlockHash = $util.newBuffer($util.base64.length(object.latestBlockHash)), 0); - else if (object.latestBlockHash.length >= 0) - message.latestBlockHash = object.latestBlockHash; - if (object.latestAppHash != null) - if (typeof object.latestAppHash === "string") - $util.base64.decode(object.latestAppHash, message.latestAppHash = $util.newBuffer($util.base64.length(object.latestAppHash)), 0); - else if (object.latestAppHash.length >= 0) - message.latestAppHash = object.latestAppHash; - if (object.latestBlockHeight != null) - if ($util.Long) - (message.latestBlockHeight = $util.Long.fromValue(object.latestBlockHeight)).unsigned = true; - else if (typeof object.latestBlockHeight === "string") - message.latestBlockHeight = parseInt(object.latestBlockHeight, 10); - else if (typeof object.latestBlockHeight === "number") - message.latestBlockHeight = object.latestBlockHeight; - else if (typeof object.latestBlockHeight === "object") - message.latestBlockHeight = new $util.LongBits(object.latestBlockHeight.low >>> 0, object.latestBlockHeight.high >>> 0).toNumber(true); - if (object.earliestBlockHash != null) - if (typeof object.earliestBlockHash === "string") - $util.base64.decode(object.earliestBlockHash, message.earliestBlockHash = $util.newBuffer($util.base64.length(object.earliestBlockHash)), 0); - else if (object.earliestBlockHash.length >= 0) - message.earliestBlockHash = object.earliestBlockHash; - if (object.earliestAppHash != null) - if (typeof object.earliestAppHash === "string") - $util.base64.decode(object.earliestAppHash, message.earliestAppHash = $util.newBuffer($util.base64.length(object.earliestAppHash)), 0); - else if (object.earliestAppHash.length >= 0) - message.earliestAppHash = object.earliestAppHash; - if (object.earliestBlockHeight != null) - if ($util.Long) - (message.earliestBlockHeight = $util.Long.fromValue(object.earliestBlockHeight)).unsigned = true; - else if (typeof object.earliestBlockHeight === "string") - message.earliestBlockHeight = parseInt(object.earliestBlockHeight, 10); - else if (typeof object.earliestBlockHeight === "number") - message.earliestBlockHeight = object.earliestBlockHeight; - else if (typeof object.earliestBlockHeight === "object") - message.earliestBlockHeight = new $util.LongBits(object.earliestBlockHeight.low >>> 0, object.earliestBlockHeight.high >>> 0).toNumber(true); - if (object.maxPeerBlockHeight != null) - if ($util.Long) - (message.maxPeerBlockHeight = $util.Long.fromValue(object.maxPeerBlockHeight)).unsigned = true; - else if (typeof object.maxPeerBlockHeight === "string") - message.maxPeerBlockHeight = parseInt(object.maxPeerBlockHeight, 10); - else if (typeof object.maxPeerBlockHeight === "number") - message.maxPeerBlockHeight = object.maxPeerBlockHeight; - else if (typeof object.maxPeerBlockHeight === "object") - message.maxPeerBlockHeight = new $util.LongBits(object.maxPeerBlockHeight.low >>> 0, object.maxPeerBlockHeight.high >>> 0).toNumber(true); - if (object.coreChainLockedHeight != null) - message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; - return message; - }; - - /** - * Creates a plain object from a Chain message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} message Chain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Chain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.catchingUp = false; - if (options.bytes === String) - object.latestBlockHash = ""; - else { - object.latestBlockHash = []; - if (options.bytes !== Array) - object.latestBlockHash = $util.newBuffer(object.latestBlockHash); - } - if (options.bytes === String) - object.latestAppHash = ""; - else { - object.latestAppHash = []; - if (options.bytes !== Array) - object.latestAppHash = $util.newBuffer(object.latestAppHash); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.latestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.latestBlockHeight = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.earliestBlockHash = ""; - else { - object.earliestBlockHash = []; - if (options.bytes !== Array) - object.earliestBlockHash = $util.newBuffer(object.earliestBlockHash); - } - if (options.bytes === String) - object.earliestAppHash = ""; - else { - object.earliestAppHash = []; - if (options.bytes !== Array) - object.earliestAppHash = $util.newBuffer(object.earliestAppHash); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.earliestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.earliestBlockHeight = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.maxPeerBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxPeerBlockHeight = options.longs === String ? "0" : 0; - object.coreChainLockedHeight = 0; - } - if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) - object.catchingUp = message.catchingUp; - if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) - object.latestBlockHash = options.bytes === String ? $util.base64.encode(message.latestBlockHash, 0, message.latestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestBlockHash) : message.latestBlockHash; - if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) - object.latestAppHash = options.bytes === String ? $util.base64.encode(message.latestAppHash, 0, message.latestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestAppHash) : message.latestAppHash; - if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) - if (typeof message.latestBlockHeight === "number") - object.latestBlockHeight = options.longs === String ? String(message.latestBlockHeight) : message.latestBlockHeight; - else - object.latestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.latestBlockHeight) : options.longs === Number ? new $util.LongBits(message.latestBlockHeight.low >>> 0, message.latestBlockHeight.high >>> 0).toNumber(true) : message.latestBlockHeight; - if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) - object.earliestBlockHash = options.bytes === String ? $util.base64.encode(message.earliestBlockHash, 0, message.earliestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestBlockHash) : message.earliestBlockHash; - if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) - object.earliestAppHash = options.bytes === String ? $util.base64.encode(message.earliestAppHash, 0, message.earliestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestAppHash) : message.earliestAppHash; - if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) - if (typeof message.earliestBlockHeight === "number") - object.earliestBlockHeight = options.longs === String ? String(message.earliestBlockHeight) : message.earliestBlockHeight; - else - object.earliestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.earliestBlockHeight) : options.longs === Number ? new $util.LongBits(message.earliestBlockHeight.low >>> 0, message.earliestBlockHeight.high >>> 0).toNumber(true) : message.earliestBlockHeight; - if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) - if (typeof message.maxPeerBlockHeight === "number") - object.maxPeerBlockHeight = options.longs === String ? String(message.maxPeerBlockHeight) : message.maxPeerBlockHeight; - else - object.maxPeerBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.maxPeerBlockHeight) : options.longs === Number ? new $util.LongBits(message.maxPeerBlockHeight.low >>> 0, message.maxPeerBlockHeight.high >>> 0).toNumber(true) : message.maxPeerBlockHeight; - if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) - object.coreChainLockedHeight = message.coreChainLockedHeight; - return object; - }; - - /** - * Converts this Chain to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain - * @instance - * @returns {Object.} JSON object - */ - Chain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Chain; - })(); - - GetStatusResponseV0.Network = (function() { - - /** - * Properties of a Network. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface INetwork - * @property {string|null} [chainId] Network chainId - * @property {number|null} [peersCount] Network peersCount - * @property {boolean|null} [listening] Network listening - */ - - /** - * Constructs a new Network. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a Network. - * @implements INetwork - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set - */ - function Network(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Network chainId. - * @member {string} chainId - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @instance - */ - Network.prototype.chainId = ""; - - /** - * Network peersCount. - * @member {number} peersCount - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @instance - */ - Network.prototype.peersCount = 0; - - /** - * Network listening. - * @member {boolean} listening - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @instance - */ - Network.prototype.listening = false; - - /** - * Creates a new Network instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network instance - */ - Network.create = function create(properties) { - return new Network(properties); - }; - - /** - * Encodes the specified Network message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Network.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chainId); - if (message.peersCount != null && Object.hasOwnProperty.call(message, "peersCount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.peersCount); - if (message.listening != null && Object.hasOwnProperty.call(message, "listening")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.listening); - return writer; - }; - - /** - * Encodes the specified Network message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Network.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Network message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Network.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.chainId = reader.string(); - break; - case 2: - message.peersCount = reader.uint32(); - break; - case 3: - message.listening = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Network message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Network.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Network message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Network.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chainId != null && message.hasOwnProperty("chainId")) - if (!$util.isString(message.chainId)) - return "chainId: string expected"; - if (message.peersCount != null && message.hasOwnProperty("peersCount")) - if (!$util.isInteger(message.peersCount)) - return "peersCount: integer expected"; - if (message.listening != null && message.hasOwnProperty("listening")) - if (typeof message.listening !== "boolean") - return "listening: boolean expected"; - return null; - }; - - /** - * Creates a Network message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network - */ - Network.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); - if (object.chainId != null) - message.chainId = String(object.chainId); - if (object.peersCount != null) - message.peersCount = object.peersCount >>> 0; - if (object.listening != null) - message.listening = Boolean(object.listening); - return message; - }; - - /** - * Creates a plain object from a Network message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} message Network - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Network.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chainId = ""; - object.peersCount = 0; - object.listening = false; - } - if (message.chainId != null && message.hasOwnProperty("chainId")) - object.chainId = message.chainId; - if (message.peersCount != null && message.hasOwnProperty("peersCount")) - object.peersCount = message.peersCount; - if (message.listening != null && message.hasOwnProperty("listening")) - object.listening = message.listening; - return object; - }; - - /** - * Converts this Network to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network - * @instance - * @returns {Object.} JSON object - */ - Network.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Network; - })(); - - GetStatusResponseV0.StateSync = (function() { - - /** - * Properties of a StateSync. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @interface IStateSync - * @property {number|Long|null} [totalSyncedTime] StateSync totalSyncedTime - * @property {number|Long|null} [remainingTime] StateSync remainingTime - * @property {number|null} [totalSnapshots] StateSync totalSnapshots - * @property {number|Long|null} [chunkProcessAvgTime] StateSync chunkProcessAvgTime - * @property {number|Long|null} [snapshotHeight] StateSync snapshotHeight - * @property {number|Long|null} [snapshotChunksCount] StateSync snapshotChunksCount - * @property {number|Long|null} [backfilledBlocks] StateSync backfilledBlocks - * @property {number|Long|null} [backfillBlocksTotal] StateSync backfillBlocksTotal - */ - - /** - * Constructs a new StateSync. - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 - * @classdesc Represents a StateSync. - * @implements IStateSync - * @constructor - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set - */ - function StateSync(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StateSync totalSyncedTime. - * @member {number|Long} totalSyncedTime - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.totalSyncedTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync remainingTime. - * @member {number|Long} remainingTime - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.remainingTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync totalSnapshots. - * @member {number} totalSnapshots - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.totalSnapshots = 0; - - /** - * StateSync chunkProcessAvgTime. - * @member {number|Long} chunkProcessAvgTime - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.chunkProcessAvgTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync snapshotHeight. - * @member {number|Long} snapshotHeight - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.snapshotHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync snapshotChunksCount. - * @member {number|Long} snapshotChunksCount - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.snapshotChunksCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync backfilledBlocks. - * @member {number|Long} backfilledBlocks - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.backfilledBlocks = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StateSync backfillBlocksTotal. - * @member {number|Long} backfillBlocksTotal - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - */ - StateSync.prototype.backfillBlocksTotal = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new StateSync instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync instance - */ - StateSync.create = function create(properties) { - return new StateSync(properties); - }; - - /** - * Encodes the specified StateSync message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateSync.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.totalSyncedTime != null && Object.hasOwnProperty.call(message, "totalSyncedTime")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.totalSyncedTime); - if (message.remainingTime != null && Object.hasOwnProperty.call(message, "remainingTime")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.remainingTime); - if (message.totalSnapshots != null && Object.hasOwnProperty.call(message, "totalSnapshots")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.totalSnapshots); - if (message.chunkProcessAvgTime != null && Object.hasOwnProperty.call(message, "chunkProcessAvgTime")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.chunkProcessAvgTime); - if (message.snapshotHeight != null && Object.hasOwnProperty.call(message, "snapshotHeight")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.snapshotHeight); - if (message.snapshotChunksCount != null && Object.hasOwnProperty.call(message, "snapshotChunksCount")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.snapshotChunksCount); - if (message.backfilledBlocks != null && Object.hasOwnProperty.call(message, "backfilledBlocks")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.backfilledBlocks); - if (message.backfillBlocksTotal != null && Object.hasOwnProperty.call(message, "backfillBlocksTotal")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.backfillBlocksTotal); - return writer; - }; - - /** - * Encodes the specified StateSync message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateSync.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StateSync message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateSync.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.totalSyncedTime = reader.uint64(); - break; - case 2: - message.remainingTime = reader.uint64(); - break; - case 3: - message.totalSnapshots = reader.uint32(); - break; - case 4: - message.chunkProcessAvgTime = reader.uint64(); - break; - case 5: - message.snapshotHeight = reader.uint64(); - break; - case 6: - message.snapshotChunksCount = reader.uint64(); - break; - case 7: - message.backfilledBlocks = reader.uint64(); - break; - case 8: - message.backfillBlocksTotal = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StateSync message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateSync.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StateSync message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StateSync.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) - if (!$util.isInteger(message.totalSyncedTime) && !(message.totalSyncedTime && $util.isInteger(message.totalSyncedTime.low) && $util.isInteger(message.totalSyncedTime.high))) - return "totalSyncedTime: integer|Long expected"; - if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) - if (!$util.isInteger(message.remainingTime) && !(message.remainingTime && $util.isInteger(message.remainingTime.low) && $util.isInteger(message.remainingTime.high))) - return "remainingTime: integer|Long expected"; - if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) - if (!$util.isInteger(message.totalSnapshots)) - return "totalSnapshots: integer expected"; - if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) - if (!$util.isInteger(message.chunkProcessAvgTime) && !(message.chunkProcessAvgTime && $util.isInteger(message.chunkProcessAvgTime.low) && $util.isInteger(message.chunkProcessAvgTime.high))) - return "chunkProcessAvgTime: integer|Long expected"; - if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) - if (!$util.isInteger(message.snapshotHeight) && !(message.snapshotHeight && $util.isInteger(message.snapshotHeight.low) && $util.isInteger(message.snapshotHeight.high))) - return "snapshotHeight: integer|Long expected"; - if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) - if (!$util.isInteger(message.snapshotChunksCount) && !(message.snapshotChunksCount && $util.isInteger(message.snapshotChunksCount.low) && $util.isInteger(message.snapshotChunksCount.high))) - return "snapshotChunksCount: integer|Long expected"; - if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) - if (!$util.isInteger(message.backfilledBlocks) && !(message.backfilledBlocks && $util.isInteger(message.backfilledBlocks.low) && $util.isInteger(message.backfilledBlocks.high))) - return "backfilledBlocks: integer|Long expected"; - if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) - if (!$util.isInteger(message.backfillBlocksTotal) && !(message.backfillBlocksTotal && $util.isInteger(message.backfillBlocksTotal.low) && $util.isInteger(message.backfillBlocksTotal.high))) - return "backfillBlocksTotal: integer|Long expected"; - return null; - }; - - /** - * Creates a StateSync message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync - */ - StateSync.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); - if (object.totalSyncedTime != null) - if ($util.Long) - (message.totalSyncedTime = $util.Long.fromValue(object.totalSyncedTime)).unsigned = true; - else if (typeof object.totalSyncedTime === "string") - message.totalSyncedTime = parseInt(object.totalSyncedTime, 10); - else if (typeof object.totalSyncedTime === "number") - message.totalSyncedTime = object.totalSyncedTime; - else if (typeof object.totalSyncedTime === "object") - message.totalSyncedTime = new $util.LongBits(object.totalSyncedTime.low >>> 0, object.totalSyncedTime.high >>> 0).toNumber(true); - if (object.remainingTime != null) - if ($util.Long) - (message.remainingTime = $util.Long.fromValue(object.remainingTime)).unsigned = true; - else if (typeof object.remainingTime === "string") - message.remainingTime = parseInt(object.remainingTime, 10); - else if (typeof object.remainingTime === "number") - message.remainingTime = object.remainingTime; - else if (typeof object.remainingTime === "object") - message.remainingTime = new $util.LongBits(object.remainingTime.low >>> 0, object.remainingTime.high >>> 0).toNumber(true); - if (object.totalSnapshots != null) - message.totalSnapshots = object.totalSnapshots >>> 0; - if (object.chunkProcessAvgTime != null) - if ($util.Long) - (message.chunkProcessAvgTime = $util.Long.fromValue(object.chunkProcessAvgTime)).unsigned = true; - else if (typeof object.chunkProcessAvgTime === "string") - message.chunkProcessAvgTime = parseInt(object.chunkProcessAvgTime, 10); - else if (typeof object.chunkProcessAvgTime === "number") - message.chunkProcessAvgTime = object.chunkProcessAvgTime; - else if (typeof object.chunkProcessAvgTime === "object") - message.chunkProcessAvgTime = new $util.LongBits(object.chunkProcessAvgTime.low >>> 0, object.chunkProcessAvgTime.high >>> 0).toNumber(true); - if (object.snapshotHeight != null) - if ($util.Long) - (message.snapshotHeight = $util.Long.fromValue(object.snapshotHeight)).unsigned = true; - else if (typeof object.snapshotHeight === "string") - message.snapshotHeight = parseInt(object.snapshotHeight, 10); - else if (typeof object.snapshotHeight === "number") - message.snapshotHeight = object.snapshotHeight; - else if (typeof object.snapshotHeight === "object") - message.snapshotHeight = new $util.LongBits(object.snapshotHeight.low >>> 0, object.snapshotHeight.high >>> 0).toNumber(true); - if (object.snapshotChunksCount != null) - if ($util.Long) - (message.snapshotChunksCount = $util.Long.fromValue(object.snapshotChunksCount)).unsigned = true; - else if (typeof object.snapshotChunksCount === "string") - message.snapshotChunksCount = parseInt(object.snapshotChunksCount, 10); - else if (typeof object.snapshotChunksCount === "number") - message.snapshotChunksCount = object.snapshotChunksCount; - else if (typeof object.snapshotChunksCount === "object") - message.snapshotChunksCount = new $util.LongBits(object.snapshotChunksCount.low >>> 0, object.snapshotChunksCount.high >>> 0).toNumber(true); - if (object.backfilledBlocks != null) - if ($util.Long) - (message.backfilledBlocks = $util.Long.fromValue(object.backfilledBlocks)).unsigned = true; - else if (typeof object.backfilledBlocks === "string") - message.backfilledBlocks = parseInt(object.backfilledBlocks, 10); - else if (typeof object.backfilledBlocks === "number") - message.backfilledBlocks = object.backfilledBlocks; - else if (typeof object.backfilledBlocks === "object") - message.backfilledBlocks = new $util.LongBits(object.backfilledBlocks.low >>> 0, object.backfilledBlocks.high >>> 0).toNumber(true); - if (object.backfillBlocksTotal != null) - if ($util.Long) - (message.backfillBlocksTotal = $util.Long.fromValue(object.backfillBlocksTotal)).unsigned = true; - else if (typeof object.backfillBlocksTotal === "string") - message.backfillBlocksTotal = parseInt(object.backfillBlocksTotal, 10); - else if (typeof object.backfillBlocksTotal === "number") - message.backfillBlocksTotal = object.backfillBlocksTotal; - else if (typeof object.backfillBlocksTotal === "object") - message.backfillBlocksTotal = new $util.LongBits(object.backfillBlocksTotal.low >>> 0, object.backfillBlocksTotal.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a StateSync message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @static - * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} message StateSync - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StateSync.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.totalSyncedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalSyncedTime = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.remainingTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.remainingTime = options.longs === String ? "0" : 0; - object.totalSnapshots = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.chunkProcessAvgTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.chunkProcessAvgTime = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.snapshotHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.snapshotHeight = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.snapshotChunksCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.snapshotChunksCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.backfilledBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backfilledBlocks = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.backfillBlocksTotal = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backfillBlocksTotal = options.longs === String ? "0" : 0; - } - if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) - if (typeof message.totalSyncedTime === "number") - object.totalSyncedTime = options.longs === String ? String(message.totalSyncedTime) : message.totalSyncedTime; - else - object.totalSyncedTime = options.longs === String ? $util.Long.prototype.toString.call(message.totalSyncedTime) : options.longs === Number ? new $util.LongBits(message.totalSyncedTime.low >>> 0, message.totalSyncedTime.high >>> 0).toNumber(true) : message.totalSyncedTime; - if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) - if (typeof message.remainingTime === "number") - object.remainingTime = options.longs === String ? String(message.remainingTime) : message.remainingTime; - else - object.remainingTime = options.longs === String ? $util.Long.prototype.toString.call(message.remainingTime) : options.longs === Number ? new $util.LongBits(message.remainingTime.low >>> 0, message.remainingTime.high >>> 0).toNumber(true) : message.remainingTime; - if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) - object.totalSnapshots = message.totalSnapshots; - if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) - if (typeof message.chunkProcessAvgTime === "number") - object.chunkProcessAvgTime = options.longs === String ? String(message.chunkProcessAvgTime) : message.chunkProcessAvgTime; - else - object.chunkProcessAvgTime = options.longs === String ? $util.Long.prototype.toString.call(message.chunkProcessAvgTime) : options.longs === Number ? new $util.LongBits(message.chunkProcessAvgTime.low >>> 0, message.chunkProcessAvgTime.high >>> 0).toNumber(true) : message.chunkProcessAvgTime; - if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) - if (typeof message.snapshotHeight === "number") - object.snapshotHeight = options.longs === String ? String(message.snapshotHeight) : message.snapshotHeight; - else - object.snapshotHeight = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotHeight) : options.longs === Number ? new $util.LongBits(message.snapshotHeight.low >>> 0, message.snapshotHeight.high >>> 0).toNumber(true) : message.snapshotHeight; - if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) - if (typeof message.snapshotChunksCount === "number") - object.snapshotChunksCount = options.longs === String ? String(message.snapshotChunksCount) : message.snapshotChunksCount; - else - object.snapshotChunksCount = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotChunksCount) : options.longs === Number ? new $util.LongBits(message.snapshotChunksCount.low >>> 0, message.snapshotChunksCount.high >>> 0).toNumber(true) : message.snapshotChunksCount; - if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) - if (typeof message.backfilledBlocks === "number") - object.backfilledBlocks = options.longs === String ? String(message.backfilledBlocks) : message.backfilledBlocks; - else - object.backfilledBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.backfilledBlocks) : options.longs === Number ? new $util.LongBits(message.backfilledBlocks.low >>> 0, message.backfilledBlocks.high >>> 0).toNumber(true) : message.backfilledBlocks; - if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) - if (typeof message.backfillBlocksTotal === "number") - object.backfillBlocksTotal = options.longs === String ? String(message.backfillBlocksTotal) : message.backfillBlocksTotal; - else - object.backfillBlocksTotal = options.longs === String ? $util.Long.prototype.toString.call(message.backfillBlocksTotal) : options.longs === Number ? new $util.LongBits(message.backfillBlocksTotal.low >>> 0, message.backfillBlocksTotal.high >>> 0).toNumber(true) : message.backfillBlocksTotal; - return object; - }; - - /** - * Converts this StateSync to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync - * @instance - * @returns {Object.} JSON object - */ - StateSync.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StateSync; - })(); - - return GetStatusResponseV0; - })(); - - return GetStatusResponse; - })(); - - v0.GetCurrentQuorumsInfoRequest = (function() { - - /** - * Properties of a GetCurrentQuorumsInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetCurrentQuorumsInfoRequest - * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null} [v0] GetCurrentQuorumsInfoRequest v0 - */ - - /** - * Constructs a new GetCurrentQuorumsInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetCurrentQuorumsInfoRequest. - * @implements IGetCurrentQuorumsInfoRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set - */ - function GetCurrentQuorumsInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCurrentQuorumsInfoRequest v0. - * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @instance - */ - GetCurrentQuorumsInfoRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetCurrentQuorumsInfoRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @instance - */ - Object.defineProperty(GetCurrentQuorumsInfoRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetCurrentQuorumsInfoRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest instance - */ - GetCurrentQuorumsInfoRequest.create = function create(properties) { - return new GetCurrentQuorumsInfoRequest(properties); - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCurrentQuorumsInfoRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCurrentQuorumsInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetCurrentQuorumsInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest - */ - GetCurrentQuorumsInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetCurrentQuorumsInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCurrentQuorumsInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetCurrentQuorumsInfoRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetCurrentQuorumsInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 = (function() { - - /** - * Properties of a GetCurrentQuorumsInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @interface IGetCurrentQuorumsInfoRequestV0 - */ - - /** - * Constructs a new GetCurrentQuorumsInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest - * @classdesc Represents a GetCurrentQuorumsInfoRequestV0. - * @implements IGetCurrentQuorumsInfoRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set - */ - function GetCurrentQuorumsInfoRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new GetCurrentQuorumsInfoRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 instance - */ - GetCurrentQuorumsInfoRequestV0.create = function create(properties) { - return new GetCurrentQuorumsInfoRequestV0(properties); - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCurrentQuorumsInfoRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCurrentQuorumsInfoRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a GetCurrentQuorumsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 - */ - GetCurrentQuorumsInfoRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0) - return object; - return new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); - }; - - /** - * Creates a plain object from a GetCurrentQuorumsInfoRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCurrentQuorumsInfoRequestV0.toObject = function toObject() { - return {}; - }; - - /** - * Converts this GetCurrentQuorumsInfoRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetCurrentQuorumsInfoRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetCurrentQuorumsInfoRequestV0; - })(); - - return GetCurrentQuorumsInfoRequest; - })(); - - v0.GetCurrentQuorumsInfoResponse = (function() { - - /** - * Properties of a GetCurrentQuorumsInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetCurrentQuorumsInfoResponse - * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null} [v0] GetCurrentQuorumsInfoResponse v0 - */ - - /** - * Constructs a new GetCurrentQuorumsInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetCurrentQuorumsInfoResponse. - * @implements IGetCurrentQuorumsInfoResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set - */ - function GetCurrentQuorumsInfoResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCurrentQuorumsInfoResponse v0. - * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @instance - */ - GetCurrentQuorumsInfoResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetCurrentQuorumsInfoResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @instance - */ - Object.defineProperty(GetCurrentQuorumsInfoResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetCurrentQuorumsInfoResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse instance - */ - GetCurrentQuorumsInfoResponse.create = function create(properties) { - return new GetCurrentQuorumsInfoResponse(properties); - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCurrentQuorumsInfoResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCurrentQuorumsInfoResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetCurrentQuorumsInfoResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse - */ - GetCurrentQuorumsInfoResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetCurrentQuorumsInfoResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCurrentQuorumsInfoResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetCurrentQuorumsInfoResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @instance - * @returns {Object.} JSON object - */ - GetCurrentQuorumsInfoResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetCurrentQuorumsInfoResponse.ValidatorV0 = (function() { - - /** - * Properties of a ValidatorV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @interface IValidatorV0 - * @property {Uint8Array|null} [proTxHash] ValidatorV0 proTxHash - * @property {string|null} [nodeIp] ValidatorV0 nodeIp - * @property {boolean|null} [isBanned] ValidatorV0 isBanned - */ - - /** - * Constructs a new ValidatorV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @classdesc Represents a ValidatorV0. - * @implements IValidatorV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set - */ - function ValidatorV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorV0 proTxHash. - * @member {Uint8Array} proTxHash - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @instance - */ - ValidatorV0.prototype.proTxHash = $util.newBuffer([]); - - /** - * ValidatorV0 nodeIp. - * @member {string} nodeIp - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @instance - */ - ValidatorV0.prototype.nodeIp = ""; - - /** - * ValidatorV0 isBanned. - * @member {boolean} isBanned - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @instance - */ - ValidatorV0.prototype.isBanned = false; - - /** - * Creates a new ValidatorV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 instance - */ - ValidatorV0.create = function create(properties) { - return new ValidatorV0(properties); - }; - - /** - * Encodes the specified ValidatorV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); - if (message.nodeIp != null && Object.hasOwnProperty.call(message, "nodeIp")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIp); - if (message.isBanned != null && Object.hasOwnProperty.call(message, "isBanned")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isBanned); - return writer; - }; - - /** - * Encodes the specified ValidatorV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proTxHash = reader.bytes(); - break; - case 2: - message.nodeIp = reader.string(); - break; - case 3: - message.isBanned = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) - return "proTxHash: buffer expected"; - if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) - if (!$util.isString(message.nodeIp)) - return "nodeIp: string expected"; - if (message.isBanned != null && message.hasOwnProperty("isBanned")) - if (typeof message.isBanned !== "boolean") - return "isBanned: boolean expected"; - return null; - }; - - /** - * Creates a ValidatorV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 - */ - ValidatorV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); - if (object.proTxHash != null) - if (typeof object.proTxHash === "string") - $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); - else if (object.proTxHash.length >= 0) - message.proTxHash = object.proTxHash; - if (object.nodeIp != null) - message.nodeIp = String(object.nodeIp); - if (object.isBanned != null) - message.isBanned = Boolean(object.isBanned); - return message; - }; - - /** - * Creates a plain object from a ValidatorV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} message ValidatorV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.proTxHash = ""; - else { - object.proTxHash = []; - if (options.bytes !== Array) - object.proTxHash = $util.newBuffer(object.proTxHash); - } - object.nodeIp = ""; - object.isBanned = false; - } - if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) - object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; - if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) - object.nodeIp = message.nodeIp; - if (message.isBanned != null && message.hasOwnProperty("isBanned")) - object.isBanned = message.isBanned; - return object; - }; - - /** - * Converts this ValidatorV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 - * @instance - * @returns {Object.} JSON object - */ - ValidatorV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorV0; - })(); - - GetCurrentQuorumsInfoResponse.ValidatorSetV0 = (function() { - - /** - * Properties of a ValidatorSetV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @interface IValidatorSetV0 - * @property {Uint8Array|null} [quorumHash] ValidatorSetV0 quorumHash - * @property {number|null} [coreHeight] ValidatorSetV0 coreHeight - * @property {Array.|null} [members] ValidatorSetV0 members - * @property {Uint8Array|null} [thresholdPublicKey] ValidatorSetV0 thresholdPublicKey - */ - - /** - * Constructs a new ValidatorSetV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @classdesc Represents a ValidatorSetV0. - * @implements IValidatorSetV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set - */ - function ValidatorSetV0(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorSetV0 quorumHash. - * @member {Uint8Array} quorumHash - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - */ - ValidatorSetV0.prototype.quorumHash = $util.newBuffer([]); - - /** - * ValidatorSetV0 coreHeight. - * @member {number} coreHeight - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - */ - ValidatorSetV0.prototype.coreHeight = 0; - - /** - * ValidatorSetV0 members. - * @member {Array.} members - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - */ - ValidatorSetV0.prototype.members = $util.emptyArray; - - /** - * ValidatorSetV0 thresholdPublicKey. - * @member {Uint8Array} thresholdPublicKey - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - */ - ValidatorSetV0.prototype.thresholdPublicKey = $util.newBuffer([]); - - /** - * Creates a new ValidatorSetV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 instance - */ - ValidatorSetV0.create = function create(properties) { - return new ValidatorSetV0(properties); - }; - - /** - * Encodes the specified ValidatorSetV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSetV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHash); - if (message.coreHeight != null && Object.hasOwnProperty.call(message, "coreHeight")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreHeight); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.encode(message.members[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.thresholdPublicKey != null && Object.hasOwnProperty.call(message, "thresholdPublicKey")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.thresholdPublicKey); - return writer; - }; - - /** - * Encodes the specified ValidatorSetV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSetV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorSetV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSetV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quorumHash = reader.bytes(); - break; - case 2: - message.coreHeight = reader.uint32(); - break; - case 3: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.decode(reader, reader.uint32())); - break; - case 4: - message.thresholdPublicKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorSetV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSetV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorSetV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorSetV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) - if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) - return "quorumHash: buffer expected"; - if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) - if (!$util.isInteger(message.coreHeight)) - return "coreHeight: integer expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify(message.members[i]); - if (error) - return "members." + error; - } - } - if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) - if (!(message.thresholdPublicKey && typeof message.thresholdPublicKey.length === "number" || $util.isString(message.thresholdPublicKey))) - return "thresholdPublicKey: buffer expected"; - return null; - }; - - /** - * Creates a ValidatorSetV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 - */ - ValidatorSetV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); - if (object.quorumHash != null) - if (typeof object.quorumHash === "string") - $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); - else if (object.quorumHash.length >= 0) - message.quorumHash = object.quorumHash; - if (object.coreHeight != null) - message.coreHeight = object.coreHeight >>> 0; - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) { - if (typeof object.members[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: object expected"); - message.members[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.fromObject(object.members[i]); - } - } - if (object.thresholdPublicKey != null) - if (typeof object.thresholdPublicKey === "string") - $util.base64.decode(object.thresholdPublicKey, message.thresholdPublicKey = $util.newBuffer($util.base64.length(object.thresholdPublicKey)), 0); - else if (object.thresholdPublicKey.length >= 0) - message.thresholdPublicKey = object.thresholdPublicKey; - return message; - }; - - /** - * Creates a plain object from a ValidatorSetV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} message ValidatorSetV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorSetV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - if (options.bytes === String) - object.quorumHash = ""; - else { - object.quorumHash = []; - if (options.bytes !== Array) - object.quorumHash = $util.newBuffer(object.quorumHash); - } - object.coreHeight = 0; - if (options.bytes === String) - object.thresholdPublicKey = ""; - else { - object.thresholdPublicKey = []; - if (options.bytes !== Array) - object.thresholdPublicKey = $util.newBuffer(object.thresholdPublicKey); - } - } - if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) - object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; - if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) - object.coreHeight = message.coreHeight; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject(message.members[j], options); - } - if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) - object.thresholdPublicKey = options.bytes === String ? $util.base64.encode(message.thresholdPublicKey, 0, message.thresholdPublicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.thresholdPublicKey) : message.thresholdPublicKey; - return object; - }; - - /** - * Converts this ValidatorSetV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 - * @instance - * @returns {Object.} JSON object - */ - ValidatorSetV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorSetV0; - })(); - - GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 = (function() { - - /** - * Properties of a GetCurrentQuorumsInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @interface IGetCurrentQuorumsInfoResponseV0 - * @property {Array.|null} [quorumHashes] GetCurrentQuorumsInfoResponseV0 quorumHashes - * @property {Uint8Array|null} [currentQuorumHash] GetCurrentQuorumsInfoResponseV0 currentQuorumHash - * @property {Array.|null} [validatorSets] GetCurrentQuorumsInfoResponseV0 validatorSets - * @property {Uint8Array|null} [lastBlockProposer] GetCurrentQuorumsInfoResponseV0 lastBlockProposer - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetCurrentQuorumsInfoResponseV0 metadata - */ - - /** - * Constructs a new GetCurrentQuorumsInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse - * @classdesc Represents a GetCurrentQuorumsInfoResponseV0. - * @implements IGetCurrentQuorumsInfoResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set - */ - function GetCurrentQuorumsInfoResponseV0(properties) { - this.quorumHashes = []; - this.validatorSets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetCurrentQuorumsInfoResponseV0 quorumHashes. - * @member {Array.} quorumHashes - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.quorumHashes = $util.emptyArray; - - /** - * GetCurrentQuorumsInfoResponseV0 currentQuorumHash. - * @member {Uint8Array} currentQuorumHash - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.currentQuorumHash = $util.newBuffer([]); - - /** - * GetCurrentQuorumsInfoResponseV0 validatorSets. - * @member {Array.} validatorSets - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.validatorSets = $util.emptyArray; - - /** - * GetCurrentQuorumsInfoResponseV0 lastBlockProposer. - * @member {Uint8Array} lastBlockProposer - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.lastBlockProposer = $util.newBuffer([]); - - /** - * GetCurrentQuorumsInfoResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - */ - GetCurrentQuorumsInfoResponseV0.prototype.metadata = null; - - /** - * Creates a new GetCurrentQuorumsInfoResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 instance - */ - GetCurrentQuorumsInfoResponseV0.create = function create(properties) { - return new GetCurrentQuorumsInfoResponseV0(properties); - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorumHashes != null && message.quorumHashes.length) - for (var i = 0; i < message.quorumHashes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHashes[i]); - if (message.currentQuorumHash != null && Object.hasOwnProperty.call(message, "currentQuorumHash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.currentQuorumHash); - if (message.validatorSets != null && message.validatorSets.length) - for (var i = 0; i < message.validatorSets.length; ++i) - $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.encode(message.validatorSets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.lastBlockProposer != null && Object.hasOwnProperty.call(message, "lastBlockProposer")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.lastBlockProposer); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetCurrentQuorumsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetCurrentQuorumsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.quorumHashes && message.quorumHashes.length)) - message.quorumHashes = []; - message.quorumHashes.push(reader.bytes()); - break; - case 2: - message.currentQuorumHash = reader.bytes(); - break; - case 3: - if (!(message.validatorSets && message.validatorSets.length)) - message.validatorSets = []; - message.validatorSets.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.decode(reader, reader.uint32())); - break; - case 4: - message.lastBlockProposer = reader.bytes(); - break; - case 5: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetCurrentQuorumsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetCurrentQuorumsInfoResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetCurrentQuorumsInfoResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorumHashes != null && message.hasOwnProperty("quorumHashes")) { - if (!Array.isArray(message.quorumHashes)) - return "quorumHashes: array expected"; - for (var i = 0; i < message.quorumHashes.length; ++i) - if (!(message.quorumHashes[i] && typeof message.quorumHashes[i].length === "number" || $util.isString(message.quorumHashes[i]))) - return "quorumHashes: buffer[] expected"; - } - if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) - if (!(message.currentQuorumHash && typeof message.currentQuorumHash.length === "number" || $util.isString(message.currentQuorumHash))) - return "currentQuorumHash: buffer expected"; - if (message.validatorSets != null && message.hasOwnProperty("validatorSets")) { - if (!Array.isArray(message.validatorSets)) - return "validatorSets: array expected"; - for (var i = 0; i < message.validatorSets.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify(message.validatorSets[i]); - if (error) - return "validatorSets." + error; - } - } - if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) - if (!(message.lastBlockProposer && typeof message.lastBlockProposer.length === "number" || $util.isString(message.lastBlockProposer))) - return "lastBlockProposer: buffer expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetCurrentQuorumsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 - */ - GetCurrentQuorumsInfoResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); - if (object.quorumHashes) { - if (!Array.isArray(object.quorumHashes)) - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.quorumHashes: array expected"); - message.quorumHashes = []; - for (var i = 0; i < object.quorumHashes.length; ++i) - if (typeof object.quorumHashes[i] === "string") - $util.base64.decode(object.quorumHashes[i], message.quorumHashes[i] = $util.newBuffer($util.base64.length(object.quorumHashes[i])), 0); - else if (object.quorumHashes[i].length >= 0) - message.quorumHashes[i] = object.quorumHashes[i]; - } - if (object.currentQuorumHash != null) - if (typeof object.currentQuorumHash === "string") - $util.base64.decode(object.currentQuorumHash, message.currentQuorumHash = $util.newBuffer($util.base64.length(object.currentQuorumHash)), 0); - else if (object.currentQuorumHash.length >= 0) - message.currentQuorumHash = object.currentQuorumHash; - if (object.validatorSets) { - if (!Array.isArray(object.validatorSets)) - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: array expected"); - message.validatorSets = []; - for (var i = 0; i < object.validatorSets.length; ++i) { - if (typeof object.validatorSets[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: object expected"); - message.validatorSets[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.fromObject(object.validatorSets[i]); - } - } - if (object.lastBlockProposer != null) - if (typeof object.lastBlockProposer === "string") - $util.base64.decode(object.lastBlockProposer, message.lastBlockProposer = $util.newBuffer($util.base64.length(object.lastBlockProposer)), 0); - else if (object.lastBlockProposer.length >= 0) - message.lastBlockProposer = object.lastBlockProposer; - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetCurrentQuorumsInfoResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetCurrentQuorumsInfoResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.quorumHashes = []; - object.validatorSets = []; - } - if (options.defaults) { - if (options.bytes === String) - object.currentQuorumHash = ""; - else { - object.currentQuorumHash = []; - if (options.bytes !== Array) - object.currentQuorumHash = $util.newBuffer(object.currentQuorumHash); - } - if (options.bytes === String) - object.lastBlockProposer = ""; - else { - object.lastBlockProposer = []; - if (options.bytes !== Array) - object.lastBlockProposer = $util.newBuffer(object.lastBlockProposer); - } - object.metadata = null; - } - if (message.quorumHashes && message.quorumHashes.length) { - object.quorumHashes = []; - for (var j = 0; j < message.quorumHashes.length; ++j) - object.quorumHashes[j] = options.bytes === String ? $util.base64.encode(message.quorumHashes[j], 0, message.quorumHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHashes[j]) : message.quorumHashes[j]; - } - if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) - object.currentQuorumHash = options.bytes === String ? $util.base64.encode(message.currentQuorumHash, 0, message.currentQuorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.currentQuorumHash) : message.currentQuorumHash; - if (message.validatorSets && message.validatorSets.length) { - object.validatorSets = []; - for (var j = 0; j < message.validatorSets.length; ++j) - object.validatorSets[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject(message.validatorSets[j], options); - } - if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) - object.lastBlockProposer = options.bytes === String ? $util.base64.encode(message.lastBlockProposer, 0, message.lastBlockProposer.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockProposer) : message.lastBlockProposer; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetCurrentQuorumsInfoResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetCurrentQuorumsInfoResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetCurrentQuorumsInfoResponseV0; - })(); - - return GetCurrentQuorumsInfoResponse; - })(); - - v0.GetIdentityTokenBalancesRequest = (function() { - - /** - * Properties of a GetIdentityTokenBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityTokenBalancesRequest - * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null} [v0] GetIdentityTokenBalancesRequest v0 - */ - - /** - * Constructs a new GetIdentityTokenBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityTokenBalancesRequest. - * @implements IGetIdentityTokenBalancesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set - */ - function GetIdentityTokenBalancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenBalancesRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @instance - */ - GetIdentityTokenBalancesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenBalancesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @instance - */ - Object.defineProperty(GetIdentityTokenBalancesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenBalancesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest instance - */ - GetIdentityTokenBalancesRequest.create = function create(properties) { - return new GetIdentityTokenBalancesRequest(properties); - }; - - /** - * Encodes the specified GetIdentityTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenBalancesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenBalancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest - */ - GetIdentityTokenBalancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenBalancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenBalancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityTokenBalancesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenBalancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 = (function() { - - /** - * Properties of a GetIdentityTokenBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @interface IGetIdentityTokenBalancesRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityTokenBalancesRequestV0 identityId - * @property {Array.|null} [tokenIds] GetIdentityTokenBalancesRequestV0 tokenIds - * @property {boolean|null} [prove] GetIdentityTokenBalancesRequestV0 prove - */ - - /** - * Constructs a new GetIdentityTokenBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest - * @classdesc Represents a GetIdentityTokenBalancesRequestV0. - * @implements IGetIdentityTokenBalancesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set - */ - function GetIdentityTokenBalancesRequestV0(properties) { - this.tokenIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenBalancesRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @instance - */ - GetIdentityTokenBalancesRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityTokenBalancesRequestV0 tokenIds. - * @member {Array.} tokenIds - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @instance - */ - GetIdentityTokenBalancesRequestV0.prototype.tokenIds = $util.emptyArray; - - /** - * GetIdentityTokenBalancesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @instance - */ - GetIdentityTokenBalancesRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityTokenBalancesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 instance - */ - GetIdentityTokenBalancesRequestV0.create = function create(properties) { - return new GetIdentityTokenBalancesRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.tokenIds != null && message.tokenIds.length) - for (var i = 0; i < message.tokenIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - if (!(message.tokenIds && message.tokenIds.length)) - message.tokenIds = []; - message.tokenIds.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenBalancesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenBalancesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { - if (!Array.isArray(message.tokenIds)) - return "tokenIds: array expected"; - for (var i = 0; i < message.tokenIds.length; ++i) - if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) - return "tokenIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 - */ - GetIdentityTokenBalancesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.tokenIds) { - if (!Array.isArray(object.tokenIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.tokenIds: array expected"); - message.tokenIds = []; - for (var i = 0; i < object.tokenIds.length; ++i) - if (typeof object.tokenIds[i] === "string") - $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); - else if (object.tokenIds[i].length >= 0) - message.tokenIds[i] = object.tokenIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenBalancesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenBalancesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenIds = []; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.tokenIds && message.tokenIds.length) { - object.tokenIds = []; - for (var j = 0; j < message.tokenIds.length; ++j) - object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityTokenBalancesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenBalancesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityTokenBalancesRequestV0; - })(); - - return GetIdentityTokenBalancesRequest; - })(); - - v0.GetIdentityTokenBalancesResponse = (function() { - - /** - * Properties of a GetIdentityTokenBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityTokenBalancesResponse - * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null} [v0] GetIdentityTokenBalancesResponse v0 - */ - - /** - * Constructs a new GetIdentityTokenBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityTokenBalancesResponse. - * @implements IGetIdentityTokenBalancesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set - */ - function GetIdentityTokenBalancesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenBalancesResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @instance - */ - GetIdentityTokenBalancesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenBalancesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @instance - */ - Object.defineProperty(GetIdentityTokenBalancesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenBalancesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse instance - */ - GetIdentityTokenBalancesResponse.create = function create(properties) { - return new GetIdentityTokenBalancesResponse(properties); - }; - - /** - * Encodes the specified GetIdentityTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenBalancesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenBalancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse - */ - GetIdentityTokenBalancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenBalancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenBalancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityTokenBalancesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenBalancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 = (function() { - - /** - * Properties of a GetIdentityTokenBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @interface IGetIdentityTokenBalancesResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null} [tokenBalances] GetIdentityTokenBalancesResponseV0 tokenBalances - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenBalancesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenBalancesResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityTokenBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse - * @classdesc Represents a GetIdentityTokenBalancesResponseV0. - * @implements IGetIdentityTokenBalancesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set - */ - function GetIdentityTokenBalancesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenBalancesResponseV0 tokenBalances. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null|undefined} tokenBalances - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - */ - GetIdentityTokenBalancesResponseV0.prototype.tokenBalances = null; - - /** - * GetIdentityTokenBalancesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - */ - GetIdentityTokenBalancesResponseV0.prototype.proof = null; - - /** - * GetIdentityTokenBalancesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - */ - GetIdentityTokenBalancesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenBalancesResponseV0 result. - * @member {"tokenBalances"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityTokenBalancesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenBalances", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenBalancesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 instance - */ - GetIdentityTokenBalancesResponseV0.create = function create(properties) { - return new GetIdentityTokenBalancesResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenBalances != null && Object.hasOwnProperty.call(message, "tokenBalances")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.encode(message.tokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenBalancesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenBalancesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify(message.tokenBalances); - if (error) - return "tokenBalances." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 - */ - GetIdentityTokenBalancesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); - if (object.tokenBalances != null) { - if (typeof object.tokenBalances !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.tokenBalances: object expected"); - message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.fromObject(object.tokenBalances); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenBalancesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenBalancesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { - object.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.toObject(message.tokenBalances, options); - if (options.oneofs) - object.result = "tokenBalances"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityTokenBalancesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenBalancesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenBalancesResponseV0.TokenBalanceEntry = (function() { - - /** - * Properties of a TokenBalanceEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @interface ITokenBalanceEntry - * @property {Uint8Array|null} [tokenId] TokenBalanceEntry tokenId - * @property {number|Long|null} [balance] TokenBalanceEntry balance - */ - - /** - * Constructs a new TokenBalanceEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @classdesc Represents a TokenBalanceEntry. - * @implements ITokenBalanceEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set - */ - function TokenBalanceEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenBalanceEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @instance - */ - TokenBalanceEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenBalanceEntry balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @instance - */ - TokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new TokenBalanceEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry instance - */ - TokenBalanceEntry.create = function create(properties) { - return new TokenBalanceEntry(properties); - }; - - /** - * Encodes the specified TokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenBalanceEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); - return writer; - }; - - /** - * Encodes the specified TokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenBalanceEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenBalanceEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.balance = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenBalanceEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenBalanceEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenBalanceEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.balance != null && message.hasOwnProperty("balance")) - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - return null; - }; - - /** - * Creates a TokenBalanceEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry - */ - TokenBalanceEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TokenBalanceEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} message TokenBalanceEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenBalanceEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.balance = options.longs === String ? "0" : 0; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.balance != null && message.hasOwnProperty("balance")) - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - return object; - }; - - /** - * Converts this TokenBalanceEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry - * @instance - * @returns {Object.} JSON object - */ - TokenBalanceEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenBalanceEntry; - })(); - - GetIdentityTokenBalancesResponseV0.TokenBalances = (function() { - - /** - * Properties of a TokenBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @interface ITokenBalances - * @property {Array.|null} [tokenBalances] TokenBalances tokenBalances - */ - - /** - * Constructs a new TokenBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 - * @classdesc Represents a TokenBalances. - * @implements ITokenBalances - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set - */ - function TokenBalances(properties) { - this.tokenBalances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenBalances tokenBalances. - * @member {Array.} tokenBalances - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @instance - */ - TokenBalances.prototype.tokenBalances = $util.emptyArray; - - /** - * Creates a new TokenBalances instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances instance - */ - TokenBalances.create = function create(properties) { - return new TokenBalances(properties); - }; - - /** - * Encodes the specified TokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenBalances.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenBalances != null && message.tokenBalances.length) - for (var i = 0; i < message.tokenBalances.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.encode(message.tokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenBalances.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenBalances message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenBalances.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenBalances && message.tokenBalances.length)) - message.tokenBalances = []; - message.tokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenBalances message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenBalances.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenBalances message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenBalances.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { - if (!Array.isArray(message.tokenBalances)) - return "tokenBalances: array expected"; - for (var i = 0; i < message.tokenBalances.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify(message.tokenBalances[i]); - if (error) - return "tokenBalances." + error; - } - } - return null; - }; - - /** - * Creates a TokenBalances message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances - */ - TokenBalances.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); - if (object.tokenBalances) { - if (!Array.isArray(object.tokenBalances)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: array expected"); - message.tokenBalances = []; - for (var i = 0; i < object.tokenBalances.length; ++i) { - if (typeof object.tokenBalances[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: object expected"); - message.tokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.fromObject(object.tokenBalances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenBalances message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} message TokenBalances - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenBalances.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenBalances = []; - if (message.tokenBalances && message.tokenBalances.length) { - object.tokenBalances = []; - for (var j = 0; j < message.tokenBalances.length; ++j) - object.tokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.toObject(message.tokenBalances[j], options); - } - return object; - }; - - /** - * Converts this TokenBalances to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances - * @instance - * @returns {Object.} JSON object - */ - TokenBalances.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenBalances; - })(); - - return GetIdentityTokenBalancesResponseV0; - })(); - - return GetIdentityTokenBalancesResponse; - })(); - - v0.GetIdentitiesTokenBalancesRequest = (function() { - - /** - * Properties of a GetIdentitiesTokenBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesTokenBalancesRequest - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null} [v0] GetIdentitiesTokenBalancesRequest v0 - */ - - /** - * Constructs a new GetIdentitiesTokenBalancesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesTokenBalancesRequest. - * @implements IGetIdentitiesTokenBalancesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set - */ - function GetIdentitiesTokenBalancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenBalancesRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @instance - */ - GetIdentitiesTokenBalancesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenBalancesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @instance - */ - Object.defineProperty(GetIdentitiesTokenBalancesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenBalancesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest instance - */ - GetIdentitiesTokenBalancesRequest.create = function create(properties) { - return new GetIdentitiesTokenBalancesRequest(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenBalancesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenBalancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest - */ - GetIdentitiesTokenBalancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenBalancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenBalancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesTokenBalancesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenBalancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 = (function() { - - /** - * Properties of a GetIdentitiesTokenBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @interface IGetIdentitiesTokenBalancesRequestV0 - * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenBalancesRequestV0 tokenId - * @property {Array.|null} [identityIds] GetIdentitiesTokenBalancesRequestV0 identityIds - * @property {boolean|null} [prove] GetIdentitiesTokenBalancesRequestV0 prove - */ - - /** - * Constructs a new GetIdentitiesTokenBalancesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest - * @classdesc Represents a GetIdentitiesTokenBalancesRequestV0. - * @implements IGetIdentitiesTokenBalancesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set - */ - function GetIdentitiesTokenBalancesRequestV0(properties) { - this.identityIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenBalancesRequestV0 tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @instance - */ - GetIdentitiesTokenBalancesRequestV0.prototype.tokenId = $util.newBuffer([]); - - /** - * GetIdentitiesTokenBalancesRequestV0 identityIds. - * @member {Array.} identityIds - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @instance - */ - GetIdentitiesTokenBalancesRequestV0.prototype.identityIds = $util.emptyArray; - - /** - * GetIdentitiesTokenBalancesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @instance - */ - GetIdentitiesTokenBalancesRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentitiesTokenBalancesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 instance - */ - GetIdentitiesTokenBalancesRequestV0.create = function create(properties) { - return new GetIdentitiesTokenBalancesRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.identityIds != null && message.identityIds.length) - for (var i = 0; i < message.identityIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - if (!(message.identityIds && message.identityIds.length)) - message.identityIds = []; - message.identityIds.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenBalancesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenBalancesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.identityIds != null && message.hasOwnProperty("identityIds")) { - if (!Array.isArray(message.identityIds)) - return "identityIds: array expected"; - for (var i = 0; i < message.identityIds.length; ++i) - if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) - return "identityIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentitiesTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 - */ - GetIdentitiesTokenBalancesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.identityIds) { - if (!Array.isArray(object.identityIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.identityIds: array expected"); - message.identityIds = []; - for (var i = 0; i < object.identityIds.length; ++i) - if (typeof object.identityIds[i] === "string") - $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); - else if (object.identityIds[i].length >= 0) - message.identityIds[i] = object.identityIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenBalancesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenBalancesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.identityIds = []; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.prove = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.identityIds && message.identityIds.length) { - object.identityIds = []; - for (var j = 0; j < message.identityIds.length; ++j) - object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentitiesTokenBalancesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenBalancesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesTokenBalancesRequestV0; - })(); - - return GetIdentitiesTokenBalancesRequest; - })(); - - v0.GetIdentitiesTokenBalancesResponse = (function() { - - /** - * Properties of a GetIdentitiesTokenBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesTokenBalancesResponse - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null} [v0] GetIdentitiesTokenBalancesResponse v0 - */ - - /** - * Constructs a new GetIdentitiesTokenBalancesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesTokenBalancesResponse. - * @implements IGetIdentitiesTokenBalancesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set - */ - function GetIdentitiesTokenBalancesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenBalancesResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @instance - */ - GetIdentitiesTokenBalancesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenBalancesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @instance - */ - Object.defineProperty(GetIdentitiesTokenBalancesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenBalancesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse instance - */ - GetIdentitiesTokenBalancesResponse.create = function create(properties) { - return new GetIdentitiesTokenBalancesResponse(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenBalancesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenBalancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse - */ - GetIdentitiesTokenBalancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenBalancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenBalancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesTokenBalancesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenBalancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 = (function() { - - /** - * Properties of a GetIdentitiesTokenBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @interface IGetIdentitiesTokenBalancesResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null} [identityTokenBalances] GetIdentitiesTokenBalancesResponseV0 identityTokenBalances - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenBalancesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenBalancesResponseV0 metadata - */ - - /** - * Constructs a new GetIdentitiesTokenBalancesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse - * @classdesc Represents a GetIdentitiesTokenBalancesResponseV0. - * @implements IGetIdentitiesTokenBalancesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set - */ - function GetIdentitiesTokenBalancesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenBalancesResponseV0 identityTokenBalances. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null|undefined} identityTokenBalances - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - */ - GetIdentitiesTokenBalancesResponseV0.prototype.identityTokenBalances = null; - - /** - * GetIdentitiesTokenBalancesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - */ - GetIdentitiesTokenBalancesResponseV0.prototype.proof = null; - - /** - * GetIdentitiesTokenBalancesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - */ - GetIdentitiesTokenBalancesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenBalancesResponseV0 result. - * @member {"identityTokenBalances"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - */ - Object.defineProperty(GetIdentitiesTokenBalancesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identityTokenBalances", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenBalancesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 instance - */ - GetIdentitiesTokenBalancesResponseV0.create = function create(properties) { - return new GetIdentitiesTokenBalancesResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityTokenBalances != null && Object.hasOwnProperty.call(message, "identityTokenBalances")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.encode(message.identityTokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenBalancesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenBalancesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify(message.identityTokenBalances); - if (error) - return "identityTokenBalances." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 - */ - GetIdentitiesTokenBalancesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); - if (object.identityTokenBalances != null) { - if (typeof object.identityTokenBalances !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.identityTokenBalances: object expected"); - message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.fromObject(object.identityTokenBalances); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenBalancesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenBalancesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { - object.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.toObject(message.identityTokenBalances, options); - if (options.oneofs) - object.result = "identityTokenBalances"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentitiesTokenBalancesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenBalancesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry = (function() { - - /** - * Properties of an IdentityTokenBalanceEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @interface IIdentityTokenBalanceEntry - * @property {Uint8Array|null} [identityId] IdentityTokenBalanceEntry identityId - * @property {number|Long|null} [balance] IdentityTokenBalanceEntry balance - */ - - /** - * Constructs a new IdentityTokenBalanceEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @classdesc Represents an IdentityTokenBalanceEntry. - * @implements IIdentityTokenBalanceEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set - */ - function IdentityTokenBalanceEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityTokenBalanceEntry identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @instance - */ - IdentityTokenBalanceEntry.prototype.identityId = $util.newBuffer([]); - - /** - * IdentityTokenBalanceEntry balance. - * @member {number|Long} balance - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @instance - */ - IdentityTokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new IdentityTokenBalanceEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry instance - */ - IdentityTokenBalanceEntry.create = function create(properties) { - return new IdentityTokenBalanceEntry(properties); - }; - - /** - * Encodes the specified IdentityTokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalanceEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); - return writer; - }; - - /** - * Encodes the specified IdentityTokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalanceEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.balance = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityTokenBalanceEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityTokenBalanceEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.balance != null && message.hasOwnProperty("balance")) - if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) - return "balance: integer|Long expected"; - return null; - }; - - /** - * Creates an IdentityTokenBalanceEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry - */ - IdentityTokenBalanceEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.balance != null) - if ($util.Long) - (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; - else if (typeof object.balance === "string") - message.balance = parseInt(object.balance, 10); - else if (typeof object.balance === "number") - message.balance = object.balance; - else if (typeof object.balance === "object") - message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an IdentityTokenBalanceEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} message IdentityTokenBalanceEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityTokenBalanceEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.balance = options.longs === String ? "0" : 0; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.balance != null && message.hasOwnProperty("balance")) - if (typeof message.balance === "number") - object.balance = options.longs === String ? String(message.balance) : message.balance; - else - object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; - return object; - }; - - /** - * Converts this IdentityTokenBalanceEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry - * @instance - * @returns {Object.} JSON object - */ - IdentityTokenBalanceEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityTokenBalanceEntry; - })(); - - GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances = (function() { - - /** - * Properties of an IdentityTokenBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @interface IIdentityTokenBalances - * @property {Array.|null} [identityTokenBalances] IdentityTokenBalances identityTokenBalances - */ - - /** - * Constructs a new IdentityTokenBalances. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 - * @classdesc Represents an IdentityTokenBalances. - * @implements IIdentityTokenBalances - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set - */ - function IdentityTokenBalances(properties) { - this.identityTokenBalances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityTokenBalances identityTokenBalances. - * @member {Array.} identityTokenBalances - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @instance - */ - IdentityTokenBalances.prototype.identityTokenBalances = $util.emptyArray; - - /** - * Creates a new IdentityTokenBalances instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances instance - */ - IdentityTokenBalances.create = function create(properties) { - return new IdentityTokenBalances(properties); - }; - - /** - * Encodes the specified IdentityTokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalances.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityTokenBalances != null && message.identityTokenBalances.length) - for (var i = 0; i < message.identityTokenBalances.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.encode(message.identityTokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentityTokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenBalances.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityTokenBalances message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalances.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.identityTokenBalances && message.identityTokenBalances.length)) - message.identityTokenBalances = []; - message.identityTokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityTokenBalances message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenBalances.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityTokenBalances message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityTokenBalances.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { - if (!Array.isArray(message.identityTokenBalances)) - return "identityTokenBalances: array expected"; - for (var i = 0; i < message.identityTokenBalances.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify(message.identityTokenBalances[i]); - if (error) - return "identityTokenBalances." + error; - } - } - return null; - }; - - /** - * Creates an IdentityTokenBalances message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances - */ - IdentityTokenBalances.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); - if (object.identityTokenBalances) { - if (!Array.isArray(object.identityTokenBalances)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: array expected"); - message.identityTokenBalances = []; - for (var i = 0; i < object.identityTokenBalances.length; ++i) { - if (typeof object.identityTokenBalances[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: object expected"); - message.identityTokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.fromObject(object.identityTokenBalances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentityTokenBalances message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} message IdentityTokenBalances - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityTokenBalances.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.identityTokenBalances = []; - if (message.identityTokenBalances && message.identityTokenBalances.length) { - object.identityTokenBalances = []; - for (var j = 0; j < message.identityTokenBalances.length; ++j) - object.identityTokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.toObject(message.identityTokenBalances[j], options); - } - return object; - }; - - /** - * Converts this IdentityTokenBalances to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances - * @instance - * @returns {Object.} JSON object - */ - IdentityTokenBalances.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityTokenBalances; - })(); - - return GetIdentitiesTokenBalancesResponseV0; - })(); - - return GetIdentitiesTokenBalancesResponse; - })(); - - v0.GetIdentityTokenInfosRequest = (function() { - - /** - * Properties of a GetIdentityTokenInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityTokenInfosRequest - * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null} [v0] GetIdentityTokenInfosRequest v0 - */ - - /** - * Constructs a new GetIdentityTokenInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityTokenInfosRequest. - * @implements IGetIdentityTokenInfosRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set - */ - function GetIdentityTokenInfosRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenInfosRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @instance - */ - GetIdentityTokenInfosRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenInfosRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @instance - */ - Object.defineProperty(GetIdentityTokenInfosRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenInfosRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest instance - */ - GetIdentityTokenInfosRequest.create = function create(properties) { - return new GetIdentityTokenInfosRequest(properties); - }; - - /** - * Encodes the specified GetIdentityTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenInfosRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenInfosRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityTokenInfosRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest - */ - GetIdentityTokenInfosRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenInfosRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenInfosRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityTokenInfosRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenInfosRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 = (function() { - - /** - * Properties of a GetIdentityTokenInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @interface IGetIdentityTokenInfosRequestV0 - * @property {Uint8Array|null} [identityId] GetIdentityTokenInfosRequestV0 identityId - * @property {Array.|null} [tokenIds] GetIdentityTokenInfosRequestV0 tokenIds - * @property {boolean|null} [prove] GetIdentityTokenInfosRequestV0 prove - */ - - /** - * Constructs a new GetIdentityTokenInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest - * @classdesc Represents a GetIdentityTokenInfosRequestV0. - * @implements IGetIdentityTokenInfosRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set - */ - function GetIdentityTokenInfosRequestV0(properties) { - this.tokenIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenInfosRequestV0 identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @instance - */ - GetIdentityTokenInfosRequestV0.prototype.identityId = $util.newBuffer([]); - - /** - * GetIdentityTokenInfosRequestV0 tokenIds. - * @member {Array.} tokenIds - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @instance - */ - GetIdentityTokenInfosRequestV0.prototype.tokenIds = $util.emptyArray; - - /** - * GetIdentityTokenInfosRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @instance - */ - GetIdentityTokenInfosRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentityTokenInfosRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 instance - */ - GetIdentityTokenInfosRequestV0.create = function create(properties) { - return new GetIdentityTokenInfosRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentityTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.tokenIds != null && message.tokenIds.length) - for (var i = 0; i < message.tokenIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - if (!(message.tokenIds && message.tokenIds.length)) - message.tokenIds = []; - message.tokenIds.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenInfosRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenInfosRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { - if (!Array.isArray(message.tokenIds)) - return "tokenIds: array expected"; - for (var i = 0; i < message.tokenIds.length; ++i) - if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) - return "tokenIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentityTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 - */ - GetIdentityTokenInfosRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.tokenIds) { - if (!Array.isArray(object.tokenIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.tokenIds: array expected"); - message.tokenIds = []; - for (var i = 0; i < object.tokenIds.length; ++i) - if (typeof object.tokenIds[i] === "string") - $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); - else if (object.tokenIds[i].length >= 0) - message.tokenIds[i] = object.tokenIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenInfosRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenInfosRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenIds = []; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.prove = false; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.tokenIds && message.tokenIds.length) { - object.tokenIds = []; - for (var j = 0; j < message.tokenIds.length; ++j) - object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentityTokenInfosRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenInfosRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentityTokenInfosRequestV0; - })(); - - return GetIdentityTokenInfosRequest; - })(); - - v0.GetIdentityTokenInfosResponse = (function() { - - /** - * Properties of a GetIdentityTokenInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentityTokenInfosResponse - * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null} [v0] GetIdentityTokenInfosResponse v0 - */ - - /** - * Constructs a new GetIdentityTokenInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentityTokenInfosResponse. - * @implements IGetIdentityTokenInfosResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set - */ - function GetIdentityTokenInfosResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenInfosResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @instance - */ - GetIdentityTokenInfosResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenInfosResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @instance - */ - Object.defineProperty(GetIdentityTokenInfosResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenInfosResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse instance - */ - GetIdentityTokenInfosResponse.create = function create(properties) { - return new GetIdentityTokenInfosResponse(properties); - }; - - /** - * Encodes the specified GetIdentityTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenInfosResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenInfosResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentityTokenInfosResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse - */ - GetIdentityTokenInfosResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenInfosResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenInfosResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentityTokenInfosResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenInfosResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 = (function() { - - /** - * Properties of a GetIdentityTokenInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @interface IGetIdentityTokenInfosResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null} [tokenInfos] GetIdentityTokenInfosResponseV0 tokenInfos - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenInfosResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenInfosResponseV0 metadata - */ - - /** - * Constructs a new GetIdentityTokenInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse - * @classdesc Represents a GetIdentityTokenInfosResponseV0. - * @implements IGetIdentityTokenInfosResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set - */ - function GetIdentityTokenInfosResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentityTokenInfosResponseV0 tokenInfos. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null|undefined} tokenInfos - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - */ - GetIdentityTokenInfosResponseV0.prototype.tokenInfos = null; - - /** - * GetIdentityTokenInfosResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - */ - GetIdentityTokenInfosResponseV0.prototype.proof = null; - - /** - * GetIdentityTokenInfosResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - */ - GetIdentityTokenInfosResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentityTokenInfosResponseV0 result. - * @member {"tokenInfos"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - */ - Object.defineProperty(GetIdentityTokenInfosResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenInfos", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentityTokenInfosResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 instance - */ - GetIdentityTokenInfosResponseV0.create = function create(properties) { - return new GetIdentityTokenInfosResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentityTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenInfos != null && Object.hasOwnProperty.call(message, "tokenInfos")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.encode(message.tokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentityTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentityTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentityTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentityTokenInfosResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentityTokenInfosResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify(message.tokenInfos); - if (error) - return "tokenInfos." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentityTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 - */ - GetIdentityTokenInfosResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); - if (object.tokenInfos != null) { - if (typeof object.tokenInfos !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.tokenInfos: object expected"); - message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.fromObject(object.tokenInfos); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentityTokenInfosResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentityTokenInfosResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { - object.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.toObject(message.tokenInfos, options); - if (options.oneofs) - object.result = "tokenInfos"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentityTokenInfosResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentityTokenInfosResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { - - /** - * Properties of a TokenIdentityInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @interface ITokenIdentityInfoEntry - * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen - */ - - /** - * Constructs a new TokenIdentityInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @classdesc Represents a TokenIdentityInfoEntry. - * @implements ITokenIdentityInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set - */ - function TokenIdentityInfoEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenIdentityInfoEntry frozen. - * @member {boolean} frozen - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @instance - */ - TokenIdentityInfoEntry.prototype.frozen = false; - - /** - * Creates a new TokenIdentityInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance - */ - TokenIdentityInfoEntry.create = function create(properties) { - return new TokenIdentityInfoEntry(properties); - }; - - /** - * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenIdentityInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); - return writer; - }; - - /** - * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenIdentityInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozen = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenIdentityInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenIdentityInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozen != null && message.hasOwnProperty("frozen")) - if (typeof message.frozen !== "boolean") - return "frozen: boolean expected"; - return null; - }; - - /** - * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - */ - TokenIdentityInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); - if (object.frozen != null) - message.frozen = Boolean(object.frozen); - return message; - }; - - /** - * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenIdentityInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.frozen = false; - if (message.frozen != null && message.hasOwnProperty("frozen")) - object.frozen = message.frozen; - return object; - }; - - /** - * Converts this TokenIdentityInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry - * @instance - * @returns {Object.} JSON object - */ - TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenIdentityInfoEntry; - })(); - - GetIdentityTokenInfosResponseV0.TokenInfoEntry = (function() { - - /** - * Properties of a TokenInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @interface ITokenInfoEntry - * @property {Uint8Array|null} [tokenId] TokenInfoEntry tokenId - * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info - */ - - /** - * Constructs a new TokenInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @classdesc Represents a TokenInfoEntry. - * @implements ITokenInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set - */ - function TokenInfoEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenInfoEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @instance - */ - TokenInfoEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenInfoEntry info. - * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @instance - */ - TokenInfoEntry.prototype.info = null; - - /** - * Creates a new TokenInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance - */ - TokenInfoEntry.create = function create(properties) { - return new TokenInfoEntry(properties); - }; - - /** - * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.info != null && message.hasOwnProperty("info")) { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); - if (error) - return "info." + error; - } - return null; - }; - - /** - * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - */ - TokenInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.info: object expected"); - message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); - } - return message; - }; - - /** - * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.info = null; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); - return object; - }; - - /** - * Converts this TokenInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry - * @instance - * @returns {Object.} JSON object - */ - TokenInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenInfoEntry; - })(); - - GetIdentityTokenInfosResponseV0.TokenInfos = (function() { - - /** - * Properties of a TokenInfos. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @interface ITokenInfos - * @property {Array.|null} [tokenInfos] TokenInfos tokenInfos - */ - - /** - * Constructs a new TokenInfos. - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 - * @classdesc Represents a TokenInfos. - * @implements ITokenInfos - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set - */ - function TokenInfos(properties) { - this.tokenInfos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenInfos tokenInfos. - * @member {Array.} tokenInfos - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @instance - */ - TokenInfos.prototype.tokenInfos = $util.emptyArray; - - /** - * Creates a new TokenInfos instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos instance - */ - TokenInfos.create = function create(properties) { - return new TokenInfos(properties); - }; - - /** - * Encodes the specified TokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfos.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenInfos != null && message.tokenInfos.length) - for (var i = 0; i < message.tokenInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfos.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenInfos message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfos.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenInfos && message.tokenInfos.length)) - message.tokenInfos = []; - message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenInfos message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfos.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenInfos message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenInfos.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { - if (!Array.isArray(message.tokenInfos)) - return "tokenInfos: array expected"; - for (var i = 0; i < message.tokenInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); - if (error) - return "tokenInfos." + error; - } - } - return null; - }; - - /** - * Creates a TokenInfos message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos - */ - TokenInfos.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); - if (object.tokenInfos) { - if (!Array.isArray(object.tokenInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: array expected"); - message.tokenInfos = []; - for (var i = 0; i < object.tokenInfos.length; ++i) { - if (typeof object.tokenInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: object expected"); - message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenInfos message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} message TokenInfos - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenInfos.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenInfos = []; - if (message.tokenInfos && message.tokenInfos.length) { - object.tokenInfos = []; - for (var j = 0; j < message.tokenInfos.length; ++j) - object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); - } - return object; - }; - - /** - * Converts this TokenInfos to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos - * @instance - * @returns {Object.} JSON object - */ - TokenInfos.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenInfos; - })(); - - return GetIdentityTokenInfosResponseV0; - })(); - - return GetIdentityTokenInfosResponse; - })(); - - v0.GetIdentitiesTokenInfosRequest = (function() { - - /** - * Properties of a GetIdentitiesTokenInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesTokenInfosRequest - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null} [v0] GetIdentitiesTokenInfosRequest v0 - */ - - /** - * Constructs a new GetIdentitiesTokenInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesTokenInfosRequest. - * @implements IGetIdentitiesTokenInfosRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set - */ - function GetIdentitiesTokenInfosRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenInfosRequest v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @instance - */ - GetIdentitiesTokenInfosRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenInfosRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @instance - */ - Object.defineProperty(GetIdentitiesTokenInfosRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenInfosRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest instance - */ - GetIdentitiesTokenInfosRequest.create = function create(properties) { - return new GetIdentitiesTokenInfosRequest(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenInfosRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenInfosRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenInfosRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest - */ - GetIdentitiesTokenInfosRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenInfosRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenInfosRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesTokenInfosRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenInfosRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 = (function() { - - /** - * Properties of a GetIdentitiesTokenInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @interface IGetIdentitiesTokenInfosRequestV0 - * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenInfosRequestV0 tokenId - * @property {Array.|null} [identityIds] GetIdentitiesTokenInfosRequestV0 identityIds - * @property {boolean|null} [prove] GetIdentitiesTokenInfosRequestV0 prove - */ - - /** - * Constructs a new GetIdentitiesTokenInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest - * @classdesc Represents a GetIdentitiesTokenInfosRequestV0. - * @implements IGetIdentitiesTokenInfosRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set - */ - function GetIdentitiesTokenInfosRequestV0(properties) { - this.identityIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenInfosRequestV0 tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @instance - */ - GetIdentitiesTokenInfosRequestV0.prototype.tokenId = $util.newBuffer([]); - - /** - * GetIdentitiesTokenInfosRequestV0 identityIds. - * @member {Array.} identityIds - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @instance - */ - GetIdentitiesTokenInfosRequestV0.prototype.identityIds = $util.emptyArray; - - /** - * GetIdentitiesTokenInfosRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @instance - */ - GetIdentitiesTokenInfosRequestV0.prototype.prove = false; - - /** - * Creates a new GetIdentitiesTokenInfosRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 instance - */ - GetIdentitiesTokenInfosRequestV0.create = function create(properties) { - return new GetIdentitiesTokenInfosRequestV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.identityIds != null && message.identityIds.length) - for (var i = 0; i < message.identityIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - if (!(message.identityIds && message.identityIds.length)) - message.identityIds = []; - message.identityIds.push(reader.bytes()); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenInfosRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenInfosRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.identityIds != null && message.hasOwnProperty("identityIds")) { - if (!Array.isArray(message.identityIds)) - return "identityIds: array expected"; - for (var i = 0; i < message.identityIds.length; ++i) - if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) - return "identityIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetIdentitiesTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 - */ - GetIdentitiesTokenInfosRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.identityIds) { - if (!Array.isArray(object.identityIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.identityIds: array expected"); - message.identityIds = []; - for (var i = 0; i < object.identityIds.length; ++i) - if (typeof object.identityIds[i] === "string") - $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); - else if (object.identityIds[i].length >= 0) - message.identityIds[i] = object.identityIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenInfosRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenInfosRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.identityIds = []; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.prove = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.identityIds && message.identityIds.length) { - object.identityIds = []; - for (var j = 0; j < message.identityIds.length; ++j) - object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetIdentitiesTokenInfosRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenInfosRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetIdentitiesTokenInfosRequestV0; - })(); - - return GetIdentitiesTokenInfosRequest; - })(); - - v0.GetIdentitiesTokenInfosResponse = (function() { - - /** - * Properties of a GetIdentitiesTokenInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesTokenInfosResponse - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null} [v0] GetIdentitiesTokenInfosResponse v0 - */ - - /** - * Constructs a new GetIdentitiesTokenInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesTokenInfosResponse. - * @implements IGetIdentitiesTokenInfosResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set - */ - function GetIdentitiesTokenInfosResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenInfosResponse v0. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @instance - */ - GetIdentitiesTokenInfosResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenInfosResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @instance - */ - Object.defineProperty(GetIdentitiesTokenInfosResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenInfosResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse instance - */ - GetIdentitiesTokenInfosResponse.create = function create(properties) { - return new GetIdentitiesTokenInfosResponse(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenInfosResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenInfosResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenInfosResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse - */ - GetIdentitiesTokenInfosResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenInfosResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenInfosResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetIdentitiesTokenInfosResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenInfosResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 = (function() { - - /** - * Properties of a GetIdentitiesTokenInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @interface IGetIdentitiesTokenInfosResponseV0 - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null} [identityTokenInfos] GetIdentitiesTokenInfosResponseV0 identityTokenInfos - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenInfosResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenInfosResponseV0 metadata - */ - - /** - * Constructs a new GetIdentitiesTokenInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse - * @classdesc Represents a GetIdentitiesTokenInfosResponseV0. - * @implements IGetIdentitiesTokenInfosResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set - */ - function GetIdentitiesTokenInfosResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIdentitiesTokenInfosResponseV0 identityTokenInfos. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null|undefined} identityTokenInfos - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - */ - GetIdentitiesTokenInfosResponseV0.prototype.identityTokenInfos = null; - - /** - * GetIdentitiesTokenInfosResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - */ - GetIdentitiesTokenInfosResponseV0.prototype.proof = null; - - /** - * GetIdentitiesTokenInfosResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - */ - GetIdentitiesTokenInfosResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetIdentitiesTokenInfosResponseV0 result. - * @member {"identityTokenInfos"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - */ - Object.defineProperty(GetIdentitiesTokenInfosResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["identityTokenInfos", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetIdentitiesTokenInfosResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 instance - */ - GetIdentitiesTokenInfosResponseV0.create = function create(properties) { - return new GetIdentitiesTokenInfosResponseV0(properties); - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityTokenInfos != null && Object.hasOwnProperty.call(message, "identityTokenInfos")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.encode(message.identityTokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIdentitiesTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIdentitiesTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIdentitiesTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIdentitiesTokenInfosResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIdentitiesTokenInfosResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify(message.identityTokenInfos); - if (error) - return "identityTokenInfos." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetIdentitiesTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 - */ - GetIdentitiesTokenInfosResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); - if (object.identityTokenInfos != null) { - if (typeof object.identityTokenInfos !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.identityTokenInfos: object expected"); - message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.fromObject(object.identityTokenInfos); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetIdentitiesTokenInfosResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIdentitiesTokenInfosResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { - object.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.toObject(message.identityTokenInfos, options); - if (options.oneofs) - object.result = "identityTokenInfos"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetIdentitiesTokenInfosResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetIdentitiesTokenInfosResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { - - /** - * Properties of a TokenIdentityInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @interface ITokenIdentityInfoEntry - * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen - */ - - /** - * Constructs a new TokenIdentityInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @classdesc Represents a TokenIdentityInfoEntry. - * @implements ITokenIdentityInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set - */ - function TokenIdentityInfoEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenIdentityInfoEntry frozen. - * @member {boolean} frozen - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @instance - */ - TokenIdentityInfoEntry.prototype.frozen = false; - - /** - * Creates a new TokenIdentityInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance - */ - TokenIdentityInfoEntry.create = function create(properties) { - return new TokenIdentityInfoEntry(properties); - }; - - /** - * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenIdentityInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); - return writer; - }; - - /** - * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenIdentityInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozen = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenIdentityInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenIdentityInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozen != null && message.hasOwnProperty("frozen")) - if (typeof message.frozen !== "boolean") - return "frozen: boolean expected"; - return null; - }; - - /** - * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry - */ - TokenIdentityInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); - if (object.frozen != null) - message.frozen = Boolean(object.frozen); - return message; - }; - - /** - * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenIdentityInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.frozen = false; - if (message.frozen != null && message.hasOwnProperty("frozen")) - object.frozen = message.frozen; - return object; - }; - - /** - * Converts this TokenIdentityInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry - * @instance - * @returns {Object.} JSON object - */ - TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenIdentityInfoEntry; - })(); - - GetIdentitiesTokenInfosResponseV0.TokenInfoEntry = (function() { - - /** - * Properties of a TokenInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @interface ITokenInfoEntry - * @property {Uint8Array|null} [identityId] TokenInfoEntry identityId - * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info - */ - - /** - * Constructs a new TokenInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @classdesc Represents a TokenInfoEntry. - * @implements ITokenInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set - */ - function TokenInfoEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenInfoEntry identityId. - * @member {Uint8Array} identityId - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @instance - */ - TokenInfoEntry.prototype.identityId = $util.newBuffer([]); - - /** - * TokenInfoEntry info. - * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @instance - */ - TokenInfoEntry.prototype.info = null; - - /** - * Creates a new TokenInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance - */ - TokenInfoEntry.create = function create(properties) { - return new TokenInfoEntry(properties); - }; - - /** - * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identityId = reader.bytes(); - break; - case 2: - message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityId != null && message.hasOwnProperty("identityId")) - if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) - return "identityId: buffer expected"; - if (message.info != null && message.hasOwnProperty("info")) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); - if (error) - return "info." + error; - } - return null; - }; - - /** - * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry - */ - TokenInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); - if (object.identityId != null) - if (typeof object.identityId === "string") - $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); - else if (object.identityId.length >= 0) - message.identityId = object.identityId; - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.info: object expected"); - message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); - } - return message; - }; - - /** - * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.identityId = ""; - else { - object.identityId = []; - if (options.bytes !== Array) - object.identityId = $util.newBuffer(object.identityId); - } - object.info = null; - } - if (message.identityId != null && message.hasOwnProperty("identityId")) - object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); - return object; - }; - - /** - * Converts this TokenInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry - * @instance - * @returns {Object.} JSON object - */ - TokenInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenInfoEntry; - })(); - - GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos = (function() { - - /** - * Properties of an IdentityTokenInfos. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @interface IIdentityTokenInfos - * @property {Array.|null} [tokenInfos] IdentityTokenInfos tokenInfos - */ - - /** - * Constructs a new IdentityTokenInfos. - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 - * @classdesc Represents an IdentityTokenInfos. - * @implements IIdentityTokenInfos - * @constructor - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set - */ - function IdentityTokenInfos(properties) { - this.tokenInfos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityTokenInfos tokenInfos. - * @member {Array.} tokenInfos - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @instance - */ - IdentityTokenInfos.prototype.tokenInfos = $util.emptyArray; - - /** - * Creates a new IdentityTokenInfos instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos instance - */ - IdentityTokenInfos.create = function create(properties) { - return new IdentityTokenInfos(properties); - }; - - /** - * Encodes the specified IdentityTokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenInfos.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenInfos != null && message.tokenInfos.length) - for (var i = 0; i < message.tokenInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentityTokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityTokenInfos.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityTokenInfos message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenInfos.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenInfos && message.tokenInfos.length)) - message.tokenInfos = []; - message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityTokenInfos message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityTokenInfos.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityTokenInfos message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityTokenInfos.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { - if (!Array.isArray(message.tokenInfos)) - return "tokenInfos: array expected"; - for (var i = 0; i < message.tokenInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); - if (error) - return "tokenInfos." + error; - } - } - return null; - }; - - /** - * Creates an IdentityTokenInfos message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos - */ - IdentityTokenInfos.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); - if (object.tokenInfos) { - if (!Array.isArray(object.tokenInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: array expected"); - message.tokenInfos = []; - for (var i = 0; i < object.tokenInfos.length; ++i) { - if (typeof object.tokenInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: object expected"); - message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentityTokenInfos message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} message IdentityTokenInfos - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityTokenInfos.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenInfos = []; - if (message.tokenInfos && message.tokenInfos.length) { - object.tokenInfos = []; - for (var j = 0; j < message.tokenInfos.length; ++j) - object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); - } - return object; - }; - - /** - * Converts this IdentityTokenInfos to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos - * @instance - * @returns {Object.} JSON object - */ - IdentityTokenInfos.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentityTokenInfos; - })(); - - return GetIdentitiesTokenInfosResponseV0; - })(); - - return GetIdentitiesTokenInfosResponse; - })(); - - v0.GetTokenStatusesRequest = (function() { - - /** - * Properties of a GetTokenStatusesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenStatusesRequest - * @property {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null} [v0] GetTokenStatusesRequest v0 - */ - - /** - * Constructs a new GetTokenStatusesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenStatusesRequest. - * @implements IGetTokenStatusesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set - */ - function GetTokenStatusesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenStatusesRequest v0. - * @member {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @instance - */ - GetTokenStatusesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenStatusesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @instance - */ - Object.defineProperty(GetTokenStatusesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenStatusesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest instance - */ - GetTokenStatusesRequest.create = function create(properties) { - return new GetTokenStatusesRequest(properties); - }; - - /** - * Encodes the specified GetTokenStatusesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenStatusesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenStatusesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenStatusesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenStatusesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenStatusesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenStatusesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest - */ - GetTokenStatusesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenStatusesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest} message GetTokenStatusesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenStatusesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenStatusesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @instance - * @returns {Object.} JSON object - */ - GetTokenStatusesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenStatusesRequest.GetTokenStatusesRequestV0 = (function() { - - /** - * Properties of a GetTokenStatusesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @interface IGetTokenStatusesRequestV0 - * @property {Array.|null} [tokenIds] GetTokenStatusesRequestV0 tokenIds - * @property {boolean|null} [prove] GetTokenStatusesRequestV0 prove - */ - - /** - * Constructs a new GetTokenStatusesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest - * @classdesc Represents a GetTokenStatusesRequestV0. - * @implements IGetTokenStatusesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set - */ - function GetTokenStatusesRequestV0(properties) { - this.tokenIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenStatusesRequestV0 tokenIds. - * @member {Array.} tokenIds - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @instance - */ - GetTokenStatusesRequestV0.prototype.tokenIds = $util.emptyArray; - - /** - * GetTokenStatusesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @instance - */ - GetTokenStatusesRequestV0.prototype.prove = false; - - /** - * Creates a new GetTokenStatusesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 instance - */ - GetTokenStatusesRequestV0.create = function create(properties) { - return new GetTokenStatusesRequestV0(properties); - }; - - /** - * Encodes the specified GetTokenStatusesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenIds != null && message.tokenIds.length) - for (var i = 0; i < message.tokenIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTokenStatusesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenIds && message.tokenIds.length)) - message.tokenIds = []; - message.tokenIds.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenStatusesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenStatusesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { - if (!Array.isArray(message.tokenIds)) - return "tokenIds: array expected"; - for (var i = 0; i < message.tokenIds.length; ++i) - if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) - return "tokenIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTokenStatusesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 - */ - GetTokenStatusesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); - if (object.tokenIds) { - if (!Array.isArray(object.tokenIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.tokenIds: array expected"); - message.tokenIds = []; - for (var i = 0; i < object.tokenIds.length; ++i) - if (typeof object.tokenIds[i] === "string") - $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); - else if (object.tokenIds[i].length >= 0) - message.tokenIds[i] = object.tokenIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTokenStatusesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenStatusesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenIds = []; - if (options.defaults) - object.prove = false; - if (message.tokenIds && message.tokenIds.length) { - object.tokenIds = []; - for (var j = 0; j < message.tokenIds.length; ++j) - object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTokenStatusesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenStatusesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTokenStatusesRequestV0; - })(); - - return GetTokenStatusesRequest; - })(); - - v0.GetTokenStatusesResponse = (function() { - - /** - * Properties of a GetTokenStatusesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenStatusesResponse - * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null} [v0] GetTokenStatusesResponse v0 - */ - - /** - * Constructs a new GetTokenStatusesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenStatusesResponse. - * @implements IGetTokenStatusesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set - */ - function GetTokenStatusesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenStatusesResponse v0. - * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @instance - */ - GetTokenStatusesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenStatusesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @instance - */ - Object.defineProperty(GetTokenStatusesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenStatusesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse instance - */ - GetTokenStatusesResponse.create = function create(properties) { - return new GetTokenStatusesResponse(properties); - }; - - /** - * Encodes the specified GetTokenStatusesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenStatusesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenStatusesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenStatusesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenStatusesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenStatusesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenStatusesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse - */ - GetTokenStatusesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenStatusesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} message GetTokenStatusesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenStatusesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenStatusesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @instance - * @returns {Object.} JSON object - */ - GetTokenStatusesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenStatusesResponse.GetTokenStatusesResponseV0 = (function() { - - /** - * Properties of a GetTokenStatusesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @interface IGetTokenStatusesResponseV0 - * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null} [tokenStatuses] GetTokenStatusesResponseV0 tokenStatuses - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenStatusesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenStatusesResponseV0 metadata - */ - - /** - * Constructs a new GetTokenStatusesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse - * @classdesc Represents a GetTokenStatusesResponseV0. - * @implements IGetTokenStatusesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set - */ - function GetTokenStatusesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenStatusesResponseV0 tokenStatuses. - * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null|undefined} tokenStatuses - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - */ - GetTokenStatusesResponseV0.prototype.tokenStatuses = null; - - /** - * GetTokenStatusesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - */ - GetTokenStatusesResponseV0.prototype.proof = null; - - /** - * GetTokenStatusesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - */ - GetTokenStatusesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenStatusesResponseV0 result. - * @member {"tokenStatuses"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - */ - Object.defineProperty(GetTokenStatusesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenStatuses", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenStatusesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 instance - */ - GetTokenStatusesResponseV0.create = function create(properties) { - return new GetTokenStatusesResponseV0(properties); - }; - - /** - * Encodes the specified GetTokenStatusesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenStatuses != null && Object.hasOwnProperty.call(message, "tokenStatuses")) - $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.encode(message.tokenStatuses, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenStatusesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenStatusesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenStatusesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenStatusesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenStatusesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify(message.tokenStatuses); - if (error) - return "tokenStatuses." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTokenStatusesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 - */ - GetTokenStatusesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); - if (object.tokenStatuses != null) { - if (typeof object.tokenStatuses !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.tokenStatuses: object expected"); - message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.fromObject(object.tokenStatuses); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenStatusesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenStatusesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { - object.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.toObject(message.tokenStatuses, options); - if (options.oneofs) - object.result = "tokenStatuses"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTokenStatusesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenStatusesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenStatusesResponseV0.TokenStatusEntry = (function() { - - /** - * Properties of a TokenStatusEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @interface ITokenStatusEntry - * @property {Uint8Array|null} [tokenId] TokenStatusEntry tokenId - * @property {boolean|null} [paused] TokenStatusEntry paused - */ - - /** - * Constructs a new TokenStatusEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @classdesc Represents a TokenStatusEntry. - * @implements ITokenStatusEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set - */ - function TokenStatusEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenStatusEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @instance - */ - TokenStatusEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenStatusEntry paused. - * @member {boolean} paused - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @instance - */ - TokenStatusEntry.prototype.paused = false; - - /** - * Creates a new TokenStatusEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry instance - */ - TokenStatusEntry.create = function create(properties) { - return new TokenStatusEntry(properties); - }; - - /** - * Encodes the specified TokenStatusEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatusEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.paused != null && Object.hasOwnProperty.call(message, "paused")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.paused); - return writer; - }; - - /** - * Encodes the specified TokenStatusEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatusEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenStatusEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatusEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.paused = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenStatusEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatusEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenStatusEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenStatusEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.paused != null && message.hasOwnProperty("paused")) - if (typeof message.paused !== "boolean") - return "paused: boolean expected"; - return null; - }; - - /** - * Creates a TokenStatusEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry - */ - TokenStatusEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.paused != null) - message.paused = Boolean(object.paused); - return message; - }; - - /** - * Creates a plain object from a TokenStatusEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} message TokenStatusEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenStatusEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.paused = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.paused != null && message.hasOwnProperty("paused")) - object.paused = message.paused; - return object; - }; - - /** - * Converts this TokenStatusEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry - * @instance - * @returns {Object.} JSON object - */ - TokenStatusEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenStatusEntry; - })(); - - GetTokenStatusesResponseV0.TokenStatuses = (function() { - - /** - * Properties of a TokenStatuses. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @interface ITokenStatuses - * @property {Array.|null} [tokenStatuses] TokenStatuses tokenStatuses - */ - - /** - * Constructs a new TokenStatuses. - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 - * @classdesc Represents a TokenStatuses. - * @implements ITokenStatuses - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set - */ - function TokenStatuses(properties) { - this.tokenStatuses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenStatuses tokenStatuses. - * @member {Array.} tokenStatuses - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @instance - */ - TokenStatuses.prototype.tokenStatuses = $util.emptyArray; - - /** - * Creates a new TokenStatuses instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses instance - */ - TokenStatuses.create = function create(properties) { - return new TokenStatuses(properties); - }; - - /** - * Encodes the specified TokenStatuses message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatuses.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenStatuses != null && message.tokenStatuses.length) - for (var i = 0; i < message.tokenStatuses.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.encode(message.tokenStatuses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenStatuses message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenStatuses.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenStatuses message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatuses.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenStatuses && message.tokenStatuses.length)) - message.tokenStatuses = []; - message.tokenStatuses.push($root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenStatuses message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenStatuses.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenStatuses message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenStatuses.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { - if (!Array.isArray(message.tokenStatuses)) - return "tokenStatuses: array expected"; - for (var i = 0; i < message.tokenStatuses.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify(message.tokenStatuses[i]); - if (error) - return "tokenStatuses." + error; - } - } - return null; - }; - - /** - * Creates a TokenStatuses message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses - */ - TokenStatuses.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); - if (object.tokenStatuses) { - if (!Array.isArray(object.tokenStatuses)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: array expected"); - message.tokenStatuses = []; - for (var i = 0; i < object.tokenStatuses.length; ++i) { - if (typeof object.tokenStatuses[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: object expected"); - message.tokenStatuses[i] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.fromObject(object.tokenStatuses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenStatuses message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @static - * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} message TokenStatuses - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenStatuses.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenStatuses = []; - if (message.tokenStatuses && message.tokenStatuses.length) { - object.tokenStatuses = []; - for (var j = 0; j < message.tokenStatuses.length; ++j) - object.tokenStatuses[j] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.toObject(message.tokenStatuses[j], options); - } - return object; - }; - - /** - * Converts this TokenStatuses to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses - * @instance - * @returns {Object.} JSON object - */ - TokenStatuses.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenStatuses; - })(); - - return GetTokenStatusesResponseV0; - })(); - - return GetTokenStatusesResponse; - })(); - - v0.GetTokenDirectPurchasePricesRequest = (function() { - - /** - * Properties of a GetTokenDirectPurchasePricesRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenDirectPurchasePricesRequest - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null} [v0] GetTokenDirectPurchasePricesRequest v0 - */ - - /** - * Constructs a new GetTokenDirectPurchasePricesRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenDirectPurchasePricesRequest. - * @implements IGetTokenDirectPurchasePricesRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set - */ - function GetTokenDirectPurchasePricesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenDirectPurchasePricesRequest v0. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @instance - */ - GetTokenDirectPurchasePricesRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenDirectPurchasePricesRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @instance - */ - Object.defineProperty(GetTokenDirectPurchasePricesRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenDirectPurchasePricesRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest instance - */ - GetTokenDirectPurchasePricesRequest.create = function create(properties) { - return new GetTokenDirectPurchasePricesRequest(properties); - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenDirectPurchasePricesRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenDirectPurchasePricesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenDirectPurchasePricesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest - */ - GetTokenDirectPurchasePricesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenDirectPurchasePricesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenDirectPurchasePricesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenDirectPurchasePricesRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @instance - * @returns {Object.} JSON object - */ - GetTokenDirectPurchasePricesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = (function() { - - /** - * Properties of a GetTokenDirectPurchasePricesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @interface IGetTokenDirectPurchasePricesRequestV0 - * @property {Array.|null} [tokenIds] GetTokenDirectPurchasePricesRequestV0 tokenIds - * @property {boolean|null} [prove] GetTokenDirectPurchasePricesRequestV0 prove - */ - - /** - * Constructs a new GetTokenDirectPurchasePricesRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest - * @classdesc Represents a GetTokenDirectPurchasePricesRequestV0. - * @implements IGetTokenDirectPurchasePricesRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set - */ - function GetTokenDirectPurchasePricesRequestV0(properties) { - this.tokenIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenDirectPurchasePricesRequestV0 tokenIds. - * @member {Array.} tokenIds - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @instance - */ - GetTokenDirectPurchasePricesRequestV0.prototype.tokenIds = $util.emptyArray; - - /** - * GetTokenDirectPurchasePricesRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @instance - */ - GetTokenDirectPurchasePricesRequestV0.prototype.prove = false; - - /** - * Creates a new GetTokenDirectPurchasePricesRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 instance - */ - GetTokenDirectPurchasePricesRequestV0.create = function create(properties) { - return new GetTokenDirectPurchasePricesRequestV0(properties); - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenIds != null && message.tokenIds.length) - for (var i = 0; i < message.tokenIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenIds && message.tokenIds.length)) - message.tokenIds = []; - message.tokenIds.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenDirectPurchasePricesRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenDirectPurchasePricesRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { - if (!Array.isArray(message.tokenIds)) - return "tokenIds: array expected"; - for (var i = 0; i < message.tokenIds.length; ++i) - if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) - return "tokenIds: buffer[] expected"; - } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTokenDirectPurchasePricesRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 - */ - GetTokenDirectPurchasePricesRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); - if (object.tokenIds) { - if (!Array.isArray(object.tokenIds)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.tokenIds: array expected"); - message.tokenIds = []; - for (var i = 0; i < object.tokenIds.length; ++i) - if (typeof object.tokenIds[i] === "string") - $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); - else if (object.tokenIds[i].length >= 0) - message.tokenIds[i] = object.tokenIds[i]; - } - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTokenDirectPurchasePricesRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenDirectPurchasePricesRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenIds = []; - if (options.defaults) - object.prove = false; - if (message.tokenIds && message.tokenIds.length) { - object.tokenIds = []; - for (var j = 0; j < message.tokenIds.length; ++j) - object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; - } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTokenDirectPurchasePricesRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenDirectPurchasePricesRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTokenDirectPurchasePricesRequestV0; - })(); - - return GetTokenDirectPurchasePricesRequest; - })(); - - v0.GetTokenDirectPurchasePricesResponse = (function() { - - /** - * Properties of a GetTokenDirectPurchasePricesResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenDirectPurchasePricesResponse - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null} [v0] GetTokenDirectPurchasePricesResponse v0 - */ - - /** - * Constructs a new GetTokenDirectPurchasePricesResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenDirectPurchasePricesResponse. - * @implements IGetTokenDirectPurchasePricesResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set - */ - function GetTokenDirectPurchasePricesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenDirectPurchasePricesResponse v0. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @instance - */ - GetTokenDirectPurchasePricesResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenDirectPurchasePricesResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @instance - */ - Object.defineProperty(GetTokenDirectPurchasePricesResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenDirectPurchasePricesResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse instance - */ - GetTokenDirectPurchasePricesResponse.create = function create(properties) { - return new GetTokenDirectPurchasePricesResponse(properties); - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenDirectPurchasePricesResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenDirectPurchasePricesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenDirectPurchasePricesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse - */ - GetTokenDirectPurchasePricesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenDirectPurchasePricesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenDirectPurchasePricesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenDirectPurchasePricesResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @instance - * @returns {Object.} JSON object - */ - GetTokenDirectPurchasePricesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = (function() { - - /** - * Properties of a GetTokenDirectPurchasePricesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @interface IGetTokenDirectPurchasePricesResponseV0 - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null} [tokenDirectPurchasePrices] GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenDirectPurchasePricesResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenDirectPurchasePricesResponseV0 metadata - */ - - /** - * Constructs a new GetTokenDirectPurchasePricesResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse - * @classdesc Represents a GetTokenDirectPurchasePricesResponseV0. - * @implements IGetTokenDirectPurchasePricesResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set - */ - function GetTokenDirectPurchasePricesResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null|undefined} tokenDirectPurchasePrices - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - */ - GetTokenDirectPurchasePricesResponseV0.prototype.tokenDirectPurchasePrices = null; - - /** - * GetTokenDirectPurchasePricesResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - */ - GetTokenDirectPurchasePricesResponseV0.prototype.proof = null; - - /** - * GetTokenDirectPurchasePricesResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - */ - GetTokenDirectPurchasePricesResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenDirectPurchasePricesResponseV0 result. - * @member {"tokenDirectPurchasePrices"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - */ - Object.defineProperty(GetTokenDirectPurchasePricesResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenDirectPurchasePrices", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenDirectPurchasePricesResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 instance - */ - GetTokenDirectPurchasePricesResponseV0.create = function create(properties) { - return new GetTokenDirectPurchasePricesResponseV0(properties); - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenDirectPurchasePrices != null && Object.hasOwnProperty.call(message, "tokenDirectPurchasePrices")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.encode(message.tokenDirectPurchasePrices, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenDirectPurchasePricesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenDirectPurchasePricesResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenDirectPurchasePricesResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenDirectPurchasePricesResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify(message.tokenDirectPurchasePrices); - if (error) - return "tokenDirectPurchasePrices." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTokenDirectPurchasePricesResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 - */ - GetTokenDirectPurchasePricesResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); - if (object.tokenDirectPurchasePrices != null) { - if (typeof object.tokenDirectPurchasePrices !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.tokenDirectPurchasePrices: object expected"); - message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.fromObject(object.tokenDirectPurchasePrices); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenDirectPurchasePricesResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenDirectPurchasePricesResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { - object.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(message.tokenDirectPurchasePrices, options); - if (options.oneofs) - object.result = "tokenDirectPurchasePrices"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTokenDirectPurchasePricesResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenDirectPurchasePricesResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = (function() { - - /** - * Properties of a PriceForQuantity. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface IPriceForQuantity - * @property {number|Long|null} [quantity] PriceForQuantity quantity - * @property {number|Long|null} [price] PriceForQuantity price - */ - - /** - * Constructs a new PriceForQuantity. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a PriceForQuantity. - * @implements IPriceForQuantity - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set - */ - function PriceForQuantity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PriceForQuantity quantity. - * @member {number|Long} quantity - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @instance - */ - PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PriceForQuantity price. - * @member {number|Long} price - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @instance - */ - PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new PriceForQuantity instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity instance - */ - PriceForQuantity.create = function create(properties) { - return new PriceForQuantity(properties); - }; - - /** - * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceForQuantity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); - return writer; - }; - - /** - * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PriceForQuantity message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceForQuantity.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quantity = reader.uint64(); - break; - case 2: - message.price = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PriceForQuantity message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PriceForQuantity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quantity != null && message.hasOwnProperty("quantity")) - if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) - return "quantity: integer|Long expected"; - if (message.price != null && message.hasOwnProperty("price")) - if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) - return "price: integer|Long expected"; - return null; - }; - - /** - * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity - */ - PriceForQuantity.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); - if (object.quantity != null) - if ($util.Long) - (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; - else if (typeof object.quantity === "string") - message.quantity = parseInt(object.quantity, 10); - else if (typeof object.quantity === "number") - message.quantity = object.quantity; - else if (typeof object.quantity === "object") - message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); - if (object.price != null) - if ($util.Long) - (message.price = $util.Long.fromValue(object.price)).unsigned = true; - else if (typeof object.price === "string") - message.price = parseInt(object.price, 10); - else if (typeof object.price === "number") - message.price = object.price; - else if (typeof object.price === "object") - message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} message PriceForQuantity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PriceForQuantity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.quantity = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.price = options.longs === String ? "0" : 0; - } - if (message.quantity != null && message.hasOwnProperty("quantity")) - if (typeof message.quantity === "number") - object.quantity = options.longs === String ? String(message.quantity) : message.quantity; - else - object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; - if (message.price != null && message.hasOwnProperty("price")) - if (typeof message.price === "number") - object.price = options.longs === String ? String(message.price) : message.price; - else - object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; - return object; - }; - - /** - * Converts this PriceForQuantity to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity - * @instance - * @returns {Object.} JSON object - */ - PriceForQuantity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PriceForQuantity; - })(); - - GetTokenDirectPurchasePricesResponseV0.PricingSchedule = (function() { - - /** - * Properties of a PricingSchedule. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface IPricingSchedule - * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity - */ - - /** - * Constructs a new PricingSchedule. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a PricingSchedule. - * @implements IPricingSchedule - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set - */ - function PricingSchedule(properties) { - this.priceForQuantity = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PricingSchedule priceForQuantity. - * @member {Array.} priceForQuantity - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @instance - */ - PricingSchedule.prototype.priceForQuantity = $util.emptyArray; - - /** - * Creates a new PricingSchedule instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule instance - */ - PricingSchedule.create = function create(properties) { - return new PricingSchedule(properties); - }; - - /** - * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PricingSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.priceForQuantity != null && message.priceForQuantity.length) - for (var i = 0; i < message.priceForQuantity.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PricingSchedule message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PricingSchedule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.priceForQuantity && message.priceForQuantity.length)) - message.priceForQuantity = []; - message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PricingSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PricingSchedule message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PricingSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { - if (!Array.isArray(message.priceForQuantity)) - return "priceForQuantity: array expected"; - for (var i = 0; i < message.priceForQuantity.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify(message.priceForQuantity[i]); - if (error) - return "priceForQuantity." + error; - } - } - return null; - }; - - /** - * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule - */ - PricingSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); - if (object.priceForQuantity) { - if (!Array.isArray(object.priceForQuantity)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: array expected"); - message.priceForQuantity = []; - for (var i = 0; i < object.priceForQuantity.length; ++i) { - if (typeof object.priceForQuantity[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: object expected"); - message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.fromObject(object.priceForQuantity[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} message PricingSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PricingSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.priceForQuantity = []; - if (message.priceForQuantity && message.priceForQuantity.length) { - object.priceForQuantity = []; - for (var j = 0; j < message.priceForQuantity.length; ++j) - object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject(message.priceForQuantity[j], options); - } - return object; - }; - - /** - * Converts this PricingSchedule to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule - * @instance - * @returns {Object.} JSON object - */ - PricingSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PricingSchedule; - })(); - - GetTokenDirectPurchasePricesResponseV0.Price = (function() { - - /** - * Properties of a Price. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface IPrice - * @property {number|Long|null} [fixedPrice] Price fixedPrice - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null} [variablePrice] Price variablePrice - */ - - /** - * Constructs a new Price. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a Price. - * @implements IPrice - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice=} [properties] Properties to set - */ - function Price(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Price fixedPrice. - * @member {number|Long} fixedPrice - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @instance - */ - Price.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Price variablePrice. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null|undefined} variablePrice - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @instance - */ - Price.prototype.variablePrice = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Price price. - * @member {"fixedPrice"|"variablePrice"|undefined} price - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @instance - */ - Object.defineProperty(Price.prototype, "price", { - get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Price instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price instance - */ - Price.create = function create(properties) { - return new Price(properties); - }; - - /** - * Encodes the specified Price message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice} message Price message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Price.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.fixedPrice); - if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Price message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice} message Price message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Price.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Price message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Price.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fixedPrice = reader.uint64(); - break; - case 2: - message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Price message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Price.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Price message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Price.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { - properties.price = 1; - if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) - return "fixedPrice: integer|Long expected"; - } - if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { - if (properties.price === 1) - return "price: multiple values"; - properties.price = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify(message.variablePrice); - if (error) - return "variablePrice." + error; - } - } - return null; - }; - - /** - * Creates a Price message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} Price - */ - Price.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price(); - if (object.fixedPrice != null) - if ($util.Long) - (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; - else if (typeof object.fixedPrice === "string") - message.fixedPrice = parseInt(object.fixedPrice, 10); - else if (typeof object.fixedPrice === "number") - message.fixedPrice = object.fixedPrice; - else if (typeof object.fixedPrice === "object") - message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); - if (object.variablePrice != null) { - if (typeof object.variablePrice !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.variablePrice: object expected"); - message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.fromObject(object.variablePrice); - } - return message; - }; - - /** - * Creates a plain object from a Price message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} message Price - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Price.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { - if (typeof message.fixedPrice === "number") - object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; - else - object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; - if (options.oneofs) - object.price = "fixedPrice"; - } - if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { - object.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(message.variablePrice, options); - if (options.oneofs) - object.price = "variablePrice"; - } - return object; - }; - - /** - * Converts this Price to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price - * @instance - * @returns {Object.} JSON object - */ - Price.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Price; - })(); - - GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = (function() { - - /** - * Properties of a TokenDirectPurchasePriceEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface ITokenDirectPurchasePriceEntry - * @property {Uint8Array|null} [tokenId] TokenDirectPurchasePriceEntry tokenId - * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice|null} [price] TokenDirectPurchasePriceEntry price - */ - - /** - * Constructs a new TokenDirectPurchasePriceEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a TokenDirectPurchasePriceEntry. - * @implements ITokenDirectPurchasePriceEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set - */ - function TokenDirectPurchasePriceEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenDirectPurchasePriceEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @instance - */ - TokenDirectPurchasePriceEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenDirectPurchasePriceEntry price. - * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPrice|null|undefined} price - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @instance - */ - TokenDirectPurchasePriceEntry.prototype.price = null; - - /** - * Creates a new TokenDirectPurchasePriceEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry instance - */ - TokenDirectPurchasePriceEntry.create = function create(properties) { - return new TokenDirectPurchasePriceEntry(properties); - }; - - /** - * Encodes the specified TokenDirectPurchasePriceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDirectPurchasePriceEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.encode(message.price, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenDirectPurchasePriceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDirectPurchasePriceEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDirectPurchasePriceEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDirectPurchasePriceEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenDirectPurchasePriceEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenDirectPurchasePriceEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.price != null && message.hasOwnProperty("price")) { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.verify(message.price); - if (error) - return "price." + error; - } - return null; - }; - - /** - * Creates a TokenDirectPurchasePriceEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry - */ - TokenDirectPurchasePriceEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.price != null) { - if (typeof object.price !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.price: object expected"); - message.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.fromObject(object.price); - } - return message; - }; - - /** - * Creates a plain object from a TokenDirectPurchasePriceEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenDirectPurchasePriceEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.price = null; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.price != null && message.hasOwnProperty("price")) - object.price = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(message.price, options); - return object; - }; - - /** - * Converts this TokenDirectPurchasePriceEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry - * @instance - * @returns {Object.} JSON object - */ - TokenDirectPurchasePriceEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenDirectPurchasePriceEntry; - })(); - - GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = (function() { - - /** - * Properties of a TokenDirectPurchasePrices. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @interface ITokenDirectPurchasePrices - * @property {Array.|null} [tokenDirectPurchasePrice] TokenDirectPurchasePrices tokenDirectPurchasePrice - */ - - /** - * Constructs a new TokenDirectPurchasePrices. - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 - * @classdesc Represents a TokenDirectPurchasePrices. - * @implements ITokenDirectPurchasePrices - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set - */ - function TokenDirectPurchasePrices(properties) { - this.tokenDirectPurchasePrice = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenDirectPurchasePrices tokenDirectPurchasePrice. - * @member {Array.} tokenDirectPurchasePrice - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @instance - */ - TokenDirectPurchasePrices.prototype.tokenDirectPurchasePrice = $util.emptyArray; - - /** - * Creates a new TokenDirectPurchasePrices instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices instance - */ - TokenDirectPurchasePrices.create = function create(properties) { - return new TokenDirectPurchasePrices(properties); - }; - - /** - * Encodes the specified TokenDirectPurchasePrices message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDirectPurchasePrices.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenDirectPurchasePrice != null && message.tokenDirectPurchasePrice.length) - for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.encode(message.tokenDirectPurchasePrice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenDirectPurchasePrices message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDirectPurchasePrices.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDirectPurchasePrices.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length)) - message.tokenDirectPurchasePrice = []; - message.tokenDirectPurchasePrice.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDirectPurchasePrices.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenDirectPurchasePrices message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenDirectPurchasePrices.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenDirectPurchasePrice != null && message.hasOwnProperty("tokenDirectPurchasePrice")) { - if (!Array.isArray(message.tokenDirectPurchasePrice)) - return "tokenDirectPurchasePrice: array expected"; - for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify(message.tokenDirectPurchasePrice[i]); - if (error) - return "tokenDirectPurchasePrice." + error; - } - } - return null; - }; - - /** - * Creates a TokenDirectPurchasePrices message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices - */ - TokenDirectPurchasePrices.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); - if (object.tokenDirectPurchasePrice) { - if (!Array.isArray(object.tokenDirectPurchasePrice)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: array expected"); - message.tokenDirectPurchasePrice = []; - for (var i = 0; i < object.tokenDirectPurchasePrice.length; ++i) { - if (typeof object.tokenDirectPurchasePrice[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: object expected"); - message.tokenDirectPurchasePrice[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.fromObject(object.tokenDirectPurchasePrice[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenDirectPurchasePrices message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @static - * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} message TokenDirectPurchasePrices - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenDirectPurchasePrices.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenDirectPurchasePrice = []; - if (message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length) { - object.tokenDirectPurchasePrice = []; - for (var j = 0; j < message.tokenDirectPurchasePrice.length; ++j) - object.tokenDirectPurchasePrice[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject(message.tokenDirectPurchasePrice[j], options); - } - return object; - }; - - /** - * Converts this TokenDirectPurchasePrices to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices - * @instance - * @returns {Object.} JSON object - */ - TokenDirectPurchasePrices.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenDirectPurchasePrices; - })(); - - return GetTokenDirectPurchasePricesResponseV0; - })(); - - return GetTokenDirectPurchasePricesResponse; - })(); - - v0.GetTokenPreProgrammedDistributionsRequest = (function() { - - /** - * Properties of a GetTokenPreProgrammedDistributionsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenPreProgrammedDistributionsRequest - * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null} [v0] GetTokenPreProgrammedDistributionsRequest v0 - */ - - /** - * Constructs a new GetTokenPreProgrammedDistributionsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenPreProgrammedDistributionsRequest. - * @implements IGetTokenPreProgrammedDistributionsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set - */ - function GetTokenPreProgrammedDistributionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenPreProgrammedDistributionsRequest v0. - * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @instance - */ - GetTokenPreProgrammedDistributionsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenPreProgrammedDistributionsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @instance - */ - Object.defineProperty(GetTokenPreProgrammedDistributionsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenPreProgrammedDistributionsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest instance - */ - GetTokenPreProgrammedDistributionsRequest.create = function create(properties) { - return new GetTokenPreProgrammedDistributionsRequest(properties); - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenPreProgrammedDistributionsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenPreProgrammedDistributionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenPreProgrammedDistributionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest - */ - GetTokenPreProgrammedDistributionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenPreProgrammedDistributionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenPreProgrammedDistributionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenPreProgrammedDistributionsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @instance - * @returns {Object.} JSON object - */ - GetTokenPreProgrammedDistributionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 = (function() { - - /** - * Properties of a GetTokenPreProgrammedDistributionsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @interface IGetTokenPreProgrammedDistributionsRequestV0 - * @property {Uint8Array|null} [tokenId] GetTokenPreProgrammedDistributionsRequestV0 tokenId - * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null} [startAtInfo] GetTokenPreProgrammedDistributionsRequestV0 startAtInfo - * @property {number|null} [limit] GetTokenPreProgrammedDistributionsRequestV0 limit - * @property {boolean|null} [prove] GetTokenPreProgrammedDistributionsRequestV0 prove - */ - - /** - * Constructs a new GetTokenPreProgrammedDistributionsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest - * @classdesc Represents a GetTokenPreProgrammedDistributionsRequestV0. - * @implements IGetTokenPreProgrammedDistributionsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set - */ - function GetTokenPreProgrammedDistributionsRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenPreProgrammedDistributionsRequestV0 tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.tokenId = $util.newBuffer([]); - - /** - * GetTokenPreProgrammedDistributionsRequestV0 startAtInfo. - * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null|undefined} startAtInfo - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.startAtInfo = null; - - /** - * GetTokenPreProgrammedDistributionsRequestV0 limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.limit = 0; - - /** - * GetTokenPreProgrammedDistributionsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.prove = false; - - /** - * Creates a new GetTokenPreProgrammedDistributionsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 instance - */ - GetTokenPreProgrammedDistributionsRequestV0.create = function create(properties) { - return new GetTokenPreProgrammedDistributionsRequestV0(properties); - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.startAtInfo != null && Object.hasOwnProperty.call(message, "startAtInfo")) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.encode(message.startAtInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.decode(reader, reader.uint32()); - break; - case 3: - message.limit = reader.uint32(); - break; - case 4: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenPreProgrammedDistributionsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenPreProgrammedDistributionsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify(message.startAtInfo); - if (error) - return "startAtInfo." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTokenPreProgrammedDistributionsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 - */ - GetTokenPreProgrammedDistributionsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.startAtInfo != null) { - if (typeof object.startAtInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.startAtInfo: object expected"); - message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.fromObject(object.startAtInfo); - } - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTokenPreProgrammedDistributionsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenPreProgrammedDistributionsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.startAtInfo = null; - object.limit = 0; - object.prove = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) - object.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.toObject(message.startAtInfo, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTokenPreProgrammedDistributionsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenPreProgrammedDistributionsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo = (function() { - - /** - * Properties of a StartAtInfo. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @interface IStartAtInfo - * @property {number|Long|null} [startTimeMs] StartAtInfo startTimeMs - * @property {Uint8Array|null} [startRecipient] StartAtInfo startRecipient - * @property {boolean|null} [startRecipientIncluded] StartAtInfo startRecipientIncluded - */ - - /** - * Constructs a new StartAtInfo. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 - * @classdesc Represents a StartAtInfo. - * @implements IStartAtInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set - */ - function StartAtInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtInfo startTimeMs. - * @member {number|Long} startTimeMs - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @instance - */ - StartAtInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StartAtInfo startRecipient. - * @member {Uint8Array} startRecipient - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @instance - */ - StartAtInfo.prototype.startRecipient = $util.newBuffer([]); - - /** - * StartAtInfo startRecipientIncluded. - * @member {boolean} startRecipientIncluded - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @instance - */ - StartAtInfo.prototype.startRecipientIncluded = false; - - /** - * Creates a new StartAtInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo instance - */ - StartAtInfo.create = function create(properties) { - return new StartAtInfo(properties); - }; - - /** - * Encodes the specified StartAtInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); - if (message.startRecipient != null && Object.hasOwnProperty.call(message, "startRecipient")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startRecipient); - if (message.startRecipientIncluded != null && Object.hasOwnProperty.call(message, "startRecipientIncluded")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.startRecipientIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTimeMs = reader.uint64(); - break; - case 2: - message.startRecipient = reader.bytes(); - break; - case 3: - message.startRecipientIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) - if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) - return "startTimeMs: integer|Long expected"; - if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) - if (!(message.startRecipient && typeof message.startRecipient.length === "number" || $util.isString(message.startRecipient))) - return "startRecipient: buffer expected"; - if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) - if (typeof message.startRecipientIncluded !== "boolean") - return "startRecipientIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo - */ - StartAtInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); - if (object.startTimeMs != null) - if ($util.Long) - (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; - else if (typeof object.startTimeMs === "string") - message.startTimeMs = parseInt(object.startTimeMs, 10); - else if (typeof object.startTimeMs === "number") - message.startTimeMs = object.startTimeMs; - else if (typeof object.startTimeMs === "object") - message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); - if (object.startRecipient != null) - if (typeof object.startRecipient === "string") - $util.base64.decode(object.startRecipient, message.startRecipient = $util.newBuffer($util.base64.length(object.startRecipient)), 0); - else if (object.startRecipient.length >= 0) - message.startRecipient = object.startRecipient; - if (object.startRecipientIncluded != null) - message.startRecipientIncluded = Boolean(object.startRecipientIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} message StartAtInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startTimeMs = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.startRecipient = ""; - else { - object.startRecipient = []; - if (options.bytes !== Array) - object.startRecipient = $util.newBuffer(object.startRecipient); - } - object.startRecipientIncluded = false; - } - if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) - if (typeof message.startTimeMs === "number") - object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; - else - object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; - if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) - object.startRecipient = options.bytes === String ? $util.base64.encode(message.startRecipient, 0, message.startRecipient.length) : options.bytes === Array ? Array.prototype.slice.call(message.startRecipient) : message.startRecipient; - if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) - object.startRecipientIncluded = message.startRecipientIncluded; - return object; - }; - - /** - * Converts this StartAtInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo - * @instance - * @returns {Object.} JSON object - */ - StartAtInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtInfo; - })(); - - return GetTokenPreProgrammedDistributionsRequestV0; - })(); - - return GetTokenPreProgrammedDistributionsRequest; - })(); - - v0.GetTokenPreProgrammedDistributionsResponse = (function() { - - /** - * Properties of a GetTokenPreProgrammedDistributionsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenPreProgrammedDistributionsResponse - * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null} [v0] GetTokenPreProgrammedDistributionsResponse v0 - */ - - /** - * Constructs a new GetTokenPreProgrammedDistributionsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenPreProgrammedDistributionsResponse. - * @implements IGetTokenPreProgrammedDistributionsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set - */ - function GetTokenPreProgrammedDistributionsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenPreProgrammedDistributionsResponse v0. - * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @instance - */ - GetTokenPreProgrammedDistributionsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenPreProgrammedDistributionsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @instance - */ - Object.defineProperty(GetTokenPreProgrammedDistributionsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenPreProgrammedDistributionsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse instance - */ - GetTokenPreProgrammedDistributionsResponse.create = function create(properties) { - return new GetTokenPreProgrammedDistributionsResponse(properties); - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenPreProgrammedDistributionsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenPreProgrammedDistributionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenPreProgrammedDistributionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse - */ - GetTokenPreProgrammedDistributionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenPreProgrammedDistributionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenPreProgrammedDistributionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenPreProgrammedDistributionsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @instance - * @returns {Object.} JSON object - */ - GetTokenPreProgrammedDistributionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 = (function() { - - /** - * Properties of a GetTokenPreProgrammedDistributionsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @interface IGetTokenPreProgrammedDistributionsResponseV0 - * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null} [tokenDistributions] GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenPreProgrammedDistributionsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenPreProgrammedDistributionsResponseV0 metadata - */ - - /** - * Constructs a new GetTokenPreProgrammedDistributionsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse - * @classdesc Represents a GetTokenPreProgrammedDistributionsResponseV0. - * @implements IGetTokenPreProgrammedDistributionsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set - */ - function GetTokenPreProgrammedDistributionsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions. - * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null|undefined} tokenDistributions - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - */ - GetTokenPreProgrammedDistributionsResponseV0.prototype.tokenDistributions = null; - - /** - * GetTokenPreProgrammedDistributionsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - */ - GetTokenPreProgrammedDistributionsResponseV0.prototype.proof = null; - - /** - * GetTokenPreProgrammedDistributionsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - */ - GetTokenPreProgrammedDistributionsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenPreProgrammedDistributionsResponseV0 result. - * @member {"tokenDistributions"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - */ - Object.defineProperty(GetTokenPreProgrammedDistributionsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenDistributions", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenPreProgrammedDistributionsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 instance - */ - GetTokenPreProgrammedDistributionsResponseV0.create = function create(properties) { - return new GetTokenPreProgrammedDistributionsResponseV0(properties); - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenDistributions != null && Object.hasOwnProperty.call(message, "tokenDistributions")) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.encode(message.tokenDistributions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenPreProgrammedDistributionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenPreProgrammedDistributionsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenPreProgrammedDistributionsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenPreProgrammedDistributionsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify(message.tokenDistributions); - if (error) - return "tokenDistributions." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTokenPreProgrammedDistributionsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 - */ - GetTokenPreProgrammedDistributionsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); - if (object.tokenDistributions != null) { - if (typeof object.tokenDistributions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.tokenDistributions: object expected"); - message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.fromObject(object.tokenDistributions); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenPreProgrammedDistributionsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenPreProgrammedDistributionsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { - object.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.toObject(message.tokenDistributions, options); - if (options.oneofs) - object.result = "tokenDistributions"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTokenPreProgrammedDistributionsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenPreProgrammedDistributionsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry = (function() { - - /** - * Properties of a TokenDistributionEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @interface ITokenDistributionEntry - * @property {Uint8Array|null} [recipientId] TokenDistributionEntry recipientId - * @property {number|Long|null} [amount] TokenDistributionEntry amount - */ - - /** - * Constructs a new TokenDistributionEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @classdesc Represents a TokenDistributionEntry. - * @implements ITokenDistributionEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set - */ - function TokenDistributionEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenDistributionEntry recipientId. - * @member {Uint8Array} recipientId - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @instance - */ - TokenDistributionEntry.prototype.recipientId = $util.newBuffer([]); - - /** - * TokenDistributionEntry amount. - * @member {number|Long} amount - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @instance - */ - TokenDistributionEntry.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new TokenDistributionEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry instance - */ - TokenDistributionEntry.create = function create(properties) { - return new TokenDistributionEntry(properties); - }; - - /** - * Encodes the specified TokenDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDistributionEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.recipientId); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); - return writer; - }; - - /** - * Encodes the specified TokenDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenDistributionEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDistributionEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.recipientId = reader.bytes(); - break; - case 2: - message.amount = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenDistributionEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDistributionEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenDistributionEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenDistributionEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recipientId != null && message.hasOwnProperty("recipientId")) - if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) - return "recipientId: buffer expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - return null; - }; - - /** - * Creates a TokenDistributionEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry - */ - TokenDistributionEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); - if (object.recipientId != null) - if (typeof object.recipientId === "string") - $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); - else if (object.recipientId.length >= 0) - message.recipientId = object.recipientId; - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TokenDistributionEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} message TokenDistributionEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenDistributionEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.recipientId = ""; - else { - object.recipientId = []; - if (options.bytes !== Array) - object.recipientId = $util.newBuffer(object.recipientId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - } - if (message.recipientId != null && message.hasOwnProperty("recipientId")) - object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - return object; - }; - - /** - * Converts this TokenDistributionEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry - * @instance - * @returns {Object.} JSON object - */ - TokenDistributionEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenDistributionEntry; - })(); - - GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry = (function() { - - /** - * Properties of a TokenTimedDistributionEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @interface ITokenTimedDistributionEntry - * @property {number|Long|null} [timestamp] TokenTimedDistributionEntry timestamp - * @property {Array.|null} [distributions] TokenTimedDistributionEntry distributions - */ - - /** - * Constructs a new TokenTimedDistributionEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @classdesc Represents a TokenTimedDistributionEntry. - * @implements ITokenTimedDistributionEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set - */ - function TokenTimedDistributionEntry(properties) { - this.distributions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenTimedDistributionEntry timestamp. - * @member {number|Long} timestamp - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @instance - */ - TokenTimedDistributionEntry.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * TokenTimedDistributionEntry distributions. - * @member {Array.} distributions - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @instance - */ - TokenTimedDistributionEntry.prototype.distributions = $util.emptyArray; - - /** - * Creates a new TokenTimedDistributionEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry instance - */ - TokenTimedDistributionEntry.create = function create(properties) { - return new TokenTimedDistributionEntry(properties); - }; - - /** - * Encodes the specified TokenTimedDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenTimedDistributionEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); - if (message.distributions != null && message.distributions.length) - for (var i = 0; i < message.distributions.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.encode(message.distributions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenTimedDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenTimedDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenTimedDistributionEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.timestamp = reader.uint64(); - break; - case 2: - if (!(message.distributions && message.distributions.length)) - message.distributions = []; - message.distributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenTimedDistributionEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenTimedDistributionEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenTimedDistributionEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.distributions != null && message.hasOwnProperty("distributions")) { - if (!Array.isArray(message.distributions)) - return "distributions: array expected"; - for (var i = 0; i < message.distributions.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify(message.distributions[i]); - if (error) - return "distributions." + error; - } - } - return null; - }; - - /** - * Creates a TokenTimedDistributionEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry - */ - TokenTimedDistributionEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.distributions) { - if (!Array.isArray(object.distributions)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: array expected"); - message.distributions = []; - for (var i = 0; i < object.distributions.length; ++i) { - if (typeof object.distributions[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: object expected"); - message.distributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.fromObject(object.distributions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenTimedDistributionEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} message TokenTimedDistributionEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenTimedDistributionEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.distributions = []; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.distributions && message.distributions.length) { - object.distributions = []; - for (var j = 0; j < message.distributions.length; ++j) - object.distributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.toObject(message.distributions[j], options); - } - return object; - }; - - /** - * Converts this TokenTimedDistributionEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry - * @instance - * @returns {Object.} JSON object - */ - TokenTimedDistributionEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenTimedDistributionEntry; - })(); - - GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions = (function() { - - /** - * Properties of a TokenDistributions. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @interface ITokenDistributions - * @property {Array.|null} [tokenDistributions] TokenDistributions tokenDistributions - */ - - /** - * Constructs a new TokenDistributions. - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 - * @classdesc Represents a TokenDistributions. - * @implements ITokenDistributions - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set - */ - function TokenDistributions(properties) { - this.tokenDistributions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenDistributions tokenDistributions. - * @member {Array.} tokenDistributions - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @instance - */ - TokenDistributions.prototype.tokenDistributions = $util.emptyArray; - - /** - * Creates a new TokenDistributions instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions instance - */ - TokenDistributions.create = function create(properties) { - return new TokenDistributions(properties); - }; - - /** - * Encodes the specified TokenDistributions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDistributions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenDistributions != null && message.tokenDistributions.length) - for (var i = 0; i < message.tokenDistributions.length; ++i) - $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.encode(message.tokenDistributions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenDistributions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenDistributions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenDistributions message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDistributions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.tokenDistributions && message.tokenDistributions.length)) - message.tokenDistributions = []; - message.tokenDistributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenDistributions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenDistributions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenDistributions message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenDistributions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { - if (!Array.isArray(message.tokenDistributions)) - return "tokenDistributions: array expected"; - for (var i = 0; i < message.tokenDistributions.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify(message.tokenDistributions[i]); - if (error) - return "tokenDistributions." + error; - } - } - return null; - }; - - /** - * Creates a TokenDistributions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions - */ - TokenDistributions.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); - if (object.tokenDistributions) { - if (!Array.isArray(object.tokenDistributions)) - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: array expected"); - message.tokenDistributions = []; - for (var i = 0; i < object.tokenDistributions.length; ++i) { - if (typeof object.tokenDistributions[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: object expected"); - message.tokenDistributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.fromObject(object.tokenDistributions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TokenDistributions message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @static - * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} message TokenDistributions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenDistributions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tokenDistributions = []; - if (message.tokenDistributions && message.tokenDistributions.length) { - object.tokenDistributions = []; - for (var j = 0; j < message.tokenDistributions.length; ++j) - object.tokenDistributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.toObject(message.tokenDistributions[j], options); - } - return object; - }; - - /** - * Converts this TokenDistributions to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions - * @instance - * @returns {Object.} JSON object - */ - TokenDistributions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenDistributions; - })(); - - return GetTokenPreProgrammedDistributionsResponseV0; - })(); - - return GetTokenPreProgrammedDistributionsResponse; - })(); - - v0.GetTokenTotalSupplyRequest = (function() { - - /** - * Properties of a GetTokenTotalSupplyRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenTotalSupplyRequest - * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null} [v0] GetTokenTotalSupplyRequest v0 - */ - - /** - * Constructs a new GetTokenTotalSupplyRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenTotalSupplyRequest. - * @implements IGetTokenTotalSupplyRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set - */ - function GetTokenTotalSupplyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenTotalSupplyRequest v0. - * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @instance - */ - GetTokenTotalSupplyRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenTotalSupplyRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @instance - */ - Object.defineProperty(GetTokenTotalSupplyRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenTotalSupplyRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest instance - */ - GetTokenTotalSupplyRequest.create = function create(properties) { - return new GetTokenTotalSupplyRequest(properties); - }; - - /** - * Encodes the specified GetTokenTotalSupplyRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenTotalSupplyRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenTotalSupplyRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenTotalSupplyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenTotalSupplyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest - */ - GetTokenTotalSupplyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenTotalSupplyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenTotalSupplyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenTotalSupplyRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @instance - * @returns {Object.} JSON object - */ - GetTokenTotalSupplyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 = (function() { - - /** - * Properties of a GetTokenTotalSupplyRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @interface IGetTokenTotalSupplyRequestV0 - * @property {Uint8Array|null} [tokenId] GetTokenTotalSupplyRequestV0 tokenId - * @property {boolean|null} [prove] GetTokenTotalSupplyRequestV0 prove - */ - - /** - * Constructs a new GetTokenTotalSupplyRequestV0. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest - * @classdesc Represents a GetTokenTotalSupplyRequestV0. - * @implements IGetTokenTotalSupplyRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set - */ - function GetTokenTotalSupplyRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenTotalSupplyRequestV0 tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @instance - */ - GetTokenTotalSupplyRequestV0.prototype.tokenId = $util.newBuffer([]); - - /** - * GetTokenTotalSupplyRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @instance - */ - GetTokenTotalSupplyRequestV0.prototype.prove = false; - - /** - * Creates a new GetTokenTotalSupplyRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 instance - */ - GetTokenTotalSupplyRequestV0.create = function create(properties) { - return new GetTokenTotalSupplyRequestV0(properties); - }; - - /** - * Encodes the specified GetTokenTotalSupplyRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetTokenTotalSupplyRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenTotalSupplyRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenTotalSupplyRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetTokenTotalSupplyRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 - */ - GetTokenTotalSupplyRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetTokenTotalSupplyRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenTotalSupplyRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - object.prove = false; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetTokenTotalSupplyRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenTotalSupplyRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetTokenTotalSupplyRequestV0; - })(); - - return GetTokenTotalSupplyRequest; - })(); - - v0.GetTokenTotalSupplyResponse = (function() { - - /** - * Properties of a GetTokenTotalSupplyResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetTokenTotalSupplyResponse - * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null} [v0] GetTokenTotalSupplyResponse v0 - */ - - /** - * Constructs a new GetTokenTotalSupplyResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetTokenTotalSupplyResponse. - * @implements IGetTokenTotalSupplyResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set - */ - function GetTokenTotalSupplyResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenTotalSupplyResponse v0. - * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @instance - */ - GetTokenTotalSupplyResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenTotalSupplyResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @instance - */ - Object.defineProperty(GetTokenTotalSupplyResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenTotalSupplyResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse instance - */ - GetTokenTotalSupplyResponse.create = function create(properties) { - return new GetTokenTotalSupplyResponse(properties); - }; - - /** - * Encodes the specified GetTokenTotalSupplyResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenTotalSupplyResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenTotalSupplyResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenTotalSupplyResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetTokenTotalSupplyResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse - */ - GetTokenTotalSupplyResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenTotalSupplyResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenTotalSupplyResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetTokenTotalSupplyResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @instance - * @returns {Object.} JSON object - */ - GetTokenTotalSupplyResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 = (function() { - - /** - * Properties of a GetTokenTotalSupplyResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @interface IGetTokenTotalSupplyResponseV0 - * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null} [tokenTotalSupply] GetTokenTotalSupplyResponseV0 tokenTotalSupply - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenTotalSupplyResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenTotalSupplyResponseV0 metadata - */ - - /** - * Constructs a new GetTokenTotalSupplyResponseV0. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse - * @classdesc Represents a GetTokenTotalSupplyResponseV0. - * @implements IGetTokenTotalSupplyResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set - */ - function GetTokenTotalSupplyResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTokenTotalSupplyResponseV0 tokenTotalSupply. - * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null|undefined} tokenTotalSupply - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - */ - GetTokenTotalSupplyResponseV0.prototype.tokenTotalSupply = null; - - /** - * GetTokenTotalSupplyResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - */ - GetTokenTotalSupplyResponseV0.prototype.proof = null; - - /** - * GetTokenTotalSupplyResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - */ - GetTokenTotalSupplyResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetTokenTotalSupplyResponseV0 result. - * @member {"tokenTotalSupply"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - */ - Object.defineProperty(GetTokenTotalSupplyResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["tokenTotalSupply", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetTokenTotalSupplyResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 instance - */ - GetTokenTotalSupplyResponseV0.create = function create(properties) { - return new GetTokenTotalSupplyResponseV0(properties); - }; - - /** - * Encodes the specified GetTokenTotalSupplyResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenTotalSupply != null && Object.hasOwnProperty.call(message, "tokenTotalSupply")) - $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.encode(message.tokenTotalSupply, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetTokenTotalSupplyResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTokenTotalSupplyResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTokenTotalSupplyResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTokenTotalSupplyResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTokenTotalSupplyResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify(message.tokenTotalSupply); - if (error) - return "tokenTotalSupply." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetTokenTotalSupplyResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 - */ - GetTokenTotalSupplyResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); - if (object.tokenTotalSupply != null) { - if (typeof object.tokenTotalSupply !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.tokenTotalSupply: object expected"); - message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.fromObject(object.tokenTotalSupply); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetTokenTotalSupplyResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTokenTotalSupplyResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { - object.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.toObject(message.tokenTotalSupply, options); - if (options.oneofs) - object.result = "tokenTotalSupply"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetTokenTotalSupplyResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetTokenTotalSupplyResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry = (function() { - - /** - * Properties of a TokenTotalSupplyEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @interface ITokenTotalSupplyEntry - * @property {Uint8Array|null} [tokenId] TokenTotalSupplyEntry tokenId - * @property {number|Long|null} [totalAggregatedAmountInUserAccounts] TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts - * @property {number|Long|null} [totalSystemAmount] TokenTotalSupplyEntry totalSystemAmount - */ - - /** - * Constructs a new TokenTotalSupplyEntry. - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 - * @classdesc Represents a TokenTotalSupplyEntry. - * @implements ITokenTotalSupplyEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set - */ - function TokenTotalSupplyEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenTotalSupplyEntry tokenId. - * @member {Uint8Array} tokenId - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @instance - */ - TokenTotalSupplyEntry.prototype.tokenId = $util.newBuffer([]); - - /** - * TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts. - * @member {number|Long} totalAggregatedAmountInUserAccounts - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @instance - */ - TokenTotalSupplyEntry.prototype.totalAggregatedAmountInUserAccounts = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * TokenTotalSupplyEntry totalSystemAmount. - * @member {number|Long} totalSystemAmount - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @instance - */ - TokenTotalSupplyEntry.prototype.totalSystemAmount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new TokenTotalSupplyEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry instance - */ - TokenTotalSupplyEntry.create = function create(properties) { - return new TokenTotalSupplyEntry(properties); - }; - - /** - * Encodes the specified TokenTotalSupplyEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenTotalSupplyEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); - if (message.totalAggregatedAmountInUserAccounts != null && Object.hasOwnProperty.call(message, "totalAggregatedAmountInUserAccounts")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.totalAggregatedAmountInUserAccounts); - if (message.totalSystemAmount != null && Object.hasOwnProperty.call(message, "totalSystemAmount")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.totalSystemAmount); - return writer; - }; - - /** - * Encodes the specified TokenTotalSupplyEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenTotalSupplyEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenTotalSupplyEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenId = reader.bytes(); - break; - case 2: - message.totalAggregatedAmountInUserAccounts = reader.uint64(); - break; - case 3: - message.totalSystemAmount = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenTotalSupplyEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenTotalSupplyEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenTotalSupplyEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) - return "tokenId: buffer expected"; - if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) - if (!$util.isInteger(message.totalAggregatedAmountInUserAccounts) && !(message.totalAggregatedAmountInUserAccounts && $util.isInteger(message.totalAggregatedAmountInUserAccounts.low) && $util.isInteger(message.totalAggregatedAmountInUserAccounts.high))) - return "totalAggregatedAmountInUserAccounts: integer|Long expected"; - if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) - if (!$util.isInteger(message.totalSystemAmount) && !(message.totalSystemAmount && $util.isInteger(message.totalSystemAmount.low) && $util.isInteger(message.totalSystemAmount.high))) - return "totalSystemAmount: integer|Long expected"; - return null; - }; - - /** - * Creates a TokenTotalSupplyEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry - */ - TokenTotalSupplyEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); - if (object.tokenId != null) - if (typeof object.tokenId === "string") - $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); - else if (object.tokenId.length >= 0) - message.tokenId = object.tokenId; - if (object.totalAggregatedAmountInUserAccounts != null) - if ($util.Long) - (message.totalAggregatedAmountInUserAccounts = $util.Long.fromValue(object.totalAggregatedAmountInUserAccounts)).unsigned = true; - else if (typeof object.totalAggregatedAmountInUserAccounts === "string") - message.totalAggregatedAmountInUserAccounts = parseInt(object.totalAggregatedAmountInUserAccounts, 10); - else if (typeof object.totalAggregatedAmountInUserAccounts === "number") - message.totalAggregatedAmountInUserAccounts = object.totalAggregatedAmountInUserAccounts; - else if (typeof object.totalAggregatedAmountInUserAccounts === "object") - message.totalAggregatedAmountInUserAccounts = new $util.LongBits(object.totalAggregatedAmountInUserAccounts.low >>> 0, object.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true); - if (object.totalSystemAmount != null) - if ($util.Long) - (message.totalSystemAmount = $util.Long.fromValue(object.totalSystemAmount)).unsigned = true; - else if (typeof object.totalSystemAmount === "string") - message.totalSystemAmount = parseInt(object.totalSystemAmount, 10); - else if (typeof object.totalSystemAmount === "number") - message.totalSystemAmount = object.totalSystemAmount; - else if (typeof object.totalSystemAmount === "object") - message.totalSystemAmount = new $util.LongBits(object.totalSystemAmount.low >>> 0, object.totalSystemAmount.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TokenTotalSupplyEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @static - * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} message TokenTotalSupplyEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenTotalSupplyEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenId = ""; - else { - object.tokenId = []; - if (options.bytes !== Array) - object.tokenId = $util.newBuffer(object.tokenId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.totalAggregatedAmountInUserAccounts = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalAggregatedAmountInUserAccounts = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.totalSystemAmount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalSystemAmount = options.longs === String ? "0" : 0; - } - if (message.tokenId != null && message.hasOwnProperty("tokenId")) - object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; - if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) - if (typeof message.totalAggregatedAmountInUserAccounts === "number") - object.totalAggregatedAmountInUserAccounts = options.longs === String ? String(message.totalAggregatedAmountInUserAccounts) : message.totalAggregatedAmountInUserAccounts; - else - object.totalAggregatedAmountInUserAccounts = options.longs === String ? $util.Long.prototype.toString.call(message.totalAggregatedAmountInUserAccounts) : options.longs === Number ? new $util.LongBits(message.totalAggregatedAmountInUserAccounts.low >>> 0, message.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true) : message.totalAggregatedAmountInUserAccounts; - if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) - if (typeof message.totalSystemAmount === "number") - object.totalSystemAmount = options.longs === String ? String(message.totalSystemAmount) : message.totalSystemAmount; - else - object.totalSystemAmount = options.longs === String ? $util.Long.prototype.toString.call(message.totalSystemAmount) : options.longs === Number ? new $util.LongBits(message.totalSystemAmount.low >>> 0, message.totalSystemAmount.high >>> 0).toNumber(true) : message.totalSystemAmount; - return object; - }; - - /** - * Converts this TokenTotalSupplyEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry - * @instance - * @returns {Object.} JSON object - */ - TokenTotalSupplyEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenTotalSupplyEntry; - })(); - - return GetTokenTotalSupplyResponseV0; - })(); - - return GetTokenTotalSupplyResponse; - })(); - - v0.GetGroupInfoRequest = (function() { - - /** - * Properties of a GetGroupInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupInfoRequest - * @property {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null} [v0] GetGroupInfoRequest v0 - */ - - /** - * Constructs a new GetGroupInfoRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupInfoRequest. - * @implements IGetGroupInfoRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set - */ - function GetGroupInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfoRequest v0. - * @member {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @instance - */ - GetGroupInfoRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfoRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @instance - */ - Object.defineProperty(GetGroupInfoRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfoRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest instance - */ - GetGroupInfoRequest.create = function create(properties) { - return new GetGroupInfoRequest(properties); - }; - - /** - * Encodes the specified GetGroupInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfoRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest - */ - GetGroupInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest} message GetGroupInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupInfoRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfoRequest.GetGroupInfoRequestV0 = (function() { - - /** - * Properties of a GetGroupInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @interface IGetGroupInfoRequestV0 - * @property {Uint8Array|null} [contractId] GetGroupInfoRequestV0 contractId - * @property {number|null} [groupContractPosition] GetGroupInfoRequestV0 groupContractPosition - * @property {boolean|null} [prove] GetGroupInfoRequestV0 prove - */ - - /** - * Constructs a new GetGroupInfoRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest - * @classdesc Represents a GetGroupInfoRequestV0. - * @implements IGetGroupInfoRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set - */ - function GetGroupInfoRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfoRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @instance - */ - GetGroupInfoRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetGroupInfoRequestV0 groupContractPosition. - * @member {number} groupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @instance - */ - GetGroupInfoRequestV0.prototype.groupContractPosition = 0; - - /** - * GetGroupInfoRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @instance - */ - GetGroupInfoRequestV0.prototype.prove = false; - - /** - * Creates a new GetGroupInfoRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 instance - */ - GetGroupInfoRequestV0.create = function create(properties) { - return new GetGroupInfoRequestV0(properties); - }; - - /** - * Encodes the specified GetGroupInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetGroupInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.groupContractPosition = reader.uint32(); - break; - case 3: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfoRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfoRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - if (!$util.isInteger(message.groupContractPosition)) - return "groupContractPosition: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetGroupInfoRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 - */ - GetGroupInfoRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.groupContractPosition != null) - message.groupContractPosition = object.groupContractPosition >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetGroupInfoRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} message GetGroupInfoRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfoRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.groupContractPosition = 0; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - object.groupContractPosition = message.groupContractPosition; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetGroupInfoRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfoRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetGroupInfoRequestV0; - })(); - - return GetGroupInfoRequest; - })(); - - v0.GetGroupInfoResponse = (function() { - - /** - * Properties of a GetGroupInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupInfoResponse - * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null} [v0] GetGroupInfoResponse v0 - */ - - /** - * Constructs a new GetGroupInfoResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupInfoResponse. - * @implements IGetGroupInfoResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set - */ - function GetGroupInfoResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfoResponse v0. - * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @instance - */ - GetGroupInfoResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfoResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @instance - */ - Object.defineProperty(GetGroupInfoResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfoResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse instance - */ - GetGroupInfoResponse.create = function create(properties) { - return new GetGroupInfoResponse(properties); - }; - - /** - * Encodes the specified GetGroupInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfoResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfoResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfoResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfoResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupInfoResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse - */ - GetGroupInfoResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfoResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} message GetGroupInfoResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfoResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupInfoResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfoResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfoResponse.GetGroupInfoResponseV0 = (function() { - - /** - * Properties of a GetGroupInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @interface IGetGroupInfoResponseV0 - * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null} [groupInfo] GetGroupInfoResponseV0 groupInfo - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfoResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfoResponseV0 metadata - */ - - /** - * Constructs a new GetGroupInfoResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse - * @classdesc Represents a GetGroupInfoResponseV0. - * @implements IGetGroupInfoResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set - */ - function GetGroupInfoResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfoResponseV0 groupInfo. - * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null|undefined} groupInfo - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - */ - GetGroupInfoResponseV0.prototype.groupInfo = null; - - /** - * GetGroupInfoResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - */ - GetGroupInfoResponseV0.prototype.proof = null; - - /** - * GetGroupInfoResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - */ - GetGroupInfoResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfoResponseV0 result. - * @member {"groupInfo"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - */ - Object.defineProperty(GetGroupInfoResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["groupInfo", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfoResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 instance - */ - GetGroupInfoResponseV0.create = function create(properties) { - return new GetGroupInfoResponseV0(properties); - }; - - /** - * Encodes the specified GetGroupInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) - $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 4: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfoResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfoResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify(message.groupInfo); - if (error) - return "groupInfo." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetGroupInfoResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 - */ - GetGroupInfoResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); - if (object.groupInfo != null) { - if (typeof object.groupInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.groupInfo: object expected"); - message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.fromObject(object.groupInfo); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfoResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} message GetGroupInfoResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfoResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { - object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.toObject(message.groupInfo, options); - if (options.oneofs) - object.result = "groupInfo"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetGroupInfoResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfoResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfoResponseV0.GroupMemberEntry = (function() { - - /** - * Properties of a GroupMemberEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @interface IGroupMemberEntry - * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId - * @property {number|null} [power] GroupMemberEntry power - */ - - /** - * Constructs a new GroupMemberEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @classdesc Represents a GroupMemberEntry. - * @implements IGroupMemberEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set - */ - function GroupMemberEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupMemberEntry memberId. - * @member {Uint8Array} memberId - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @instance - */ - GroupMemberEntry.prototype.memberId = $util.newBuffer([]); - - /** - * GroupMemberEntry power. - * @member {number} power - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @instance - */ - GroupMemberEntry.prototype.power = 0; - - /** - * Creates a new GroupMemberEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry instance - */ - GroupMemberEntry.create = function create(properties) { - return new GroupMemberEntry(properties); - }; - - /** - * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMemberEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); - if (message.power != null && Object.hasOwnProperty.call(message, "power")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); - return writer; - }; - - /** - * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupMemberEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMemberEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.memberId = reader.bytes(); - break; - case 2: - message.power = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupMemberEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupMemberEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.memberId != null && message.hasOwnProperty("memberId")) - if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) - return "memberId: buffer expected"; - if (message.power != null && message.hasOwnProperty("power")) - if (!$util.isInteger(message.power)) - return "power: integer expected"; - return null; - }; - - /** - * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry - */ - GroupMemberEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); - if (object.memberId != null) - if (typeof object.memberId === "string") - $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); - else if (object.memberId.length >= 0) - message.memberId = object.memberId; - if (object.power != null) - message.power = object.power >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} message GroupMemberEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupMemberEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.memberId = ""; - else { - object.memberId = []; - if (options.bytes !== Array) - object.memberId = $util.newBuffer(object.memberId); - } - object.power = 0; - } - if (message.memberId != null && message.hasOwnProperty("memberId")) - object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; - if (message.power != null && message.hasOwnProperty("power")) - object.power = message.power; - return object; - }; - - /** - * Converts this GroupMemberEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry - * @instance - * @returns {Object.} JSON object - */ - GroupMemberEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupMemberEntry; - })(); - - GetGroupInfoResponseV0.GroupInfoEntry = (function() { - - /** - * Properties of a GroupInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @interface IGroupInfoEntry - * @property {Array.|null} [members] GroupInfoEntry members - * @property {number|null} [groupRequiredPower] GroupInfoEntry groupRequiredPower - */ - - /** - * Constructs a new GroupInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @classdesc Represents a GroupInfoEntry. - * @implements IGroupInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set - */ - function GroupInfoEntry(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupInfoEntry members. - * @member {Array.} members - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @instance - */ - GroupInfoEntry.prototype.members = $util.emptyArray; - - /** - * GroupInfoEntry groupRequiredPower. - * @member {number} groupRequiredPower - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @instance - */ - GroupInfoEntry.prototype.groupRequiredPower = 0; - - /** - * Creates a new GroupInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry instance - */ - GroupInfoEntry.create = function create(properties) { - return new GroupInfoEntry(properties); - }; - - /** - * Encodes the specified GroupInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupRequiredPower); - return writer; - }; - - /** - * Encodes the specified GroupInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); - break; - case 2: - message.groupRequiredPower = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify(message.members[i]); - if (error) - return "members." + error; - } - } - if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) - if (!$util.isInteger(message.groupRequiredPower)) - return "groupRequiredPower: integer expected"; - return null; - }; - - /** - * Creates a GroupInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry - */ - GroupInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) { - if (typeof object.members[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: object expected"); - message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.fromObject(object.members[i]); - } - } - if (object.groupRequiredPower != null) - message.groupRequiredPower = object.groupRequiredPower >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} message GroupInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) - object.groupRequiredPower = 0; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.toObject(message.members[j], options); - } - if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) - object.groupRequiredPower = message.groupRequiredPower; - return object; - }; - - /** - * Converts this GroupInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry - * @instance - * @returns {Object.} JSON object - */ - GroupInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupInfoEntry; - })(); - - GetGroupInfoResponseV0.GroupInfo = (function() { - - /** - * Properties of a GroupInfo. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @interface IGroupInfo - * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null} [groupInfo] GroupInfo groupInfo - */ - - /** - * Constructs a new GroupInfo. - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 - * @classdesc Represents a GroupInfo. - * @implements IGroupInfo - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set - */ - function GroupInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupInfo groupInfo. - * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null|undefined} groupInfo - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @instance - */ - GroupInfo.prototype.groupInfo = null; - - /** - * Creates a new GroupInfo instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo instance - */ - GroupInfo.create = function create(properties) { - return new GroupInfo(properties); - }; - - /** - * Encodes the specified GroupInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) - $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupInfo message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupInfo message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify(message.groupInfo); - if (error) - return "groupInfo." + error; - } - return null; - }; - - /** - * Creates a GroupInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo - */ - GroupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); - if (object.groupInfo != null) { - if (typeof object.groupInfo !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.groupInfo: object expected"); - message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.fromObject(object.groupInfo); - } - return message; - }; - - /** - * Creates a plain object from a GroupInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} message GroupInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.groupInfo = null; - if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) - object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.toObject(message.groupInfo, options); - return object; - }; - - /** - * Converts this GroupInfo to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo - * @instance - * @returns {Object.} JSON object - */ - GroupInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupInfo; - })(); - - return GetGroupInfoResponseV0; - })(); - - return GetGroupInfoResponse; - })(); - - v0.GetGroupInfosRequest = (function() { - - /** - * Properties of a GetGroupInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupInfosRequest - * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null} [v0] GetGroupInfosRequest v0 - */ - - /** - * Constructs a new GetGroupInfosRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupInfosRequest. - * @implements IGetGroupInfosRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set - */ - function GetGroupInfosRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfosRequest v0. - * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @instance - */ - GetGroupInfosRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfosRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @instance - */ - Object.defineProperty(GetGroupInfosRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfosRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest instance - */ - GetGroupInfosRequest.create = function create(properties) { - return new GetGroupInfosRequest(properties); - }; - - /** - * Encodes the specified GetGroupInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfosRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfosRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfosRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfosRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupInfosRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest - */ - GetGroupInfosRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfosRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest} message GetGroupInfosRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfosRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupInfosRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfosRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfosRequest.StartAtGroupContractPosition = (function() { - - /** - * Properties of a StartAtGroupContractPosition. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @interface IStartAtGroupContractPosition - * @property {number|null} [startGroupContractPosition] StartAtGroupContractPosition startGroupContractPosition - * @property {boolean|null} [startGroupContractPositionIncluded] StartAtGroupContractPosition startGroupContractPositionIncluded - */ - - /** - * Constructs a new StartAtGroupContractPosition. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @classdesc Represents a StartAtGroupContractPosition. - * @implements IStartAtGroupContractPosition - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set - */ - function StartAtGroupContractPosition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtGroupContractPosition startGroupContractPosition. - * @member {number} startGroupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @instance - */ - StartAtGroupContractPosition.prototype.startGroupContractPosition = 0; - - /** - * StartAtGroupContractPosition startGroupContractPositionIncluded. - * @member {boolean} startGroupContractPositionIncluded - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @instance - */ - StartAtGroupContractPosition.prototype.startGroupContractPositionIncluded = false; - - /** - * Creates a new StartAtGroupContractPosition instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition instance - */ - StartAtGroupContractPosition.create = function create(properties) { - return new StartAtGroupContractPosition(properties); - }; - - /** - * Encodes the specified StartAtGroupContractPosition message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtGroupContractPosition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startGroupContractPosition != null && Object.hasOwnProperty.call(message, "startGroupContractPosition")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.startGroupContractPosition); - if (message.startGroupContractPositionIncluded != null && Object.hasOwnProperty.call(message, "startGroupContractPositionIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startGroupContractPositionIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtGroupContractPosition message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtGroupContractPosition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtGroupContractPosition message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtGroupContractPosition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startGroupContractPosition = reader.uint32(); - break; - case 2: - message.startGroupContractPositionIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtGroupContractPosition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtGroupContractPosition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtGroupContractPosition message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtGroupContractPosition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) - if (!$util.isInteger(message.startGroupContractPosition)) - return "startGroupContractPosition: integer expected"; - if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) - if (typeof message.startGroupContractPositionIncluded !== "boolean") - return "startGroupContractPositionIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtGroupContractPosition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition - */ - StartAtGroupContractPosition.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); - if (object.startGroupContractPosition != null) - message.startGroupContractPosition = object.startGroupContractPosition >>> 0; - if (object.startGroupContractPositionIncluded != null) - message.startGroupContractPositionIncluded = Boolean(object.startGroupContractPositionIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtGroupContractPosition message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} message StartAtGroupContractPosition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtGroupContractPosition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startGroupContractPosition = 0; - object.startGroupContractPositionIncluded = false; - } - if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) - object.startGroupContractPosition = message.startGroupContractPosition; - if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) - object.startGroupContractPositionIncluded = message.startGroupContractPositionIncluded; - return object; - }; - - /** - * Converts this StartAtGroupContractPosition to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition - * @instance - * @returns {Object.} JSON object - */ - StartAtGroupContractPosition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtGroupContractPosition; - })(); - - GetGroupInfosRequest.GetGroupInfosRequestV0 = (function() { - - /** - * Properties of a GetGroupInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @interface IGetGroupInfosRequestV0 - * @property {Uint8Array|null} [contractId] GetGroupInfosRequestV0 contractId - * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null} [startAtGroupContractPosition] GetGroupInfosRequestV0 startAtGroupContractPosition - * @property {number|null} [count] GetGroupInfosRequestV0 count - * @property {boolean|null} [prove] GetGroupInfosRequestV0 prove - */ - - /** - * Constructs a new GetGroupInfosRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest - * @classdesc Represents a GetGroupInfosRequestV0. - * @implements IGetGroupInfosRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set - */ - function GetGroupInfosRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfosRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - */ - GetGroupInfosRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetGroupInfosRequestV0 startAtGroupContractPosition. - * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null|undefined} startAtGroupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - */ - GetGroupInfosRequestV0.prototype.startAtGroupContractPosition = null; - - /** - * GetGroupInfosRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - */ - GetGroupInfosRequestV0.prototype.count = 0; - - /** - * GetGroupInfosRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - */ - GetGroupInfosRequestV0.prototype.prove = false; - - /** - * Creates a new GetGroupInfosRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 instance - */ - GetGroupInfosRequestV0.create = function create(properties) { - return new GetGroupInfosRequestV0(properties); - }; - - /** - * Encodes the specified GetGroupInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.startAtGroupContractPosition != null && Object.hasOwnProperty.call(message, "startAtGroupContractPosition")) - $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.encode(message.startAtGroupContractPosition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.count); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetGroupInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.decode(reader, reader.uint32()); - break; - case 3: - message.count = reader.uint32(); - break; - case 4: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfosRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfosRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify(message.startAtGroupContractPosition); - if (error) - return "startAtGroupContractPosition." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetGroupInfosRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 - */ - GetGroupInfosRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.startAtGroupContractPosition != null) { - if (typeof object.startAtGroupContractPosition !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.startAtGroupContractPosition: object expected"); - message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.fromObject(object.startAtGroupContractPosition); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetGroupInfosRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} message GetGroupInfosRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfosRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.startAtGroupContractPosition = null; - object.count = 0; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) - object.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.toObject(message.startAtGroupContractPosition, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetGroupInfosRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfosRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetGroupInfosRequestV0; - })(); - - return GetGroupInfosRequest; - })(); - - v0.GetGroupInfosResponse = (function() { - - /** - * Properties of a GetGroupInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupInfosResponse - * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null} [v0] GetGroupInfosResponse v0 - */ - - /** - * Constructs a new GetGroupInfosResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupInfosResponse. - * @implements IGetGroupInfosResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set - */ - function GetGroupInfosResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfosResponse v0. - * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @instance - */ - GetGroupInfosResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfosResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @instance - */ - Object.defineProperty(GetGroupInfosResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfosResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse instance - */ - GetGroupInfosResponse.create = function create(properties) { - return new GetGroupInfosResponse(properties); - }; - - /** - * Encodes the specified GetGroupInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfosResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfosResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfosResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfosResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupInfosResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse - */ - GetGroupInfosResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfosResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} message GetGroupInfosResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfosResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupInfosResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfosResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfosResponse.GetGroupInfosResponseV0 = (function() { - - /** - * Properties of a GetGroupInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @interface IGetGroupInfosResponseV0 - * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null} [groupInfos] GetGroupInfosResponseV0 groupInfos - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfosResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfosResponseV0 metadata - */ - - /** - * Constructs a new GetGroupInfosResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse - * @classdesc Represents a GetGroupInfosResponseV0. - * @implements IGetGroupInfosResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set - */ - function GetGroupInfosResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupInfosResponseV0 groupInfos. - * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null|undefined} groupInfos - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - */ - GetGroupInfosResponseV0.prototype.groupInfos = null; - - /** - * GetGroupInfosResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - */ - GetGroupInfosResponseV0.prototype.proof = null; - - /** - * GetGroupInfosResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - */ - GetGroupInfosResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupInfosResponseV0 result. - * @member {"groupInfos"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - */ - Object.defineProperty(GetGroupInfosResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["groupInfos", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupInfosResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 instance - */ - GetGroupInfosResponseV0.create = function create(properties) { - return new GetGroupInfosResponseV0(properties); - }; - - /** - * Encodes the specified GetGroupInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupInfos != null && Object.hasOwnProperty.call(message, "groupInfos")) - $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.encode(message.groupInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 4: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupInfosResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupInfosResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify(message.groupInfos); - if (error) - return "groupInfos." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetGroupInfosResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 - */ - GetGroupInfosResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); - if (object.groupInfos != null) { - if (typeof object.groupInfos !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.groupInfos: object expected"); - message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.fromObject(object.groupInfos); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupInfosResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} message GetGroupInfosResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupInfosResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { - object.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.toObject(message.groupInfos, options); - if (options.oneofs) - object.result = "groupInfos"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetGroupInfosResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupInfosResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupInfosResponseV0.GroupMemberEntry = (function() { - - /** - * Properties of a GroupMemberEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @interface IGroupMemberEntry - * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId - * @property {number|null} [power] GroupMemberEntry power - */ - - /** - * Constructs a new GroupMemberEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @classdesc Represents a GroupMemberEntry. - * @implements IGroupMemberEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set - */ - function GroupMemberEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupMemberEntry memberId. - * @member {Uint8Array} memberId - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @instance - */ - GroupMemberEntry.prototype.memberId = $util.newBuffer([]); - - /** - * GroupMemberEntry power. - * @member {number} power - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @instance - */ - GroupMemberEntry.prototype.power = 0; - - /** - * Creates a new GroupMemberEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry instance - */ - GroupMemberEntry.create = function create(properties) { - return new GroupMemberEntry(properties); - }; - - /** - * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMemberEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); - if (message.power != null && Object.hasOwnProperty.call(message, "power")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); - return writer; - }; - - /** - * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupMemberEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMemberEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.memberId = reader.bytes(); - break; - case 2: - message.power = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupMemberEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupMemberEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.memberId != null && message.hasOwnProperty("memberId")) - if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) - return "memberId: buffer expected"; - if (message.power != null && message.hasOwnProperty("power")) - if (!$util.isInteger(message.power)) - return "power: integer expected"; - return null; - }; - - /** - * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry - */ - GroupMemberEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); - if (object.memberId != null) - if (typeof object.memberId === "string") - $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); - else if (object.memberId.length >= 0) - message.memberId = object.memberId; - if (object.power != null) - message.power = object.power >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} message GroupMemberEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupMemberEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.memberId = ""; - else { - object.memberId = []; - if (options.bytes !== Array) - object.memberId = $util.newBuffer(object.memberId); - } - object.power = 0; - } - if (message.memberId != null && message.hasOwnProperty("memberId")) - object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; - if (message.power != null && message.hasOwnProperty("power")) - object.power = message.power; - return object; - }; - - /** - * Converts this GroupMemberEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry - * @instance - * @returns {Object.} JSON object - */ - GroupMemberEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupMemberEntry; - })(); - - GetGroupInfosResponseV0.GroupPositionInfoEntry = (function() { - - /** - * Properties of a GroupPositionInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @interface IGroupPositionInfoEntry - * @property {number|null} [groupContractPosition] GroupPositionInfoEntry groupContractPosition - * @property {Array.|null} [members] GroupPositionInfoEntry members - * @property {number|null} [groupRequiredPower] GroupPositionInfoEntry groupRequiredPower - */ - - /** - * Constructs a new GroupPositionInfoEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @classdesc Represents a GroupPositionInfoEntry. - * @implements IGroupPositionInfoEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set - */ - function GroupPositionInfoEntry(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupPositionInfoEntry groupContractPosition. - * @member {number} groupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @instance - */ - GroupPositionInfoEntry.prototype.groupContractPosition = 0; - - /** - * GroupPositionInfoEntry members. - * @member {Array.} members - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @instance - */ - GroupPositionInfoEntry.prototype.members = $util.emptyArray; - - /** - * GroupPositionInfoEntry groupRequiredPower. - * @member {number} groupRequiredPower - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @instance - */ - GroupPositionInfoEntry.prototype.groupRequiredPower = 0; - - /** - * Creates a new GroupPositionInfoEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry instance - */ - GroupPositionInfoEntry.create = function create(properties) { - return new GroupPositionInfoEntry(properties); - }; - - /** - * Encodes the specified GroupPositionInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupPositionInfoEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.groupContractPosition); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.groupRequiredPower); - return writer; - }; - - /** - * Encodes the specified GroupPositionInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupPositionInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupPositionInfoEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupPositionInfoEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupContractPosition = reader.uint32(); - break; - case 2: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); - break; - case 3: - message.groupRequiredPower = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupPositionInfoEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupPositionInfoEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupPositionInfoEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupPositionInfoEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - if (!$util.isInteger(message.groupContractPosition)) - return "groupContractPosition: integer expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify(message.members[i]); - if (error) - return "members." + error; - } - } - if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) - if (!$util.isInteger(message.groupRequiredPower)) - return "groupRequiredPower: integer expected"; - return null; - }; - - /** - * Creates a GroupPositionInfoEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry - */ - GroupPositionInfoEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); - if (object.groupContractPosition != null) - message.groupContractPosition = object.groupContractPosition >>> 0; - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) { - if (typeof object.members[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: object expected"); - message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.fromObject(object.members[i]); - } - } - if (object.groupRequiredPower != null) - message.groupRequiredPower = object.groupRequiredPower >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupPositionInfoEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} message GroupPositionInfoEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupPositionInfoEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.groupContractPosition = 0; - object.groupRequiredPower = 0; - } - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - object.groupContractPosition = message.groupContractPosition; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.toObject(message.members[j], options); - } - if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) - object.groupRequiredPower = message.groupRequiredPower; - return object; - }; - - /** - * Converts this GroupPositionInfoEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry - * @instance - * @returns {Object.} JSON object - */ - GroupPositionInfoEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupPositionInfoEntry; - })(); - - GetGroupInfosResponseV0.GroupInfos = (function() { - - /** - * Properties of a GroupInfos. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @interface IGroupInfos - * @property {Array.|null} [groupInfos] GroupInfos groupInfos - */ - - /** - * Constructs a new GroupInfos. - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 - * @classdesc Represents a GroupInfos. - * @implements IGroupInfos - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set - */ - function GroupInfos(properties) { - this.groupInfos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupInfos groupInfos. - * @member {Array.} groupInfos - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @instance - */ - GroupInfos.prototype.groupInfos = $util.emptyArray; - - /** - * Creates a new GroupInfos instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos instance - */ - GroupInfos.create = function create(properties) { - return new GroupInfos(properties); - }; - - /** - * Encodes the specified GroupInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfos.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupInfos != null && message.groupInfos.length) - for (var i = 0; i < message.groupInfos.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.encode(message.groupInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInfos.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupInfos message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfos.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.groupInfos && message.groupInfos.length)) - message.groupInfos = []; - message.groupInfos.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupInfos message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupInfos.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupInfos message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupInfos.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { - if (!Array.isArray(message.groupInfos)) - return "groupInfos: array expected"; - for (var i = 0; i < message.groupInfos.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify(message.groupInfos[i]); - if (error) - return "groupInfos." + error; - } - } - return null; - }; - - /** - * Creates a GroupInfos message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos - */ - GroupInfos.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); - if (object.groupInfos) { - if (!Array.isArray(object.groupInfos)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: array expected"); - message.groupInfos = []; - for (var i = 0; i < object.groupInfos.length; ++i) { - if (typeof object.groupInfos[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: object expected"); - message.groupInfos[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.fromObject(object.groupInfos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GroupInfos message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @static - * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} message GroupInfos - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupInfos.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupInfos = []; - if (message.groupInfos && message.groupInfos.length) { - object.groupInfos = []; - for (var j = 0; j < message.groupInfos.length; ++j) - object.groupInfos[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.toObject(message.groupInfos[j], options); - } - return object; - }; - - /** - * Converts this GroupInfos to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos - * @instance - * @returns {Object.} JSON object - */ - GroupInfos.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupInfos; - })(); - - return GetGroupInfosResponseV0; - })(); - - return GetGroupInfosResponse; - })(); - - v0.GetGroupActionsRequest = (function() { - - /** - * Properties of a GetGroupActionsRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupActionsRequest - * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null} [v0] GetGroupActionsRequest v0 - */ - - /** - * Constructs a new GetGroupActionsRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupActionsRequest. - * @implements IGetGroupActionsRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set - */ - function GetGroupActionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionsRequest v0. - * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @instance - */ - GetGroupActionsRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionsRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @instance - */ - Object.defineProperty(GetGroupActionsRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionsRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest instance - */ - GetGroupActionsRequest.create = function create(properties) { - return new GetGroupActionsRequest(properties); - }; - - /** - * Encodes the specified GetGroupActionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionsRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionsRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupActionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest - */ - GetGroupActionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest} message GetGroupActionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupActionsRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * ActionStatus enum. - * @name org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus - * @enum {number} - * @property {number} ACTIVE=0 ACTIVE value - * @property {number} CLOSED=1 CLOSED value - */ - GetGroupActionsRequest.ActionStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTIVE"] = 0; - values[valuesById[1] = "CLOSED"] = 1; - return values; - })(); - - GetGroupActionsRequest.StartAtActionId = (function() { - - /** - * Properties of a StartAtActionId. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @interface IStartAtActionId - * @property {Uint8Array|null} [startActionId] StartAtActionId startActionId - * @property {boolean|null} [startActionIdIncluded] StartAtActionId startActionIdIncluded - */ - - /** - * Constructs a new StartAtActionId. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @classdesc Represents a StartAtActionId. - * @implements IStartAtActionId - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set - */ - function StartAtActionId(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartAtActionId startActionId. - * @member {Uint8Array} startActionId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @instance - */ - StartAtActionId.prototype.startActionId = $util.newBuffer([]); - - /** - * StartAtActionId startActionIdIncluded. - * @member {boolean} startActionIdIncluded - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @instance - */ - StartAtActionId.prototype.startActionIdIncluded = false; - - /** - * Creates a new StartAtActionId instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId instance - */ - StartAtActionId.create = function create(properties) { - return new StartAtActionId(properties); - }; - - /** - * Encodes the specified StartAtActionId message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtActionId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startActionId != null && Object.hasOwnProperty.call(message, "startActionId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startActionId); - if (message.startActionIdIncluded != null && Object.hasOwnProperty.call(message, "startActionIdIncluded")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startActionIdIncluded); - return writer; - }; - - /** - * Encodes the specified StartAtActionId message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartAtActionId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartAtActionId message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtActionId.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startActionId = reader.bytes(); - break; - case 2: - message.startActionIdIncluded = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartAtActionId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartAtActionId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartAtActionId message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartAtActionId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startActionId != null && message.hasOwnProperty("startActionId")) - if (!(message.startActionId && typeof message.startActionId.length === "number" || $util.isString(message.startActionId))) - return "startActionId: buffer expected"; - if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) - if (typeof message.startActionIdIncluded !== "boolean") - return "startActionIdIncluded: boolean expected"; - return null; - }; - - /** - * Creates a StartAtActionId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId - */ - StartAtActionId.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); - if (object.startActionId != null) - if (typeof object.startActionId === "string") - $util.base64.decode(object.startActionId, message.startActionId = $util.newBuffer($util.base64.length(object.startActionId)), 0); - else if (object.startActionId.length >= 0) - message.startActionId = object.startActionId; - if (object.startActionIdIncluded != null) - message.startActionIdIncluded = Boolean(object.startActionIdIncluded); - return message; - }; - - /** - * Creates a plain object from a StartAtActionId message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} message StartAtActionId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartAtActionId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.startActionId = ""; - else { - object.startActionId = []; - if (options.bytes !== Array) - object.startActionId = $util.newBuffer(object.startActionId); - } - object.startActionIdIncluded = false; - } - if (message.startActionId != null && message.hasOwnProperty("startActionId")) - object.startActionId = options.bytes === String ? $util.base64.encode(message.startActionId, 0, message.startActionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.startActionId) : message.startActionId; - if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) - object.startActionIdIncluded = message.startActionIdIncluded; - return object; - }; - - /** - * Converts this StartAtActionId to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId - * @instance - * @returns {Object.} JSON object - */ - StartAtActionId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StartAtActionId; - })(); - - GetGroupActionsRequest.GetGroupActionsRequestV0 = (function() { - - /** - * Properties of a GetGroupActionsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @interface IGetGroupActionsRequestV0 - * @property {Uint8Array|null} [contractId] GetGroupActionsRequestV0 contractId - * @property {number|null} [groupContractPosition] GetGroupActionsRequestV0 groupContractPosition - * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus|null} [status] GetGroupActionsRequestV0 status - * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null} [startAtActionId] GetGroupActionsRequestV0 startAtActionId - * @property {number|null} [count] GetGroupActionsRequestV0 count - * @property {boolean|null} [prove] GetGroupActionsRequestV0 prove - */ - - /** - * Constructs a new GetGroupActionsRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest - * @classdesc Represents a GetGroupActionsRequestV0. - * @implements IGetGroupActionsRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set - */ - function GetGroupActionsRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionsRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetGroupActionsRequestV0 groupContractPosition. - * @member {number} groupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.groupContractPosition = 0; - - /** - * GetGroupActionsRequestV0 status. - * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus} status - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.status = 0; - - /** - * GetGroupActionsRequestV0 startAtActionId. - * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null|undefined} startAtActionId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.startAtActionId = null; - - /** - * GetGroupActionsRequestV0 count. - * @member {number} count - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.count = 0; - - /** - * GetGroupActionsRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - */ - GetGroupActionsRequestV0.prototype.prove = false; - - /** - * Creates a new GetGroupActionsRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 instance - */ - GetGroupActionsRequestV0.create = function create(properties) { - return new GetGroupActionsRequestV0(properties); - }; - - /** - * Encodes the specified GetGroupActionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.startAtActionId != null && Object.hasOwnProperty.call(message, "startAtActionId")) - $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.encode(message.startAtActionId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.count); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetGroupActionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.groupContractPosition = reader.uint32(); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.decode(reader, reader.uint32()); - break; - case 5: - message.count = reader.uint32(); - break; - case 6: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionsRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionsRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - if (!$util.isInteger(message.groupContractPosition)) - return "groupContractPosition: integer expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - break; - } - if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify(message.startAtActionId); - if (error) - return "startAtActionId." + error; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetGroupActionsRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 - */ - GetGroupActionsRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.groupContractPosition != null) - message.groupContractPosition = object.groupContractPosition >>> 0; - switch (object.status) { - case "ACTIVE": - case 0: - message.status = 0; - break; - case "CLOSED": - case 1: - message.status = 1; - break; - } - if (object.startAtActionId != null) { - if (typeof object.startAtActionId !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.startAtActionId: object expected"); - message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.fromObject(object.startAtActionId); - } - if (object.count != null) - message.count = object.count >>> 0; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetGroupActionsRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} message GetGroupActionsRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionsRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.groupContractPosition = 0; - object.status = options.enums === String ? "ACTIVE" : 0; - object.startAtActionId = null; - object.count = 0; - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - object.groupContractPosition = message.groupContractPosition; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus[message.status] : message.status; - if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) - object.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.toObject(message.startAtActionId, options); - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetGroupActionsRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionsRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetGroupActionsRequestV0; - })(); - - return GetGroupActionsRequest; - })(); - - v0.GetGroupActionsResponse = (function() { - - /** - * Properties of a GetGroupActionsResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupActionsResponse - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null} [v0] GetGroupActionsResponse v0 - */ - - /** - * Constructs a new GetGroupActionsResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupActionsResponse. - * @implements IGetGroupActionsResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set - */ - function GetGroupActionsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionsResponse v0. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @instance - */ - GetGroupActionsResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionsResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @instance - */ - Object.defineProperty(GetGroupActionsResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionsResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse instance - */ - GetGroupActionsResponse.create = function create(properties) { - return new GetGroupActionsResponse(properties); - }; - - /** - * Encodes the specified GetGroupActionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionsResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionsResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupActionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse - */ - GetGroupActionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} message GetGroupActionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupActionsResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupActionsResponse.GetGroupActionsResponseV0 = (function() { - - /** - * Properties of a GetGroupActionsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @interface IGetGroupActionsResponseV0 - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null} [groupActions] GetGroupActionsResponseV0 groupActions - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionsResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionsResponseV0 metadata - */ - - /** - * Constructs a new GetGroupActionsResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse - * @classdesc Represents a GetGroupActionsResponseV0. - * @implements IGetGroupActionsResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set - */ - function GetGroupActionsResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionsResponseV0 groupActions. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null|undefined} groupActions - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - */ - GetGroupActionsResponseV0.prototype.groupActions = null; - - /** - * GetGroupActionsResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - */ - GetGroupActionsResponseV0.prototype.proof = null; - - /** - * GetGroupActionsResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - */ - GetGroupActionsResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionsResponseV0 result. - * @member {"groupActions"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - */ - Object.defineProperty(GetGroupActionsResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["groupActions", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionsResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 instance - */ - GetGroupActionsResponseV0.create = function create(properties) { - return new GetGroupActionsResponseV0(properties); - }; - - /** - * Encodes the specified GetGroupActionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupActions != null && Object.hasOwnProperty.call(message, "groupActions")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.encode(message.groupActions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionsResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionsResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionsResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.groupActions != null && message.hasOwnProperty("groupActions")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify(message.groupActions); - if (error) - return "groupActions." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetGroupActionsResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 - */ - GetGroupActionsResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); - if (object.groupActions != null) { - if (typeof object.groupActions !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.groupActions: object expected"); - message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.fromObject(object.groupActions); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionsResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} message GetGroupActionsResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionsResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.groupActions != null && message.hasOwnProperty("groupActions")) { - object.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.toObject(message.groupActions, options); - if (options.oneofs) - object.result = "groupActions"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetGroupActionsResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionsResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupActionsResponseV0.MintEvent = (function() { - - /** - * Properties of a MintEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IMintEvent - * @property {number|Long|null} [amount] MintEvent amount - * @property {Uint8Array|null} [recipientId] MintEvent recipientId - * @property {string|null} [publicNote] MintEvent publicNote - */ - - /** - * Constructs a new MintEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a MintEvent. - * @implements IMintEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set - */ - function MintEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MintEvent amount. - * @member {number|Long} amount - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @instance - */ - MintEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MintEvent recipientId. - * @member {Uint8Array} recipientId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @instance - */ - MintEvent.prototype.recipientId = $util.newBuffer([]); - - /** - * MintEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @instance - */ - MintEvent.prototype.publicNote = ""; - - /** - * Creates a new MintEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent instance - */ - MintEvent.create = function create(properties) { - return new MintEvent(properties); - }; - - /** - * Encodes the specified MintEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MintEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); - if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.recipientId); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified MintEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MintEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MintEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MintEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount = reader.uint64(); - break; - case 2: - message.recipientId = reader.bytes(); - break; - case 3: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MintEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MintEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MintEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MintEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - if (message.recipientId != null && message.hasOwnProperty("recipientId")) - if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) - return "recipientId: buffer expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a MintEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent - */ - MintEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - if (object.recipientId != null) - if (typeof object.recipientId === "string") - $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); - else if (object.recipientId.length >= 0) - message.recipientId = object.recipientId; - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a MintEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} message MintEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MintEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.recipientId = ""; - else { - object.recipientId = []; - if (options.bytes !== Array) - object.recipientId = $util.newBuffer(object.recipientId); - } - object.publicNote = ""; - } - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - if (message.recipientId != null && message.hasOwnProperty("recipientId")) - object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this MintEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent - * @instance - * @returns {Object.} JSON object - */ - MintEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MintEvent; - })(); - - GetGroupActionsResponseV0.BurnEvent = (function() { - - /** - * Properties of a BurnEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IBurnEvent - * @property {number|Long|null} [amount] BurnEvent amount - * @property {string|null} [publicNote] BurnEvent publicNote - */ - - /** - * Constructs a new BurnEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a BurnEvent. - * @implements IBurnEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set - */ - function BurnEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BurnEvent amount. - * @member {number|Long} amount - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @instance - */ - BurnEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BurnEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @instance - */ - BurnEvent.prototype.publicNote = ""; - - /** - * Creates a new BurnEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent instance - */ - BurnEvent.create = function create(properties) { - return new BurnEvent(properties); - }; - - /** - * Encodes the specified BurnEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BurnEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified BurnEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BurnEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BurnEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BurnEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount = reader.uint64(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BurnEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BurnEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BurnEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BurnEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a BurnEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent - */ - BurnEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a BurnEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} message BurnEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BurnEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - object.publicNote = ""; - } - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this BurnEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent - * @instance - * @returns {Object.} JSON object - */ - BurnEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BurnEvent; - })(); - - GetGroupActionsResponseV0.FreezeEvent = (function() { - - /** - * Properties of a FreezeEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IFreezeEvent - * @property {Uint8Array|null} [frozenId] FreezeEvent frozenId - * @property {string|null} [publicNote] FreezeEvent publicNote - */ - - /** - * Constructs a new FreezeEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a FreezeEvent. - * @implements IFreezeEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set - */ - function FreezeEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FreezeEvent frozenId. - * @member {Uint8Array} frozenId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @instance - */ - FreezeEvent.prototype.frozenId = $util.newBuffer([]); - - /** - * FreezeEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @instance - */ - FreezeEvent.prototype.publicNote = ""; - - /** - * Creates a new FreezeEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent instance - */ - FreezeEvent.create = function create(properties) { - return new FreezeEvent(properties); - }; - - /** - * Encodes the specified FreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FreezeEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified FreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FreezeEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FreezeEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozenId = reader.bytes(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FreezeEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FreezeEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FreezeEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FreezeEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) - return "frozenId: buffer expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a FreezeEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent - */ - FreezeEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); - if (object.frozenId != null) - if (typeof object.frozenId === "string") - $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); - else if (object.frozenId.length >= 0) - message.frozenId = object.frozenId; - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a FreezeEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} message FreezeEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FreezeEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.frozenId = ""; - else { - object.frozenId = []; - if (options.bytes !== Array) - object.frozenId = $util.newBuffer(object.frozenId); - } - object.publicNote = ""; - } - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this FreezeEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent - * @instance - * @returns {Object.} JSON object - */ - FreezeEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FreezeEvent; - })(); - - GetGroupActionsResponseV0.UnfreezeEvent = (function() { - - /** - * Properties of an UnfreezeEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IUnfreezeEvent - * @property {Uint8Array|null} [frozenId] UnfreezeEvent frozenId - * @property {string|null} [publicNote] UnfreezeEvent publicNote - */ - - /** - * Constructs a new UnfreezeEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents an UnfreezeEvent. - * @implements IUnfreezeEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set - */ - function UnfreezeEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UnfreezeEvent frozenId. - * @member {Uint8Array} frozenId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @instance - */ - UnfreezeEvent.prototype.frozenId = $util.newBuffer([]); - - /** - * UnfreezeEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @instance - */ - UnfreezeEvent.prototype.publicNote = ""; - - /** - * Creates a new UnfreezeEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent instance - */ - UnfreezeEvent.create = function create(properties) { - return new UnfreezeEvent(properties); - }; - - /** - * Encodes the specified UnfreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnfreezeEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified UnfreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnfreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UnfreezeEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnfreezeEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozenId = reader.bytes(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UnfreezeEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnfreezeEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UnfreezeEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UnfreezeEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) - return "frozenId: buffer expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates an UnfreezeEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent - */ - UnfreezeEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); - if (object.frozenId != null) - if (typeof object.frozenId === "string") - $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); - else if (object.frozenId.length >= 0) - message.frozenId = object.frozenId; - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from an UnfreezeEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} message UnfreezeEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UnfreezeEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.frozenId = ""; - else { - object.frozenId = []; - if (options.bytes !== Array) - object.frozenId = $util.newBuffer(object.frozenId); - } - object.publicNote = ""; - } - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this UnfreezeEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent - * @instance - * @returns {Object.} JSON object - */ - UnfreezeEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UnfreezeEvent; - })(); - - GetGroupActionsResponseV0.DestroyFrozenFundsEvent = (function() { - - /** - * Properties of a DestroyFrozenFundsEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IDestroyFrozenFundsEvent - * @property {Uint8Array|null} [frozenId] DestroyFrozenFundsEvent frozenId - * @property {number|Long|null} [amount] DestroyFrozenFundsEvent amount - * @property {string|null} [publicNote] DestroyFrozenFundsEvent publicNote - */ - - /** - * Constructs a new DestroyFrozenFundsEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a DestroyFrozenFundsEvent. - * @implements IDestroyFrozenFundsEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set - */ - function DestroyFrozenFundsEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DestroyFrozenFundsEvent frozenId. - * @member {Uint8Array} frozenId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @instance - */ - DestroyFrozenFundsEvent.prototype.frozenId = $util.newBuffer([]); - - /** - * DestroyFrozenFundsEvent amount. - * @member {number|Long} amount - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @instance - */ - DestroyFrozenFundsEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DestroyFrozenFundsEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @instance - */ - DestroyFrozenFundsEvent.prototype.publicNote = ""; - - /** - * Creates a new DestroyFrozenFundsEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent instance - */ - DestroyFrozenFundsEvent.create = function create(properties) { - return new DestroyFrozenFundsEvent(properties); - }; - - /** - * Encodes the specified DestroyFrozenFundsEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DestroyFrozenFundsEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified DestroyFrozenFundsEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DestroyFrozenFundsEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DestroyFrozenFundsEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.frozenId = reader.bytes(); - break; - case 2: - message.amount = reader.uint64(); - break; - case 3: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DestroyFrozenFundsEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DestroyFrozenFundsEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DestroyFrozenFundsEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) - return "frozenId: buffer expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a DestroyFrozenFundsEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent - */ - DestroyFrozenFundsEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); - if (object.frozenId != null) - if (typeof object.frozenId === "string") - $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); - else if (object.frozenId.length >= 0) - message.frozenId = object.frozenId; - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a DestroyFrozenFundsEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} message DestroyFrozenFundsEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DestroyFrozenFundsEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.frozenId = ""; - else { - object.frozenId = []; - if (options.bytes !== Array) - object.frozenId = $util.newBuffer(object.frozenId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - object.publicNote = ""; - } - if (message.frozenId != null && message.hasOwnProperty("frozenId")) - object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this DestroyFrozenFundsEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent - * @instance - * @returns {Object.} JSON object - */ - DestroyFrozenFundsEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DestroyFrozenFundsEvent; - })(); - - GetGroupActionsResponseV0.SharedEncryptedNote = (function() { - - /** - * Properties of a SharedEncryptedNote. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface ISharedEncryptedNote - * @property {number|null} [senderKeyIndex] SharedEncryptedNote senderKeyIndex - * @property {number|null} [recipientKeyIndex] SharedEncryptedNote recipientKeyIndex - * @property {Uint8Array|null} [encryptedData] SharedEncryptedNote encryptedData - */ - - /** - * Constructs a new SharedEncryptedNote. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a SharedEncryptedNote. - * @implements ISharedEncryptedNote - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set - */ - function SharedEncryptedNote(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SharedEncryptedNote senderKeyIndex. - * @member {number} senderKeyIndex - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @instance - */ - SharedEncryptedNote.prototype.senderKeyIndex = 0; - - /** - * SharedEncryptedNote recipientKeyIndex. - * @member {number} recipientKeyIndex - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @instance - */ - SharedEncryptedNote.prototype.recipientKeyIndex = 0; - - /** - * SharedEncryptedNote encryptedData. - * @member {Uint8Array} encryptedData - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @instance - */ - SharedEncryptedNote.prototype.encryptedData = $util.newBuffer([]); - - /** - * Creates a new SharedEncryptedNote instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote instance - */ - SharedEncryptedNote.create = function create(properties) { - return new SharedEncryptedNote(properties); - }; - - /** - * Encodes the specified SharedEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SharedEncryptedNote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.senderKeyIndex != null && Object.hasOwnProperty.call(message, "senderKeyIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.senderKeyIndex); - if (message.recipientKeyIndex != null && Object.hasOwnProperty.call(message, "recipientKeyIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.recipientKeyIndex); - if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); - return writer; - }; - - /** - * Encodes the specified SharedEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SharedEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SharedEncryptedNote message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SharedEncryptedNote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.senderKeyIndex = reader.uint32(); - break; - case 2: - message.recipientKeyIndex = reader.uint32(); - break; - case 3: - message.encryptedData = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SharedEncryptedNote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SharedEncryptedNote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SharedEncryptedNote message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SharedEncryptedNote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) - if (!$util.isInteger(message.senderKeyIndex)) - return "senderKeyIndex: integer expected"; - if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) - if (!$util.isInteger(message.recipientKeyIndex)) - return "recipientKeyIndex: integer expected"; - if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) - if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) - return "encryptedData: buffer expected"; - return null; - }; - - /** - * Creates a SharedEncryptedNote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote - */ - SharedEncryptedNote.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); - if (object.senderKeyIndex != null) - message.senderKeyIndex = object.senderKeyIndex >>> 0; - if (object.recipientKeyIndex != null) - message.recipientKeyIndex = object.recipientKeyIndex >>> 0; - if (object.encryptedData != null) - if (typeof object.encryptedData === "string") - $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); - else if (object.encryptedData.length >= 0) - message.encryptedData = object.encryptedData; - return message; - }; - - /** - * Creates a plain object from a SharedEncryptedNote message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} message SharedEncryptedNote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SharedEncryptedNote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.senderKeyIndex = 0; - object.recipientKeyIndex = 0; - if (options.bytes === String) - object.encryptedData = ""; - else { - object.encryptedData = []; - if (options.bytes !== Array) - object.encryptedData = $util.newBuffer(object.encryptedData); - } - } - if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) - object.senderKeyIndex = message.senderKeyIndex; - if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) - object.recipientKeyIndex = message.recipientKeyIndex; - if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) - object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; - return object; - }; - - /** - * Converts this SharedEncryptedNote to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote - * @instance - * @returns {Object.} JSON object - */ - SharedEncryptedNote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SharedEncryptedNote; - })(); - - GetGroupActionsResponseV0.PersonalEncryptedNote = (function() { - - /** - * Properties of a PersonalEncryptedNote. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IPersonalEncryptedNote - * @property {number|null} [rootEncryptionKeyIndex] PersonalEncryptedNote rootEncryptionKeyIndex - * @property {number|null} [derivationEncryptionKeyIndex] PersonalEncryptedNote derivationEncryptionKeyIndex - * @property {Uint8Array|null} [encryptedData] PersonalEncryptedNote encryptedData - */ - - /** - * Constructs a new PersonalEncryptedNote. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a PersonalEncryptedNote. - * @implements IPersonalEncryptedNote - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set - */ - function PersonalEncryptedNote(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PersonalEncryptedNote rootEncryptionKeyIndex. - * @member {number} rootEncryptionKeyIndex - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @instance - */ - PersonalEncryptedNote.prototype.rootEncryptionKeyIndex = 0; - - /** - * PersonalEncryptedNote derivationEncryptionKeyIndex. - * @member {number} derivationEncryptionKeyIndex - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @instance - */ - PersonalEncryptedNote.prototype.derivationEncryptionKeyIndex = 0; - - /** - * PersonalEncryptedNote encryptedData. - * @member {Uint8Array} encryptedData - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @instance - */ - PersonalEncryptedNote.prototype.encryptedData = $util.newBuffer([]); - - /** - * Creates a new PersonalEncryptedNote instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote instance - */ - PersonalEncryptedNote.create = function create(properties) { - return new PersonalEncryptedNote(properties); - }; - - /** - * Encodes the specified PersonalEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonalEncryptedNote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rootEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "rootEncryptionKeyIndex")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rootEncryptionKeyIndex); - if (message.derivationEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "derivationEncryptionKeyIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.derivationEncryptionKeyIndex); - if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); - return writer; - }; - - /** - * Encodes the specified PersonalEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PersonalEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PersonalEncryptedNote message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonalEncryptedNote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.rootEncryptionKeyIndex = reader.uint32(); - break; - case 2: - message.derivationEncryptionKeyIndex = reader.uint32(); - break; - case 3: - message.encryptedData = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PersonalEncryptedNote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PersonalEncryptedNote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PersonalEncryptedNote message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PersonalEncryptedNote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) - if (!$util.isInteger(message.rootEncryptionKeyIndex)) - return "rootEncryptionKeyIndex: integer expected"; - if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) - if (!$util.isInteger(message.derivationEncryptionKeyIndex)) - return "derivationEncryptionKeyIndex: integer expected"; - if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) - if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) - return "encryptedData: buffer expected"; - return null; - }; - - /** - * Creates a PersonalEncryptedNote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote - */ - PersonalEncryptedNote.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); - if (object.rootEncryptionKeyIndex != null) - message.rootEncryptionKeyIndex = object.rootEncryptionKeyIndex >>> 0; - if (object.derivationEncryptionKeyIndex != null) - message.derivationEncryptionKeyIndex = object.derivationEncryptionKeyIndex >>> 0; - if (object.encryptedData != null) - if (typeof object.encryptedData === "string") - $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); - else if (object.encryptedData.length >= 0) - message.encryptedData = object.encryptedData; - return message; - }; - - /** - * Creates a plain object from a PersonalEncryptedNote message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} message PersonalEncryptedNote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PersonalEncryptedNote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.rootEncryptionKeyIndex = 0; - object.derivationEncryptionKeyIndex = 0; - if (options.bytes === String) - object.encryptedData = ""; - else { - object.encryptedData = []; - if (options.bytes !== Array) - object.encryptedData = $util.newBuffer(object.encryptedData); - } - } - if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) - object.rootEncryptionKeyIndex = message.rootEncryptionKeyIndex; - if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) - object.derivationEncryptionKeyIndex = message.derivationEncryptionKeyIndex; - if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) - object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; - return object; - }; - - /** - * Converts this PersonalEncryptedNote to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote - * @instance - * @returns {Object.} JSON object - */ - PersonalEncryptedNote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PersonalEncryptedNote; - })(); - - GetGroupActionsResponseV0.EmergencyActionEvent = (function() { - - /** - * Properties of an EmergencyActionEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IEmergencyActionEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType|null} [actionType] EmergencyActionEvent actionType - * @property {string|null} [publicNote] EmergencyActionEvent publicNote - */ - - /** - * Constructs a new EmergencyActionEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents an EmergencyActionEvent. - * @implements IEmergencyActionEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set - */ - function EmergencyActionEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EmergencyActionEvent actionType. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType} actionType - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @instance - */ - EmergencyActionEvent.prototype.actionType = 0; - - /** - * EmergencyActionEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @instance - */ - EmergencyActionEvent.prototype.publicNote = ""; - - /** - * Creates a new EmergencyActionEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent instance - */ - EmergencyActionEvent.create = function create(properties) { - return new EmergencyActionEvent(properties); - }; - - /** - * Encodes the specified EmergencyActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmergencyActionEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.actionType != null && Object.hasOwnProperty.call(message, "actionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionType); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified EmergencyActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmergencyActionEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EmergencyActionEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmergencyActionEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.actionType = reader.int32(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EmergencyActionEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmergencyActionEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EmergencyActionEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EmergencyActionEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionType != null && message.hasOwnProperty("actionType")) - switch (message.actionType) { - default: - return "actionType: enum value expected"; - case 0: - case 1: - break; - } - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates an EmergencyActionEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent - */ - EmergencyActionEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); - switch (object.actionType) { - case "PAUSE": - case 0: - message.actionType = 0; - break; - case "RESUME": - case 1: - message.actionType = 1; - break; - } - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from an EmergencyActionEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} message EmergencyActionEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EmergencyActionEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.actionType = options.enums === String ? "PAUSE" : 0; - object.publicNote = ""; - } - if (message.actionType != null && message.hasOwnProperty("actionType")) - object.actionType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType[message.actionType] : message.actionType; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this EmergencyActionEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent - * @instance - * @returns {Object.} JSON object - */ - EmergencyActionEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * ActionType enum. - * @name org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType - * @enum {number} - * @property {number} PAUSE=0 PAUSE value - * @property {number} RESUME=1 RESUME value - */ - EmergencyActionEvent.ActionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PAUSE"] = 0; - values[valuesById[1] = "RESUME"] = 1; - return values; - })(); - - return EmergencyActionEvent; - })(); - - GetGroupActionsResponseV0.TokenConfigUpdateEvent = (function() { - - /** - * Properties of a TokenConfigUpdateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface ITokenConfigUpdateEvent - * @property {Uint8Array|null} [tokenConfigUpdateItem] TokenConfigUpdateEvent tokenConfigUpdateItem - * @property {string|null} [publicNote] TokenConfigUpdateEvent publicNote - */ - - /** - * Constructs a new TokenConfigUpdateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a TokenConfigUpdateEvent. - * @implements ITokenConfigUpdateEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set - */ - function TokenConfigUpdateEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenConfigUpdateEvent tokenConfigUpdateItem. - * @member {Uint8Array} tokenConfigUpdateItem - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @instance - */ - TokenConfigUpdateEvent.prototype.tokenConfigUpdateItem = $util.newBuffer([]); - - /** - * TokenConfigUpdateEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @instance - */ - TokenConfigUpdateEvent.prototype.publicNote = ""; - - /** - * Creates a new TokenConfigUpdateEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent instance - */ - TokenConfigUpdateEvent.create = function create(properties) { - return new TokenConfigUpdateEvent(properties); - }; - - /** - * Encodes the specified TokenConfigUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenConfigUpdateEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenConfigUpdateItem != null && Object.hasOwnProperty.call(message, "tokenConfigUpdateItem")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenConfigUpdateItem); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified TokenConfigUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenConfigUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenConfigUpdateEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenConfigUpdateItem = reader.bytes(); - break; - case 2: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenConfigUpdateEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenConfigUpdateEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenConfigUpdateEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) - if (!(message.tokenConfigUpdateItem && typeof message.tokenConfigUpdateItem.length === "number" || $util.isString(message.tokenConfigUpdateItem))) - return "tokenConfigUpdateItem: buffer expected"; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates a TokenConfigUpdateEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent - */ - TokenConfigUpdateEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); - if (object.tokenConfigUpdateItem != null) - if (typeof object.tokenConfigUpdateItem === "string") - $util.base64.decode(object.tokenConfigUpdateItem, message.tokenConfigUpdateItem = $util.newBuffer($util.base64.length(object.tokenConfigUpdateItem)), 0); - else if (object.tokenConfigUpdateItem.length >= 0) - message.tokenConfigUpdateItem = object.tokenConfigUpdateItem; - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from a TokenConfigUpdateEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} message TokenConfigUpdateEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenConfigUpdateEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tokenConfigUpdateItem = ""; - else { - object.tokenConfigUpdateItem = []; - if (options.bytes !== Array) - object.tokenConfigUpdateItem = $util.newBuffer(object.tokenConfigUpdateItem); - } - object.publicNote = ""; - } - if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) - object.tokenConfigUpdateItem = options.bytes === String ? $util.base64.encode(message.tokenConfigUpdateItem, 0, message.tokenConfigUpdateItem.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenConfigUpdateItem) : message.tokenConfigUpdateItem; - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this TokenConfigUpdateEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent - * @instance - * @returns {Object.} JSON object - */ - TokenConfigUpdateEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenConfigUpdateEvent; - })(); - - GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent = (function() { - - /** - * Properties of an UpdateDirectPurchasePriceEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IUpdateDirectPurchasePriceEvent - * @property {number|Long|null} [fixedPrice] UpdateDirectPurchasePriceEvent fixedPrice - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null} [variablePrice] UpdateDirectPurchasePriceEvent variablePrice - * @property {string|null} [publicNote] UpdateDirectPurchasePriceEvent publicNote - */ - - /** - * Constructs a new UpdateDirectPurchasePriceEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents an UpdateDirectPurchasePriceEvent. - * @implements IUpdateDirectPurchasePriceEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set - */ - function UpdateDirectPurchasePriceEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDirectPurchasePriceEvent fixedPrice. - * @member {number|Long} fixedPrice - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - */ - UpdateDirectPurchasePriceEvent.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UpdateDirectPurchasePriceEvent variablePrice. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null|undefined} variablePrice - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - */ - UpdateDirectPurchasePriceEvent.prototype.variablePrice = null; - - /** - * UpdateDirectPurchasePriceEvent publicNote. - * @member {string} publicNote - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - */ - UpdateDirectPurchasePriceEvent.prototype.publicNote = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * UpdateDirectPurchasePriceEvent price. - * @member {"fixedPrice"|"variablePrice"|undefined} price - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - */ - Object.defineProperty(UpdateDirectPurchasePriceEvent.prototype, "price", { - get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new UpdateDirectPurchasePriceEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent instance - */ - UpdateDirectPurchasePriceEvent.create = function create(properties) { - return new UpdateDirectPurchasePriceEvent(properties); - }; - - /** - * Encodes the specified UpdateDirectPurchasePriceEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDirectPurchasePriceEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.fixedPrice); - if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); - return writer; - }; - - /** - * Encodes the specified UpdateDirectPurchasePriceEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDirectPurchasePriceEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDirectPurchasePriceEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fixedPrice = reader.uint64(); - break; - case 2: - message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.decode(reader, reader.uint32()); - break; - case 3: - message.publicNote = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDirectPurchasePriceEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDirectPurchasePriceEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDirectPurchasePriceEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { - properties.price = 1; - if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) - return "fixedPrice: integer|Long expected"; - } - if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { - if (properties.price === 1) - return "price: multiple values"; - properties.price = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify(message.variablePrice); - if (error) - return "variablePrice." + error; - } - } - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - if (!$util.isString(message.publicNote)) - return "publicNote: string expected"; - return null; - }; - - /** - * Creates an UpdateDirectPurchasePriceEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent - */ - UpdateDirectPurchasePriceEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); - if (object.fixedPrice != null) - if ($util.Long) - (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; - else if (typeof object.fixedPrice === "string") - message.fixedPrice = parseInt(object.fixedPrice, 10); - else if (typeof object.fixedPrice === "number") - message.fixedPrice = object.fixedPrice; - else if (typeof object.fixedPrice === "object") - message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); - if (object.variablePrice != null) { - if (typeof object.variablePrice !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.variablePrice: object expected"); - message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.fromObject(object.variablePrice); - } - if (object.publicNote != null) - message.publicNote = String(object.publicNote); - return message; - }; - - /** - * Creates a plain object from an UpdateDirectPurchasePriceEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDirectPurchasePriceEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.publicNote = ""; - if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { - if (typeof message.fixedPrice === "number") - object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; - else - object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; - if (options.oneofs) - object.price = "fixedPrice"; - } - if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { - object.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(message.variablePrice, options); - if (options.oneofs) - object.price = "variablePrice"; - } - if (message.publicNote != null && message.hasOwnProperty("publicNote")) - object.publicNote = message.publicNote; - return object; - }; - - /** - * Converts this UpdateDirectPurchasePriceEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @instance - * @returns {Object.} JSON object - */ - UpdateDirectPurchasePriceEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UpdateDirectPurchasePriceEvent.PriceForQuantity = (function() { - - /** - * Properties of a PriceForQuantity. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @interface IPriceForQuantity - * @property {number|Long|null} [quantity] PriceForQuantity quantity - * @property {number|Long|null} [price] PriceForQuantity price - */ - - /** - * Constructs a new PriceForQuantity. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @classdesc Represents a PriceForQuantity. - * @implements IPriceForQuantity - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set - */ - function PriceForQuantity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PriceForQuantity quantity. - * @member {number|Long} quantity - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @instance - */ - PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PriceForQuantity price. - * @member {number|Long} price - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @instance - */ - PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new PriceForQuantity instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity instance - */ - PriceForQuantity.create = function create(properties) { - return new PriceForQuantity(properties); - }; - - /** - * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceForQuantity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); - if (message.price != null && Object.hasOwnProperty.call(message, "price")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); - return writer; - }; - - /** - * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PriceForQuantity message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceForQuantity.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quantity = reader.uint64(); - break; - case 2: - message.price = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PriceForQuantity message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PriceForQuantity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quantity != null && message.hasOwnProperty("quantity")) - if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) - return "quantity: integer|Long expected"; - if (message.price != null && message.hasOwnProperty("price")) - if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) - return "price: integer|Long expected"; - return null; - }; - - /** - * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity - */ - PriceForQuantity.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); - if (object.quantity != null) - if ($util.Long) - (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; - else if (typeof object.quantity === "string") - message.quantity = parseInt(object.quantity, 10); - else if (typeof object.quantity === "number") - message.quantity = object.quantity; - else if (typeof object.quantity === "object") - message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); - if (object.price != null) - if ($util.Long) - (message.price = $util.Long.fromValue(object.price)).unsigned = true; - else if (typeof object.price === "string") - message.price = parseInt(object.price, 10); - else if (typeof object.price === "number") - message.price = object.price; - else if (typeof object.price === "object") - message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} message PriceForQuantity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PriceForQuantity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.quantity = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.price = options.longs === String ? "0" : 0; - } - if (message.quantity != null && message.hasOwnProperty("quantity")) - if (typeof message.quantity === "number") - object.quantity = options.longs === String ? String(message.quantity) : message.quantity; - else - object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; - if (message.price != null && message.hasOwnProperty("price")) - if (typeof message.price === "number") - object.price = options.longs === String ? String(message.price) : message.price; - else - object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; - return object; - }; - - /** - * Converts this PriceForQuantity to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity - * @instance - * @returns {Object.} JSON object - */ - PriceForQuantity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PriceForQuantity; - })(); - - UpdateDirectPurchasePriceEvent.PricingSchedule = (function() { - - /** - * Properties of a PricingSchedule. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @interface IPricingSchedule - * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity - */ - - /** - * Constructs a new PricingSchedule. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent - * @classdesc Represents a PricingSchedule. - * @implements IPricingSchedule - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set - */ - function PricingSchedule(properties) { - this.priceForQuantity = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PricingSchedule priceForQuantity. - * @member {Array.} priceForQuantity - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @instance - */ - PricingSchedule.prototype.priceForQuantity = $util.emptyArray; - - /** - * Creates a new PricingSchedule instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule instance - */ - PricingSchedule.create = function create(properties) { - return new PricingSchedule(properties); - }; - - /** - * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PricingSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.priceForQuantity != null && message.priceForQuantity.length) - for (var i = 0; i < message.priceForQuantity.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PricingSchedule message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PricingSchedule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.priceForQuantity && message.priceForQuantity.length)) - message.priceForQuantity = []; - message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PricingSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PricingSchedule message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PricingSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { - if (!Array.isArray(message.priceForQuantity)) - return "priceForQuantity: array expected"; - for (var i = 0; i < message.priceForQuantity.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify(message.priceForQuantity[i]); - if (error) - return "priceForQuantity." + error; - } - } - return null; - }; - - /** - * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule - */ - PricingSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); - if (object.priceForQuantity) { - if (!Array.isArray(object.priceForQuantity)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: array expected"); - message.priceForQuantity = []; - for (var i = 0; i < object.priceForQuantity.length; ++i) { - if (typeof object.priceForQuantity[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: object expected"); - message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.fromObject(object.priceForQuantity[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} message PricingSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PricingSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.priceForQuantity = []; - if (message.priceForQuantity && message.priceForQuantity.length) { - object.priceForQuantity = []; - for (var j = 0; j < message.priceForQuantity.length; ++j) - object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject(message.priceForQuantity[j], options); - } - return object; - }; - - /** - * Converts this PricingSchedule to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule - * @instance - * @returns {Object.} JSON object - */ - PricingSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PricingSchedule; - })(); - - return UpdateDirectPurchasePriceEvent; - })(); - - GetGroupActionsResponseV0.GroupActionEvent = (function() { - - /** - * Properties of a GroupActionEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IGroupActionEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null} [tokenEvent] GroupActionEvent tokenEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null} [documentEvent] GroupActionEvent documentEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null} [contractEvent] GroupActionEvent contractEvent - */ - - /** - * Constructs a new GroupActionEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a GroupActionEvent. - * @implements IGroupActionEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set - */ - function GroupActionEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActionEvent tokenEvent. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null|undefined} tokenEvent - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - */ - GroupActionEvent.prototype.tokenEvent = null; - - /** - * GroupActionEvent documentEvent. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null|undefined} documentEvent - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - */ - GroupActionEvent.prototype.documentEvent = null; - - /** - * GroupActionEvent contractEvent. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null|undefined} contractEvent - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - */ - GroupActionEvent.prototype.contractEvent = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GroupActionEvent eventType. - * @member {"tokenEvent"|"documentEvent"|"contractEvent"|undefined} eventType - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - */ - Object.defineProperty(GroupActionEvent.prototype, "eventType", { - get: $util.oneOfGetter($oneOfFields = ["tokenEvent", "documentEvent", "contractEvent"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GroupActionEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent instance - */ - GroupActionEvent.create = function create(properties) { - return new GroupActionEvent(properties); - }; - - /** - * Encodes the specified GroupActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tokenEvent != null && Object.hasOwnProperty.call(message, "tokenEvent")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.encode(message.tokenEvent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.documentEvent != null && Object.hasOwnProperty.call(message, "documentEvent")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.encode(message.documentEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contractEvent != null && Object.hasOwnProperty.call(message, "contractEvent")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.encode(message.contractEvent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActionEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.decode(reader, reader.uint32()); - break; - case 2: - message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.decode(reader, reader.uint32()); - break; - case 3: - message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActionEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActionEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActionEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { - properties.eventType = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify(message.tokenEvent); - if (error) - return "tokenEvent." + error; - } - } - if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { - if (properties.eventType === 1) - return "eventType: multiple values"; - properties.eventType = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify(message.documentEvent); - if (error) - return "documentEvent." + error; - } - } - if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { - if (properties.eventType === 1) - return "eventType: multiple values"; - properties.eventType = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify(message.contractEvent); - if (error) - return "contractEvent." + error; - } - } - return null; - }; - - /** - * Creates a GroupActionEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent - */ - GroupActionEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); - if (object.tokenEvent != null) { - if (typeof object.tokenEvent !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.tokenEvent: object expected"); - message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.fromObject(object.tokenEvent); - } - if (object.documentEvent != null) { - if (typeof object.documentEvent !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.documentEvent: object expected"); - message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.fromObject(object.documentEvent); - } - if (object.contractEvent != null) { - if (typeof object.contractEvent !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.contractEvent: object expected"); - message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.fromObject(object.contractEvent); - } - return message; - }; - - /** - * Creates a plain object from a GroupActionEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} message GroupActionEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActionEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { - object.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.toObject(message.tokenEvent, options); - if (options.oneofs) - object.eventType = "tokenEvent"; - } - if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { - object.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.toObject(message.documentEvent, options); - if (options.oneofs) - object.eventType = "documentEvent"; - } - if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { - object.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.toObject(message.contractEvent, options); - if (options.oneofs) - object.eventType = "contractEvent"; - } - return object; - }; - - /** - * Converts this GroupActionEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent - * @instance - * @returns {Object.} JSON object - */ - GroupActionEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActionEvent; - })(); - - GetGroupActionsResponseV0.DocumentEvent = (function() { - - /** - * Properties of a DocumentEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IDocumentEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null} [create] DocumentEvent create - */ - - /** - * Constructs a new DocumentEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a DocumentEvent. - * @implements IDocumentEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set - */ - function DocumentEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentEvent create. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null|undefined} create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @instance - */ - DocumentEvent.prototype.create = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DocumentEvent type. - * @member {"create"|undefined} type - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @instance - */ - Object.defineProperty(DocumentEvent.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["create"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DocumentEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent instance - */ - DocumentEvent.create = function create(properties) { - return new DocumentEvent(properties); - }; - - /** - * Encodes the specified DocumentEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.create != null && Object.hasOwnProperty.call(message, "create")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.encode(message.create, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.create != null && message.hasOwnProperty("create")) { - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify(message.create); - if (error) - return "create." + error; - } - } - return null; - }; - - /** - * Creates a DocumentEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent - */ - DocumentEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); - if (object.create != null) { - if (typeof object.create !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.create: object expected"); - message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.fromObject(object.create); - } - return message; - }; - - /** - * Creates a plain object from a DocumentEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} message DocumentEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.create != null && message.hasOwnProperty("create")) { - object.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.toObject(message.create, options); - if (options.oneofs) - object.type = "create"; - } - return object; - }; - - /** - * Converts this DocumentEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent - * @instance - * @returns {Object.} JSON object - */ - DocumentEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DocumentEvent; - })(); - - GetGroupActionsResponseV0.DocumentCreateEvent = (function() { - - /** - * Properties of a DocumentCreateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IDocumentCreateEvent - * @property {Uint8Array|null} [createdDocument] DocumentCreateEvent createdDocument - */ - - /** - * Constructs a new DocumentCreateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a DocumentCreateEvent. - * @implements IDocumentCreateEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set - */ - function DocumentCreateEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentCreateEvent createdDocument. - * @member {Uint8Array} createdDocument - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @instance - */ - DocumentCreateEvent.prototype.createdDocument = $util.newBuffer([]); - - /** - * Creates a new DocumentCreateEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent instance - */ - DocumentCreateEvent.create = function create(properties) { - return new DocumentCreateEvent(properties); - }; - - /** - * Encodes the specified DocumentCreateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentCreateEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createdDocument != null && Object.hasOwnProperty.call(message, "createdDocument")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.createdDocument); - return writer; - }; - - /** - * Encodes the specified DocumentCreateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentCreateEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentCreateEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentCreateEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.createdDocument = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentCreateEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentCreateEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentCreateEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentCreateEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) - if (!(message.createdDocument && typeof message.createdDocument.length === "number" || $util.isString(message.createdDocument))) - return "createdDocument: buffer expected"; - return null; - }; - - /** - * Creates a DocumentCreateEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent - */ - DocumentCreateEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); - if (object.createdDocument != null) - if (typeof object.createdDocument === "string") - $util.base64.decode(object.createdDocument, message.createdDocument = $util.newBuffer($util.base64.length(object.createdDocument)), 0); - else if (object.createdDocument.length >= 0) - message.createdDocument = object.createdDocument; - return message; - }; - - /** - * Creates a plain object from a DocumentCreateEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} message DocumentCreateEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentCreateEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.createdDocument = ""; - else { - object.createdDocument = []; - if (options.bytes !== Array) - object.createdDocument = $util.newBuffer(object.createdDocument); - } - if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) - object.createdDocument = options.bytes === String ? $util.base64.encode(message.createdDocument, 0, message.createdDocument.length) : options.bytes === Array ? Array.prototype.slice.call(message.createdDocument) : message.createdDocument; - return object; - }; - - /** - * Converts this DocumentCreateEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent - * @instance - * @returns {Object.} JSON object - */ - DocumentCreateEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DocumentCreateEvent; - })(); - - GetGroupActionsResponseV0.ContractUpdateEvent = (function() { - - /** - * Properties of a ContractUpdateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IContractUpdateEvent - * @property {Uint8Array|null} [updatedContract] ContractUpdateEvent updatedContract - */ - - /** - * Constructs a new ContractUpdateEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a ContractUpdateEvent. - * @implements IContractUpdateEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set - */ - function ContractUpdateEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContractUpdateEvent updatedContract. - * @member {Uint8Array} updatedContract - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @instance - */ - ContractUpdateEvent.prototype.updatedContract = $util.newBuffer([]); - - /** - * Creates a new ContractUpdateEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent instance - */ - ContractUpdateEvent.create = function create(properties) { - return new ContractUpdateEvent(properties); - }; - - /** - * Encodes the specified ContractUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractUpdateEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updatedContract != null && Object.hasOwnProperty.call(message, "updatedContract")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.updatedContract); - return writer; - }; - - /** - * Encodes the specified ContractUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContractUpdateEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractUpdateEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.updatedContract = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContractUpdateEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractUpdateEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContractUpdateEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContractUpdateEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) - if (!(message.updatedContract && typeof message.updatedContract.length === "number" || $util.isString(message.updatedContract))) - return "updatedContract: buffer expected"; - return null; - }; - - /** - * Creates a ContractUpdateEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent - */ - ContractUpdateEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); - if (object.updatedContract != null) - if (typeof object.updatedContract === "string") - $util.base64.decode(object.updatedContract, message.updatedContract = $util.newBuffer($util.base64.length(object.updatedContract)), 0); - else if (object.updatedContract.length >= 0) - message.updatedContract = object.updatedContract; - return message; - }; - - /** - * Creates a plain object from a ContractUpdateEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} message ContractUpdateEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContractUpdateEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.updatedContract = ""; - else { - object.updatedContract = []; - if (options.bytes !== Array) - object.updatedContract = $util.newBuffer(object.updatedContract); - } - if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) - object.updatedContract = options.bytes === String ? $util.base64.encode(message.updatedContract, 0, message.updatedContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.updatedContract) : message.updatedContract; - return object; - }; - - /** - * Converts this ContractUpdateEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent - * @instance - * @returns {Object.} JSON object - */ - ContractUpdateEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContractUpdateEvent; - })(); - - GetGroupActionsResponseV0.ContractEvent = (function() { - - /** - * Properties of a ContractEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IContractEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null} [update] ContractEvent update - */ - - /** - * Constructs a new ContractEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a ContractEvent. - * @implements IContractEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set - */ - function ContractEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContractEvent update. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null|undefined} update - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @instance - */ - ContractEvent.prototype.update = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ContractEvent type. - * @member {"update"|undefined} type - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @instance - */ - Object.defineProperty(ContractEvent.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["update"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ContractEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent instance - */ - ContractEvent.create = function create(properties) { - return new ContractEvent(properties); - }; - - /** - * Encodes the specified ContractEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContractEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContractEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContractEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContractEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContractEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContractEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContractEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.update != null && message.hasOwnProperty("update")) { - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify(message.update); - if (error) - return "update." + error; - } - } - return null; - }; - - /** - * Creates a ContractEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent - */ - ContractEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.update: object expected"); - message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.fromObject(object.update); - } - return message; - }; - - /** - * Creates a plain object from a ContractEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} message ContractEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContractEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.update != null && message.hasOwnProperty("update")) { - object.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.toObject(message.update, options); - if (options.oneofs) - object.type = "update"; - } - return object; - }; - - /** - * Converts this ContractEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent - * @instance - * @returns {Object.} JSON object - */ - ContractEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContractEvent; - })(); - - GetGroupActionsResponseV0.TokenEvent = (function() { - - /** - * Properties of a TokenEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface ITokenEvent - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null} [mint] TokenEvent mint - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null} [burn] TokenEvent burn - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null} [freeze] TokenEvent freeze - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null} [unfreeze] TokenEvent unfreeze - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null} [destroyFrozenFunds] TokenEvent destroyFrozenFunds - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null} [emergencyAction] TokenEvent emergencyAction - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null} [tokenConfigUpdate] TokenEvent tokenConfigUpdate - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null} [updatePrice] TokenEvent updatePrice - */ - - /** - * Constructs a new TokenEvent. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a TokenEvent. - * @implements ITokenEvent - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set - */ - function TokenEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TokenEvent mint. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null|undefined} mint - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.mint = null; - - /** - * TokenEvent burn. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null|undefined} burn - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.burn = null; - - /** - * TokenEvent freeze. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null|undefined} freeze - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.freeze = null; - - /** - * TokenEvent unfreeze. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null|undefined} unfreeze - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.unfreeze = null; - - /** - * TokenEvent destroyFrozenFunds. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null|undefined} destroyFrozenFunds - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.destroyFrozenFunds = null; - - /** - * TokenEvent emergencyAction. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null|undefined} emergencyAction - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.emergencyAction = null; - - /** - * TokenEvent tokenConfigUpdate. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null|undefined} tokenConfigUpdate - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.tokenConfigUpdate = null; - - /** - * TokenEvent updatePrice. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null|undefined} updatePrice - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - TokenEvent.prototype.updatePrice = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TokenEvent type. - * @member {"mint"|"burn"|"freeze"|"unfreeze"|"destroyFrozenFunds"|"emergencyAction"|"tokenConfigUpdate"|"updatePrice"|undefined} type - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - */ - Object.defineProperty(TokenEvent.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["mint", "burn", "freeze", "unfreeze", "destroyFrozenFunds", "emergencyAction", "tokenConfigUpdate", "updatePrice"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TokenEvent instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent instance - */ - TokenEvent.create = function create(properties) { - return new TokenEvent(properties); - }; - - /** - * Encodes the specified TokenEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mint != null && Object.hasOwnProperty.call(message, "mint")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.encode(message.mint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.burn != null && Object.hasOwnProperty.call(message, "burn")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.encode(message.burn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.freeze != null && Object.hasOwnProperty.call(message, "freeze")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.encode(message.freeze, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.unfreeze != null && Object.hasOwnProperty.call(message, "unfreeze")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.encode(message.unfreeze, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.destroyFrozenFunds != null && Object.hasOwnProperty.call(message, "destroyFrozenFunds")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.encode(message.destroyFrozenFunds, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.emergencyAction != null && Object.hasOwnProperty.call(message, "emergencyAction")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.encode(message.emergencyAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.tokenConfigUpdate != null && Object.hasOwnProperty.call(message, "tokenConfigUpdate")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.encode(message.tokenConfigUpdate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updatePrice != null && Object.hasOwnProperty.call(message, "updatePrice")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.encode(message.updatePrice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TokenEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TokenEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TokenEvent message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.decode(reader, reader.uint32()); - break; - case 2: - message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.decode(reader, reader.uint32()); - break; - case 3: - message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.decode(reader, reader.uint32()); - break; - case 4: - message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.decode(reader, reader.uint32()); - break; - case 5: - message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.decode(reader, reader.uint32()); - break; - case 6: - message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.decode(reader, reader.uint32()); - break; - case 7: - message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.decode(reader, reader.uint32()); - break; - case 8: - message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TokenEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TokenEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TokenEvent message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TokenEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.mint != null && message.hasOwnProperty("mint")) { - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify(message.mint); - if (error) - return "mint." + error; - } - } - if (message.burn != null && message.hasOwnProperty("burn")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify(message.burn); - if (error) - return "burn." + error; - } - } - if (message.freeze != null && message.hasOwnProperty("freeze")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify(message.freeze); - if (error) - return "freeze." + error; - } - } - if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify(message.unfreeze); - if (error) - return "unfreeze." + error; - } - } - if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify(message.destroyFrozenFunds); - if (error) - return "destroyFrozenFunds." + error; - } - } - if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify(message.emergencyAction); - if (error) - return "emergencyAction." + error; - } - } - if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify(message.tokenConfigUpdate); - if (error) - return "tokenConfigUpdate." + error; - } - } - if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify(message.updatePrice); - if (error) - return "updatePrice." + error; - } - } - return null; - }; - - /** - * Creates a TokenEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent - */ - TokenEvent.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); - if (object.mint != null) { - if (typeof object.mint !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.mint: object expected"); - message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.fromObject(object.mint); - } - if (object.burn != null) { - if (typeof object.burn !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.burn: object expected"); - message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.fromObject(object.burn); - } - if (object.freeze != null) { - if (typeof object.freeze !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.freeze: object expected"); - message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.fromObject(object.freeze); - } - if (object.unfreeze != null) { - if (typeof object.unfreeze !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.unfreeze: object expected"); - message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.fromObject(object.unfreeze); - } - if (object.destroyFrozenFunds != null) { - if (typeof object.destroyFrozenFunds !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.destroyFrozenFunds: object expected"); - message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.fromObject(object.destroyFrozenFunds); - } - if (object.emergencyAction != null) { - if (typeof object.emergencyAction !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.emergencyAction: object expected"); - message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.fromObject(object.emergencyAction); - } - if (object.tokenConfigUpdate != null) { - if (typeof object.tokenConfigUpdate !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.tokenConfigUpdate: object expected"); - message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.fromObject(object.tokenConfigUpdate); - } - if (object.updatePrice != null) { - if (typeof object.updatePrice !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.updatePrice: object expected"); - message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.fromObject(object.updatePrice); - } - return message; - }; - - /** - * Creates a plain object from a TokenEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} message TokenEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TokenEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.mint != null && message.hasOwnProperty("mint")) { - object.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.toObject(message.mint, options); - if (options.oneofs) - object.type = "mint"; - } - if (message.burn != null && message.hasOwnProperty("burn")) { - object.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.toObject(message.burn, options); - if (options.oneofs) - object.type = "burn"; - } - if (message.freeze != null && message.hasOwnProperty("freeze")) { - object.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.toObject(message.freeze, options); - if (options.oneofs) - object.type = "freeze"; - } - if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { - object.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.toObject(message.unfreeze, options); - if (options.oneofs) - object.type = "unfreeze"; - } - if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { - object.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.toObject(message.destroyFrozenFunds, options); - if (options.oneofs) - object.type = "destroyFrozenFunds"; - } - if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { - object.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.toObject(message.emergencyAction, options); - if (options.oneofs) - object.type = "emergencyAction"; - } - if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { - object.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(message.tokenConfigUpdate, options); - if (options.oneofs) - object.type = "tokenConfigUpdate"; - } - if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { - object.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(message.updatePrice, options); - if (options.oneofs) - object.type = "updatePrice"; - } - return object; - }; - - /** - * Converts this TokenEvent to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent - * @instance - * @returns {Object.} JSON object - */ - TokenEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TokenEvent; - })(); - - GetGroupActionsResponseV0.GroupActionEntry = (function() { - - /** - * Properties of a GroupActionEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IGroupActionEntry - * @property {Uint8Array|null} [actionId] GroupActionEntry actionId - * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null} [event] GroupActionEntry event - */ - - /** - * Constructs a new GroupActionEntry. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a GroupActionEntry. - * @implements IGroupActionEntry - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set - */ - function GroupActionEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActionEntry actionId. - * @member {Uint8Array} actionId - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @instance - */ - GroupActionEntry.prototype.actionId = $util.newBuffer([]); - - /** - * GroupActionEntry event. - * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null|undefined} event - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @instance - */ - GroupActionEntry.prototype.event = null; - - /** - * Creates a new GroupActionEntry instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry instance - */ - GroupActionEntry.create = function create(properties) { - return new GroupActionEntry(properties); - }; - - /** - * Encodes the specified GroupActionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.actionId); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupActionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActionEntry message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.actionId = reader.bytes(); - break; - case 2: - message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActionEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActionEntry message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActionEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionId != null && message.hasOwnProperty("actionId")) - if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) - return "actionId: buffer expected"; - if (message.event != null && message.hasOwnProperty("event")) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify(message.event); - if (error) - return "event." + error; - } - return null; - }; - - /** - * Creates a GroupActionEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry - */ - GroupActionEntry.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); - if (object.actionId != null) - if (typeof object.actionId === "string") - $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); - else if (object.actionId.length >= 0) - message.actionId = object.actionId; - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.event: object expected"); - message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.fromObject(object.event); - } - return message; - }; - - /** - * Creates a plain object from a GroupActionEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} message GroupActionEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActionEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.actionId = ""; - else { - object.actionId = []; - if (options.bytes !== Array) - object.actionId = $util.newBuffer(object.actionId); - } - object.event = null; - } - if (message.actionId != null && message.hasOwnProperty("actionId")) - object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; - if (message.event != null && message.hasOwnProperty("event")) - object.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.toObject(message.event, options); - return object; - }; - - /** - * Converts this GroupActionEntry to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry - * @instance - * @returns {Object.} JSON object - */ - GroupActionEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActionEntry; - })(); - - GetGroupActionsResponseV0.GroupActions = (function() { - - /** - * Properties of a GroupActions. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @interface IGroupActions - * @property {Array.|null} [groupActions] GroupActions groupActions - */ - - /** - * Constructs a new GroupActions. - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 - * @classdesc Represents a GroupActions. - * @implements IGroupActions - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set - */ - function GroupActions(properties) { - this.groupActions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActions groupActions. - * @member {Array.} groupActions - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @instance - */ - GroupActions.prototype.groupActions = $util.emptyArray; - - /** - * Creates a new GroupActions instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions instance - */ - GroupActions.create = function create(properties) { - return new GroupActions(properties); - }; - - /** - * Encodes the specified GroupActions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupActions != null && message.groupActions.length) - for (var i = 0; i < message.groupActions.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.encode(message.groupActions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupActions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActions message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.groupActions && message.groupActions.length)) - message.groupActions = []; - message.groupActions.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActions message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.groupActions != null && message.hasOwnProperty("groupActions")) { - if (!Array.isArray(message.groupActions)) - return "groupActions: array expected"; - for (var i = 0; i < message.groupActions.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify(message.groupActions[i]); - if (error) - return "groupActions." + error; - } - } - return null; - }; - - /** - * Creates a GroupActions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions - */ - GroupActions.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); - if (object.groupActions) { - if (!Array.isArray(object.groupActions)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: array expected"); - message.groupActions = []; - for (var i = 0; i < object.groupActions.length; ++i) { - if (typeof object.groupActions[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: object expected"); - message.groupActions[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.fromObject(object.groupActions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GroupActions message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} message GroupActions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupActions = []; - if (message.groupActions && message.groupActions.length) { - object.groupActions = []; - for (var j = 0; j < message.groupActions.length; ++j) - object.groupActions[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.toObject(message.groupActions[j], options); - } - return object; - }; - - /** - * Converts this GroupActions to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions - * @instance - * @returns {Object.} JSON object - */ - GroupActions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActions; - })(); - - return GetGroupActionsResponseV0; - })(); - - return GetGroupActionsResponse; - })(); - - v0.GetGroupActionSignersRequest = (function() { - - /** - * Properties of a GetGroupActionSignersRequest. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupActionSignersRequest - * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null} [v0] GetGroupActionSignersRequest v0 - */ - - /** - * Constructs a new GetGroupActionSignersRequest. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupActionSignersRequest. - * @implements IGetGroupActionSignersRequest - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set - */ - function GetGroupActionSignersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionSignersRequest v0. - * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @instance - */ - GetGroupActionSignersRequest.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionSignersRequest version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @instance - */ - Object.defineProperty(GetGroupActionSignersRequest.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionSignersRequest instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest instance - */ - GetGroupActionSignersRequest.create = function create(properties) { - return new GetGroupActionSignersRequest(properties); - }; - - /** - * Encodes the specified GetGroupActionSignersRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionSignersRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionSignersRequest message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionSignersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupActionSignersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest - */ - GetGroupActionSignersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersRequest.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionSignersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} message GetGroupActionSignersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionSignersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupActionSignersRequest to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionSignersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * ActionStatus enum. - * @name org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus - * @enum {number} - * @property {number} ACTIVE=0 ACTIVE value - * @property {number} CLOSED=1 CLOSED value - */ - GetGroupActionSignersRequest.ActionStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTIVE"] = 0; - values[valuesById[1] = "CLOSED"] = 1; - return values; - })(); - - GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 = (function() { - - /** - * Properties of a GetGroupActionSignersRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @interface IGetGroupActionSignersRequestV0 - * @property {Uint8Array|null} [contractId] GetGroupActionSignersRequestV0 contractId - * @property {number|null} [groupContractPosition] GetGroupActionSignersRequestV0 groupContractPosition - * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus|null} [status] GetGroupActionSignersRequestV0 status - * @property {Uint8Array|null} [actionId] GetGroupActionSignersRequestV0 actionId - * @property {boolean|null} [prove] GetGroupActionSignersRequestV0 prove - */ - - /** - * Constructs a new GetGroupActionSignersRequestV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest - * @classdesc Represents a GetGroupActionSignersRequestV0. - * @implements IGetGroupActionSignersRequestV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set - */ - function GetGroupActionSignersRequestV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionSignersRequestV0 contractId. - * @member {Uint8Array} contractId - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.contractId = $util.newBuffer([]); - - /** - * GetGroupActionSignersRequestV0 groupContractPosition. - * @member {number} groupContractPosition - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.groupContractPosition = 0; - - /** - * GetGroupActionSignersRequestV0 status. - * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus} status - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.status = 0; - - /** - * GetGroupActionSignersRequestV0 actionId. - * @member {Uint8Array} actionId - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.actionId = $util.newBuffer([]); - - /** - * GetGroupActionSignersRequestV0 prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - */ - GetGroupActionSignersRequestV0.prototype.prove = false; - - /** - * Creates a new GetGroupActionSignersRequestV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 instance - */ - GetGroupActionSignersRequestV0.create = function create(properties) { - return new GetGroupActionSignersRequestV0(properties); - }; - - /** - * Encodes the specified GetGroupActionSignersRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersRequestV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); - if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.actionId); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified GetGroupActionSignersRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersRequestV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersRequestV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contractId = reader.bytes(); - break; - case 2: - message.groupContractPosition = reader.uint32(); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.actionId = reader.bytes(); - break; - case 5: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersRequestV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionSignersRequestV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionSignersRequestV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) - return "contractId: buffer expected"; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - if (!$util.isInteger(message.groupContractPosition)) - return "groupContractPosition: integer expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - break; - } - if (message.actionId != null && message.hasOwnProperty("actionId")) - if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) - return "actionId: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a GetGroupActionSignersRequestV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 - */ - GetGroupActionSignersRequestV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); - if (object.contractId != null) - if (typeof object.contractId === "string") - $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); - else if (object.contractId.length >= 0) - message.contractId = object.contractId; - if (object.groupContractPosition != null) - message.groupContractPosition = object.groupContractPosition >>> 0; - switch (object.status) { - case "ACTIVE": - case 0: - message.status = 0; - break; - case "CLOSED": - case 1: - message.status = 1; - break; - } - if (object.actionId != null) - if (typeof object.actionId === "string") - $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); - else if (object.actionId.length >= 0) - message.actionId = object.actionId; - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a GetGroupActionSignersRequestV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionSignersRequestV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contractId = ""; - else { - object.contractId = []; - if (options.bytes !== Array) - object.contractId = $util.newBuffer(object.contractId); - } - object.groupContractPosition = 0; - object.status = options.enums === String ? "ACTIVE" : 0; - if (options.bytes === String) - object.actionId = ""; - else { - object.actionId = []; - if (options.bytes !== Array) - object.actionId = $util.newBuffer(object.actionId); - } - object.prove = false; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; - if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) - object.groupContractPosition = message.groupContractPosition; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus[message.status] : message.status; - if (message.actionId != null && message.hasOwnProperty("actionId")) - object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this GetGroupActionSignersRequestV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionSignersRequestV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetGroupActionSignersRequestV0; - })(); - - return GetGroupActionSignersRequest; - })(); - - v0.GetGroupActionSignersResponse = (function() { - - /** - * Properties of a GetGroupActionSignersResponse. - * @memberof org.dash.platform.dapi.v0 - * @interface IGetGroupActionSignersResponse - * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null} [v0] GetGroupActionSignersResponse v0 - */ - - /** - * Constructs a new GetGroupActionSignersResponse. - * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetGroupActionSignersResponse. - * @implements IGetGroupActionSignersResponse - * @constructor - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set - */ - function GetGroupActionSignersResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionSignersResponse v0. - * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null|undefined} v0 - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @instance - */ - GetGroupActionSignersResponse.prototype.v0 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionSignersResponse version. - * @member {"v0"|undefined} version - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @instance - */ - Object.defineProperty(GetGroupActionSignersResponse.prototype, "version", { - get: $util.oneOfGetter($oneOfFields = ["v0"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionSignersResponse instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse instance - */ - GetGroupActionSignersResponse.create = function create(properties) { - return new GetGroupActionSignersResponse(properties); - }; - - /** - * Encodes the specified GetGroupActionSignersResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) - $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionSignersResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionSignersResponse message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionSignersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - properties.version = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify(message.v0); - if (error) - return "v0." + error; - } - } - return null; - }; - - /** - * Creates a GetGroupActionSignersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse - */ - GetGroupActionSignersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); - if (object.v0 != null) { - if (typeof object.v0 !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.v0: object expected"); - message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.fromObject(object.v0); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionSignersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} message GetGroupActionSignersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionSignersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.v0 != null && message.hasOwnProperty("v0")) { - object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.toObject(message.v0, options); - if (options.oneofs) - object.version = "v0"; - } - return object; - }; - - /** - * Converts this GetGroupActionSignersResponse to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionSignersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 = (function() { - - /** - * Properties of a GetGroupActionSignersResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @interface IGetGroupActionSignersResponseV0 - * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null} [groupActionSigners] GetGroupActionSignersResponseV0 groupActionSigners - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionSignersResponseV0 proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionSignersResponseV0 metadata - */ - - /** - * Constructs a new GetGroupActionSignersResponseV0. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse - * @classdesc Represents a GetGroupActionSignersResponseV0. - * @implements IGetGroupActionSignersResponseV0 - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set - */ - function GetGroupActionSignersResponseV0(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetGroupActionSignersResponseV0 groupActionSigners. - * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null|undefined} groupActionSigners - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - */ - GetGroupActionSignersResponseV0.prototype.groupActionSigners = null; - - /** - * GetGroupActionSignersResponseV0 proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - */ - GetGroupActionSignersResponseV0.prototype.proof = null; - - /** - * GetGroupActionSignersResponseV0 metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - */ - GetGroupActionSignersResponseV0.prototype.metadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GetGroupActionSignersResponseV0 result. - * @member {"groupActionSigners"|"proof"|undefined} result - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - */ - Object.defineProperty(GetGroupActionSignersResponseV0.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["groupActionSigners", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GetGroupActionSignersResponseV0 instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 instance - */ - GetGroupActionSignersResponseV0.create = function create(properties) { - return new GetGroupActionSignersResponseV0(properties); - }; - - /** - * Encodes the specified GetGroupActionSignersResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersResponseV0.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupActionSigners != null && Object.hasOwnProperty.call(message, "groupActionSigners")) - $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.encode(message.groupActionSigners, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetGroupActionSignersResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetGroupActionSignersResponseV0.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersResponseV0.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.decode(reader, reader.uint32()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetGroupActionSignersResponseV0.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetGroupActionSignersResponseV0 message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetGroupActionSignersResponseV0.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify(message.groupActionSigners); - if (error) - return "groupActionSigners." + error; - } - } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a GetGroupActionSignersResponseV0 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 - */ - GetGroupActionSignersResponseV0.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); - if (object.groupActionSigners != null) { - if (typeof object.groupActionSigners !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.groupActionSigners: object expected"); - message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.fromObject(object.groupActionSigners); - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a GetGroupActionSignersResponseV0 message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetGroupActionSignersResponseV0.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.metadata = null; - if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { - object.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.toObject(message.groupActionSigners, options); - if (options.oneofs) - object.result = "groupActionSigners"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.result = "proof"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this GetGroupActionSignersResponseV0 to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @instance - * @returns {Object.} JSON object - */ - GetGroupActionSignersResponseV0.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GetGroupActionSignersResponseV0.GroupActionSigner = (function() { - - /** - * Properties of a GroupActionSigner. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @interface IGroupActionSigner - * @property {Uint8Array|null} [signerId] GroupActionSigner signerId - * @property {number|null} [power] GroupActionSigner power - */ - - /** - * Constructs a new GroupActionSigner. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @classdesc Represents a GroupActionSigner. - * @implements IGroupActionSigner - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set - */ - function GroupActionSigner(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActionSigner signerId. - * @member {Uint8Array} signerId - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @instance - */ - GroupActionSigner.prototype.signerId = $util.newBuffer([]); - - /** - * GroupActionSigner power. - * @member {number} power - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @instance - */ - GroupActionSigner.prototype.power = 0; - - /** - * Creates a new GroupActionSigner instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner instance - */ - GroupActionSigner.create = function create(properties) { - return new GroupActionSigner(properties); - }; - - /** - * Encodes the specified GroupActionSigner message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionSigner.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signerId != null && Object.hasOwnProperty.call(message, "signerId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signerId); - if (message.power != null && Object.hasOwnProperty.call(message, "power")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); - return writer; - }; - - /** - * Encodes the specified GroupActionSigner message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionSigner.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActionSigner message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionSigner.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signerId = reader.bytes(); - break; - case 2: - message.power = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActionSigner message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionSigner.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActionSigner message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActionSigner.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signerId != null && message.hasOwnProperty("signerId")) - if (!(message.signerId && typeof message.signerId.length === "number" || $util.isString(message.signerId))) - return "signerId: buffer expected"; - if (message.power != null && message.hasOwnProperty("power")) - if (!$util.isInteger(message.power)) - return "power: integer expected"; - return null; - }; - - /** - * Creates a GroupActionSigner message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner - */ - GroupActionSigner.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); - if (object.signerId != null) - if (typeof object.signerId === "string") - $util.base64.decode(object.signerId, message.signerId = $util.newBuffer($util.base64.length(object.signerId)), 0); - else if (object.signerId.length >= 0) - message.signerId = object.signerId; - if (object.power != null) - message.power = object.power >>> 0; - return message; - }; - - /** - * Creates a plain object from a GroupActionSigner message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} message GroupActionSigner - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActionSigner.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signerId = ""; - else { - object.signerId = []; - if (options.bytes !== Array) - object.signerId = $util.newBuffer(object.signerId); - } - object.power = 0; - } - if (message.signerId != null && message.hasOwnProperty("signerId")) - object.signerId = options.bytes === String ? $util.base64.encode(message.signerId, 0, message.signerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.signerId) : message.signerId; - if (message.power != null && message.hasOwnProperty("power")) - object.power = message.power; - return object; - }; - - /** - * Converts this GroupActionSigner to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner - * @instance - * @returns {Object.} JSON object - */ - GroupActionSigner.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActionSigner; - })(); - - GetGroupActionSignersResponseV0.GroupActionSigners = (function() { - - /** - * Properties of a GroupActionSigners. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @interface IGroupActionSigners - * @property {Array.|null} [signers] GroupActionSigners signers - */ - - /** - * Constructs a new GroupActionSigners. - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 - * @classdesc Represents a GroupActionSigners. - * @implements IGroupActionSigners - * @constructor - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set - */ - function GroupActionSigners(properties) { - this.signers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GroupActionSigners signers. - * @member {Array.} signers - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @instance - */ - GroupActionSigners.prototype.signers = $util.emptyArray; - - /** - * Creates a new GroupActionSigners instance using the specified properties. - * @function create - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners instance - */ - GroupActionSigners.create = function create(properties) { - return new GroupActionSigners(properties); - }; - - /** - * Encodes the specified GroupActionSigners message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. - * @function encode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionSigners.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signers != null && message.signers.length) - for (var i = 0; i < message.signers.length; ++i) - $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.encode(message.signers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GroupActionSigners message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. - * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupActionSigners.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupActionSigners message from the specified reader or buffer. - * @function decode - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionSigners.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.signers && message.signers.length)) - message.signers = []; - message.signers.push($root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GroupActionSigners message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GroupActionSigners.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GroupActionSigners message. - * @function verify - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GroupActionSigners.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signers != null && message.hasOwnProperty("signers")) { - if (!Array.isArray(message.signers)) - return "signers: array expected"; - for (var i = 0; i < message.signers.length; ++i) { - var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify(message.signers[i]); - if (error) - return "signers." + error; - } - } - return null; - }; - - /** - * Creates a GroupActionSigners message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners - */ - GroupActionSigners.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners) - return object; - var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); - if (object.signers) { - if (!Array.isArray(object.signers)) - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: array expected"); - message.signers = []; - for (var i = 0; i < object.signers.length; ++i) { - if (typeof object.signers[i] !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: object expected"); - message.signers[i] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.fromObject(object.signers[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GroupActionSigners message. Also converts values to other types if specified. - * @function toObject - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @static - * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} message GroupActionSigners - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GroupActionSigners.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.signers = []; - if (message.signers && message.signers.length) { - object.signers = []; - for (var j = 0; j < message.signers.length; ++j) - object.signers[j] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.toObject(message.signers[j], options); - } - return object; - }; - - /** - * Converts this GroupActionSigners to JSON. - * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners - * @instance - * @returns {Object.} JSON object - */ - GroupActionSigners.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GroupActionSigners; - })(); - - return GetGroupActionSignersResponseV0; - })(); - - return GetGroupActionSignersResponse; - })(); - - return v0; - })(); - - return dapi; - })(); - - return platform; - })(); - - return dash; - })(); - - return org; -})(); - -$root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BytesValue; - })(); - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(properties) { - this.fields = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fields[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!$util.isObject(message.fields)) - return "fields: object expected"; - var key = Object.keys(message.fields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Struct) - return object; - var message = new $root.google.protobuf.Struct(); - if (object.fields) { - if (typeof object.fields !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields = {}; - for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { - if (typeof object.fields[keys[i]] !== "object") - throw TypeError(".google.protobuf.Struct.fields: object expected"); - message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.Struct} message Struct - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Struct.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.fields = {}; - var keys2; - if (message.fields && (keys2 = Object.keys(message.fields)).length) { - object.fields = {}; - for (var j = 0; j < keys2.length; ++j) - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Struct; - })(); - - protobuf.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ - - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = 0; - - /** - * Value numberValue. - * @member {number} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = 0; - - /** - * Value stringValue. - * @member {string} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = ""; - - /** - * Value boolValue. - * @member {boolean} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = false; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nullValue = reader.int32(); - break; - case 2: - message.numberValue = reader.double(); - break; - case 3: - message.stringValue = reader.string(); - break; - case 4: - message.boolValue = reader.bool(); - break; - case 5: - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 6: - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.kind = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.numberValue !== "number") - return "numberValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structValue); - if (error) - return "structValue." + error; - } - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.protobuf.ListValue.verify(message.listValue); - if (error) - return "listValue." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Value) - return object; - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); - } - if (object.listValue != null) { - if (typeof object.listValue !== "object") - throw TypeError(".google.protobuf.Value.listValue: object expected"); - message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); - - protobuf.ListValue = (function() { - - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ - - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; - - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ListValue} ListValue - */ - ListValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ListValue) - return object; - var message = new $root.google.protobuf.ListValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.protobuf.ListValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.protobuf.ListValue.values: object expected"); - message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListValue; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - - return protobuf; - })(); - - return google; -})(); - module.exports = $root; diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js index 388fe00b802..ad8743c4214 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js @@ -367,12 +367,11 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesR goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.PriceCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest', null, { proto }); @@ -4879,37 +4878,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse'; } /** * Generated by JsPbCodeGenerator. @@ -4921,16 +4899,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0'; } /** * Generated by JsPbCodeGenerator. @@ -4942,16 +4920,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity'; } /** * Generated by JsPbCodeGenerator. @@ -4963,16 +4941,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule'; } /** * Generated by JsPbCodeGenerator. @@ -4984,16 +4962,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry'; } /** * Generated by JsPbCodeGenerator. @@ -5005,16 +4983,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices'; } /** * Generated by JsPbCodeGenerator. @@ -5026,16 +5004,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest'; } /** * Generated by JsPbCodeGenerator. @@ -5047,16 +5025,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0'; } /** * Generated by JsPbCodeGenerator. @@ -51984,392 +51962,6 @@ proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.prototype.hasV0 = funct -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject = function(includeInstance, msg) { - var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest; - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader); - msg.setV0(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getV0(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject = function(includeInstance, msg) { - var f, obj = { - tokenIdsList: msg.getTokenIdsList_asB64(), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addTokenIds(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setProve(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokenIdsList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 1, - f - ); - } - f = message.getProve(); - if (f) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * repeated bytes token_ids = 1; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * repeated bytes token_ids = 1; - * This is a type-conversion wrapper around `getTokenIdsList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getTokenIdsList())); -}; - - -/** - * repeated bytes token_ids = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTokenIdsList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getTokenIdsList())); -}; - - -/** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setTokenIdsList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.addTokenIds = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.clearTokenIdsList = function() { - return this.setTokenIdsList([]); -}; - - -/** - * optional bool prove = 2; - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - -/** - * optional GetTokenDirectPurchasePricesRequestV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this -*/ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.clearV0 = function() { - return this.setV0(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -53005,225 +52597,26 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_ = [[1,2]]; +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_ = [[2,3]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase = { +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.PriceCase = { PRICE_NOT_SET: 0, - FIXED_PRICE: 1, - VARIABLE_PRICE: 2 + FIXED_PRICE: 2, + VARIABLE_PRICE: 3 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase} + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.PriceCase} */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getPriceCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getPriceCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.PriceCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_[0])); }; -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject = function(includeInstance, msg) { - var f, obj = { - fixedPrice: jspb.Message.getFieldWithDefault(msg, 1, 0), - variablePrice: (f = msg.getVariablePrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price; - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setFixedPrice(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader); - msg.setVariablePrice(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeUint64( - 1, - f - ); - } - f = message.getVariablePrice(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter - ); - } -}; - - -/** - * optional uint64 fixed_price = 1; - * @return {number} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getFixedPrice = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.setFixedPrice = function(value) { - return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.clearFixedPrice = function() { - return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.hasFixedPrice = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional PricingSchedule variable_price = 2; - * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getVariablePrice = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, 2)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this -*/ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.setVariablePrice = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.clearVariablePrice = function() { - return this.setVariablePrice(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.hasVariablePrice = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - - - if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -53254,7 +52647,8 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject = function(includeInstance, msg) { var f, obj = { tokenId: msg.getTokenId_asB64(), - price: (f = msg.getPrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(includeInstance, f) + fixedPrice: jspb.Message.getFieldWithDefault(msg, 2, 0), + variablePrice: (f = msg.getVariablePrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(includeInstance, f) }; if (includeInstance) { @@ -53296,9 +52690,13 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir msg.setTokenId(value); break; case 2: - var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader); - msg.setPrice(value); + var value = /** @type {number} */ (reader.readUint64()); + msg.setFixedPrice(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader); + msg.setVariablePrice(value); break; default: reader.skipField(); @@ -53336,12 +52734,19 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir f ); } - f = message.getPrice(); + f = /** @type {number} */ (jspb.Message.getField(message, 2)); if (f != null) { - writer.writeMessage( + writer.writeUint64( 2, + f + ); + } + f = message.getVariablePrice(); + if (f != null) { + writer.writeMessage( + 3, f, - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter ); } }; @@ -53390,21 +52795,57 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir /** - * optional Price price = 2; - * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} + * optional uint64 fixed_price = 2; + * @return {number} */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getPrice = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price, 2)); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getFixedPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price|undefined} value + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setFixedPrice = function(value) { + return jspb.Message.setOneofField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.clearFixedPrice = function() { + return jspb.Message.setOneofField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.hasFixedPrice = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional PricingSchedule variable_price = 3; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getVariablePrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule|undefined} value * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setPrice = function(value) { - return jspb.Message.setWrapperField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setVariablePrice = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_[0], value); }; @@ -53412,8 +52853,8 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir * Clears the message field making it undefined. * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.clearPrice = function() { - return this.setPrice(undefined); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.clearVariablePrice = function() { + return this.setVariablePrice(undefined); }; @@ -53421,8 +52862,8 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.hasPrice = function() { - return jspb.Message.getField(this, 2) != null; +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.hasVariablePrice = function() { + return jspb.Message.getField(this, 3) != null; }; @@ -53735,6 +53176,392 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.h +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + tokenIdsList: msg.getTokenIdsList_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addTokenIds(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * repeated bytes token_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes token_ids = 1; + * This is a type-conversion wrapper around `getTokenIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getTokenIdsList())); +}; + + +/** + * repeated bytes token_ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getTokenIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setTokenIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.addTokenIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.clearTokenIdsList = function() { + return this.setTokenIdsList([]); +}; + + +/** + * optional bool prove = 2; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional GetTokenDirectPurchasePricesRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h index 1b5ef786e5f..45bc51184ea 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h @@ -186,7 +186,6 @@ CF_EXTERN_C_BEGIN @class GetStatusResponse_GetStatusResponseV0_Version_Software; @class GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0; @class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0; -@class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price; @class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity; @class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule; @class GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry; @@ -474,7 +473,8 @@ typedef GPB_ENUM(ResponseMetadata_FieldNumber) { }; /** - * ResponseMetadata provides metadata about the blockchain state at the time of response + * ResponseMetadata provides metadata about the blockchain state at the time of + * response **/ GPB_FINAL @interface ResponseMetadata : GPBMessage @@ -2422,10 +2422,10 @@ GPB_FINAL @interface GetIdentityByPublicKeyHashResponse_GetIdentityByPublicKeyHa @property(nonatomic, readonly) GetIdentityByPublicKeyHashResponse_GetIdentityByPublicKeyHashResponseV0_Result_OneOfCase resultOneOfCase; -/** The actual identity data corresponding to the requested public key hash */ +/** The actual identity data corresponding to the */ @property(nonatomic, readwrite, copy, null_resettable) NSData *identity; -/** Cryptographic proof for the identity data, if requested */ +/** requested public key hash */ @property(nonatomic, readwrite, strong, null_resettable) Proof *proof; /** Metadata about the blockchain state */ @@ -2622,7 +2622,7 @@ GPB_FINAL @interface GetConsensusParamsResponse_ConsensusParamsBlock : GPBMessag /** The maximum gas allowed in a block */ @property(nonatomic, readwrite, copy, null_resettable) NSString *maxGas; -/** The minimum time increment between consecutive blocks, in milliseconds */ +/** The minimum time increment between consecutive */ @property(nonatomic, readwrite, copy, null_resettable) NSString *timeIotaMs; @end @@ -2751,7 +2751,7 @@ GPB_FINAL @interface GetProtocolVersionUpgradeStateResponse_GetProtocolVersionUp /** The actual protocol version information */ @property(nonatomic, readwrite, strong, null_resettable) GetProtocolVersionUpgradeStateResponse_GetProtocolVersionUpgradeStateResponseV0_Versions *versions; -/** Cryptographic proof of the protocol version information, if requested */ +/** Cryptographic proof of the protocol version */ @property(nonatomic, readwrite, strong, null_resettable) Proof *proof; /** Metadata about the blockchain state */ @@ -2838,10 +2838,10 @@ typedef GPB_ENUM(GetProtocolVersionUpgradeVoteStatusRequest_GetProtocolVersionUp GPB_FINAL @interface GetProtocolVersionUpgradeVoteStatusRequest_GetProtocolVersionUpgradeVoteStatusRequestV0 : GPBMessage -/** The starting masternode provider transaction hash to filter the votes by */ +/** The starting masternode provider transaction */ @property(nonatomic, readwrite, copy, null_resettable) NSData *startProTxHash; -/** The number of vote entries to retrieve */ +/** hash to filter the votes by */ @property(nonatomic, readwrite) uint32_t count; /** Flag to request a proof as the response */ @@ -2894,7 +2894,7 @@ GPB_FINAL @interface GetProtocolVersionUpgradeVoteStatusResponse_GetProtocolVers /** The actual version signal information */ @property(nonatomic, readwrite, strong, null_resettable) GetProtocolVersionUpgradeVoteStatusResponse_GetProtocolVersionUpgradeVoteStatusResponseV0_VersionSignals *versions; -/** Cryptographic proof of the version signal information, if requested */ +/** Cryptographic proof of the version signal information, */ @property(nonatomic, readwrite, strong, null_resettable) Proof *proof; /** Metadata about the blockchain state */ @@ -2939,10 +2939,10 @@ typedef GPB_ENUM(GetProtocolVersionUpgradeVoteStatusResponse_GetProtocolVersionU **/ GPB_FINAL @interface GetProtocolVersionUpgradeVoteStatusResponse_GetProtocolVersionUpgradeVoteStatusResponseV0_VersionSignal : GPBMessage -/** The masternode provider transaction hash associated with the vote */ +/** The masternode provider transaction hash */ @property(nonatomic, readwrite, copy, null_resettable) NSData *proTxHash; -/** The protocol version number that is being voted on */ +/** associated with the vote */ @property(nonatomic, readwrite) uint32_t version; @end @@ -5495,47 +5495,6 @@ GPB_FINAL @interface GetTokenStatusesResponse_GetTokenStatusesResponseV0_TokenSt @end -#pragma mark - GetTokenDirectPurchasePricesRequest - -typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_FieldNumber) { - GetTokenDirectPurchasePricesRequest_FieldNumber_V0 = 1, -}; - -typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_Version_OneOfCase) { - GetTokenDirectPurchasePricesRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, - GetTokenDirectPurchasePricesRequest_Version_OneOfCase_V0 = 1, -}; - -GPB_FINAL @interface GetTokenDirectPurchasePricesRequest : GPBMessage - -@property(nonatomic, readonly) GetTokenDirectPurchasePricesRequest_Version_OneOfCase versionOneOfCase; - -@property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 *v0; - -@end - -/** - * Clears whatever value was set for the oneof 'version'. - **/ -void GetTokenDirectPurchasePricesRequest_ClearVersionOneOfCase(GetTokenDirectPurchasePricesRequest *message); - -#pragma mark - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 - -typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber) { - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_TokenIdsArray = 1, - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_Prove = 2, -}; - -GPB_FINAL @interface GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 : GPBMessage - -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenIdsArray; -/** The number of items in @c tokenIdsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger tokenIdsArray_Count; - -@property(nonatomic, readwrite) BOOL prove; - -@end - #pragma mark - GetTokenDirectPurchasePricesResponse typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_FieldNumber) { @@ -5622,22 +5581,26 @@ GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchase @end -#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry -typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber) { - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber_FixedPrice = 1, - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber_VariablePrice = 2, +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_TokenId = 1, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_FixedPrice = 2, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_VariablePrice = 3, }; -typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase) { - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase_GPBUnsetOneOfCase = 0, - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase_FixedPrice = 1, - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase_VariablePrice = 2, +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_Price_OneOfCase) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_Price_OneOfCase_GPBUnsetOneOfCase = 0, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_Price_OneOfCase_FixedPrice = 2, + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_Price_OneOfCase_VariablePrice = 3, }; -GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price : GPBMessage +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *tokenId; -@property(nonatomic, readonly) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_Price_OneOfCase priceOneOfCase; +/** Price of the token; optional */ +@property(nonatomic, readonly) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_Price_OneOfCase priceOneOfCase; @property(nonatomic, readwrite) uint64_t fixedPrice; @@ -5648,36 +5611,60 @@ GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchase /** * Clears whatever value was set for the oneof 'price'. **/ -void GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_ClearPriceOneOfCase(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price *message); +void GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_ClearPriceOneOfCase(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry *message); -#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices -typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber) { - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_TokenId = 1, - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_Price = 2, +typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber) { + GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber_TokenDirectPurchasePriceArray = 1, }; -GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry : GPBMessage +GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices : GPBMessage -@property(nonatomic, readwrite, copy, null_resettable) NSData *tokenId; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenDirectPurchasePriceArray; +/** The number of items in @c tokenDirectPurchasePriceArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger tokenDirectPurchasePriceArray_Count; + +@end + +#pragma mark - GetTokenDirectPurchasePricesRequest -@property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price *price; -/** Test to see if @c price has been set. */ -@property(nonatomic, readwrite) BOOL hasPrice; +typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_FieldNumber) { + GetTokenDirectPurchasePricesRequest_FieldNumber_V0 = 1, +}; + +typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_Version_OneOfCase) { + GetTokenDirectPurchasePricesRequest_Version_OneOfCase_GPBUnsetOneOfCase = 0, + GetTokenDirectPurchasePricesRequest_Version_OneOfCase_V0 = 1, +}; + +GPB_FINAL @interface GetTokenDirectPurchasePricesRequest : GPBMessage + +@property(nonatomic, readonly) GetTokenDirectPurchasePricesRequest_Version_OneOfCase versionOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 *v0; @end -#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices +/** + * Clears whatever value was set for the oneof 'version'. + **/ +void GetTokenDirectPurchasePricesRequest_ClearVersionOneOfCase(GetTokenDirectPurchasePricesRequest *message); -typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber) { - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber_TokenDirectPurchasePriceArray = 1, +#pragma mark - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 + +typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber) { + GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_TokenIdsArray = 1, + GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_Prove = 2, }; -GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices : GPBMessage +GPB_FINAL @interface GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 : GPBMessage -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenDirectPurchasePriceArray; -/** The number of items in @c tokenDirectPurchasePriceArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger tokenDirectPurchasePriceArray_Count; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenIdsArray; +/** The number of items in @c tokenIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger tokenIdsArray_Count; + +@property(nonatomic, readwrite) BOOL prove; @end diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m index 383d0f0d1be..e16a37c2eab 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m @@ -257,7 +257,6 @@ GPBObjCClassDeclaration(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0); GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse); GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0); -GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price); GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity); GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule); GPBObjCClassDeclaration(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry); @@ -14111,119 +14110,6 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetTokenDirectPurchasePricesRequest - -@implementation GetTokenDirectPurchasePricesRequest - -@dynamic versionOneOfCase; -@dynamic v0; - -typedef struct GetTokenDirectPurchasePricesRequest__storage_ { - uint32_t _has_storage_[2]; - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 *v0; -} GetTokenDirectPurchasePricesRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "v0", - .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0), - .number = GetTokenDirectPurchasePricesRequest_FieldNumber_V0, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesRequest__storage_, v0), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesRequest class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetTokenDirectPurchasePricesRequest__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - static const char *oneofs[] = { - "version", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GetTokenDirectPurchasePricesRequest_ClearVersionOneOfCase(GetTokenDirectPurchasePricesRequest *message) { - GPBDescriptor *descriptor = [GetTokenDirectPurchasePricesRequest descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBClearOneof(message, oneof); -} -#pragma mark - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 - -@implementation GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 - -@dynamic tokenIdsArray, tokenIdsArray_Count; -@dynamic prove; - -typedef struct GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *tokenIdsArray; -} GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "tokenIdsArray", - .dataTypeSpecific.clazz = Nil, - .number = GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_TokenIdsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_, tokenIdsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeBytes, - }, - { - .name = "prove", - .dataTypeSpecific.clazz = Nil, - .number = GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_Prove, - .hasIndex = 0, - .offset = 1, // Stored in _has_storage_ to save space. - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBool, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 class] - rootClass:[PlatformRoot class] - file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesRequest)]; - #if defined(DEBUG) && DEBUG - NSAssert(descriptor == nil, @"Startup recursed!"); - #endif // DEBUG - descriptor = localDescriptor; - } - return descriptor; -} - -@end - #pragma mark - GetTokenDirectPurchasePricesResponse @implementation GetTokenDirectPurchasePricesResponse @@ -14464,19 +14350,21 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry -@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price +@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry @dynamic priceOneOfCase; +@dynamic tokenId; @dynamic fixedPrice; @dynamic variablePrice; -typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_ { +typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_ { uint32_t _has_storage_[2]; + NSData *tokenId; GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule *variablePrice; uint64_t fixedPrice; -} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_; +} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -14484,32 +14372,41 @@ + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { static GPBMessageFieldDescription fields[] = { + { + .name = "tokenId", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_TokenId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_, tokenId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, { .name = "fixedPrice", .dataTypeSpecific.clazz = Nil, - .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber_FixedPrice, + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_FixedPrice, .hasIndex = -1, - .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_, fixedPrice), + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_, fixedPrice), .flags = GPBFieldOptional, .dataType = GPBDataTypeUInt64, }, { .name = "variablePrice", .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule), - .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_FieldNumber_VariablePrice, + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_VariablePrice, .hasIndex = -1, - .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_, variablePrice), + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_, variablePrice), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price class] + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price__storage_) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; static const char *oneofs[] = { "price", @@ -14528,23 +14425,21 @@ + (GPBDescriptor *)descriptor { @end -void GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price_ClearPriceOneOfCase(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price *message) { - GPBDescriptor *descriptor = [GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price descriptor]; +void GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_ClearPriceOneOfCase(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry *message) { + GPBDescriptor *descriptor = [GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry descriptor]; GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; GPBClearOneof(message, oneof); } -#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry +#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices -@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry +@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices -@dynamic tokenId; -@dynamic hasPrice, price; +@dynamic tokenDirectPurchasePriceArray, tokenDirectPurchasePriceArray_Count; -typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_ { +typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_ { uint32_t _has_storage_[1]; - NSData *tokenId; - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price *price; -} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_; + NSMutableArray *tokenDirectPurchasePriceArray; +} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -14553,33 +14448,76 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "tokenId", - .dataTypeSpecific.clazz = Nil, - .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_TokenId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_, tokenId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, + .name = "tokenDirectPurchasePriceArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry), + .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber_TokenDirectPurchasePriceArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_, tokenDirectPurchasePriceArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetTokenDirectPurchasePricesRequest + +@implementation GetTokenDirectPurchasePricesRequest + +@dynamic versionOneOfCase; +@dynamic v0; + +typedef struct GetTokenDirectPurchasePricesRequest__storage_ { + uint32_t _has_storage_[2]; + GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 *v0; +} GetTokenDirectPurchasePricesRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { { - .name = "price", - .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Price), - .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_FieldNumber_Price, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_, price), + .name = "v0", + .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0), + .number = GetTokenDirectPurchasePricesRequest_FieldNumber_V0, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesRequest__storage_, v0), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry class] + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesRequest class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry__storage_) + storageSize:sizeof(GetTokenDirectPurchasePricesRequest__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0)]; + static const char *oneofs[] = { + "version", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG @@ -14590,16 +14528,22 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices +void GetTokenDirectPurchasePricesRequest_ClearVersionOneOfCase(GetTokenDirectPurchasePricesRequest *message) { + GPBDescriptor *descriptor = [GetTokenDirectPurchasePricesRequest descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 -@implementation GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices +@implementation GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 -@dynamic tokenDirectPurchasePriceArray, tokenDirectPurchasePriceArray_Count; +@dynamic tokenIdsArray, tokenIdsArray_Count; +@dynamic prove; -typedef struct GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_ { +typedef struct GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_ { uint32_t _has_storage_[1]; - NSMutableArray *tokenDirectPurchasePriceArray; -} GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_; + NSMutableArray *tokenIdsArray; +} GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -14608,24 +14552,33 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "tokenDirectPurchasePriceArray", - .dataTypeSpecific.clazz = GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry), - .number = GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber_TokenDirectPurchasePriceArray, + .name = "tokenIdsArray", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_TokenIdsArray, .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_, tokenDirectPurchasePriceArray), + .offset = (uint32_t)offsetof(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_, tokenIdsArray), .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, + .dataType = GPBDataTypeBytes, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0_FieldNumber_Prove, + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices class] + [GPBDescriptor allocDescriptorForClass:[GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices__storage_) + storageSize:sizeof(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; - [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetTokenDirectPurchasePricesRequest)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py index 1de9b28f356..621f5325cd0 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py @@ -23,7 +23,7 @@ syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x98\x01\n\x10ResponseMetadata\x12\x12\n\x06height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x13\n\x07time_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbc\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb6\x01\n\x1aGetIdentityNonceResponseV0\x12\x1c\n\x0eidentity_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xe5\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc7\x01\n\"GetIdentityContractNonceResponseV0\x12%\n\x17identity_contract_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbd\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xb1\x01\n\x1cGetIdentityBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb1\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\x84\x03\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x12\x42\x61lanceAndRevision\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x08revision\x18\x02 \x01(\x04\x42\x02\x30\x01\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x92\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xe2\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x8a\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aL\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x18\n\x07\x62\x61lance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc5\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xb0\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xb2\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x9a\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a;\n\x18\x44\x61taContractHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xed\x01\n!GetIdentityByPublicKeyHashRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0H\x00\x1aM\n#GetIdentityByPublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xda\x02\n\"GetIdentityByPublicKeyHashResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0H\x00\x1a\xb6\x01\n$GetIdentityByPublicKeyHashResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x99\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x9c\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\xa6\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1e\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x16\n\nstart_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xde\x04\n\x1cGetContestedResourcesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0H\x00\x1a\xcc\x03\n\x1eGetContestedResourcesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x1a\n\x12start_index_values\x18\x04 \x03(\x0c\x12\x18\n\x10\x65nd_index_values\x18\x05 \x03(\x0c\x12\x89\x01\n\x13start_at_value_info\x18\x06 \x01(\x0b\x32g.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1a\x45\n\x10StartAtValueInfo\x12\x13\n\x0bstart_value\x18\x01 \x01(\x0c\x12\x1c\n\x14start_value_included\x18\x02 \x01(\x08\x42\x16\n\x14_start_at_value_infoB\x08\n\x06_countB\t\n\x07version\"\x88\x04\n\x1dGetContestedResourcesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0H\x00\x1a\xf3\x02\n\x1fGetContestedResourcesResponseV0\x12\x95\x01\n\x19\x63ontested_resource_values\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValuesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a<\n\x17\x43ontestedResourceValues\x12!\n\x19\x63ontested_resource_values\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x05\n\x1cGetVotePollsByEndDateRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0H\x00\x1a\xc0\x04\n\x1eGetVotePollsByEndDateRequestV0\x12\x84\x01\n\x0fstart_time_info\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfoH\x00\x88\x01\x01\x12\x80\x01\n\rend_time_info\x18\x02 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfoH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x13\n\x06offset\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x11\n\tascending\x18\x05 \x01(\x08\x12\r\n\x05prove\x18\x06 \x01(\x08\x1aI\n\x0fStartAtTimeInfo\x12\x19\n\rstart_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13start_time_included\x18\x02 \x01(\x08\x1a\x43\n\rEndAtTimeInfo\x12\x17\n\x0b\x65nd_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x65nd_time_included\x18\x02 \x01(\x08\x42\x12\n\x10_start_time_infoB\x10\n\x0e_end_time_infoB\x08\n\x06_limitB\t\n\x07_offsetB\t\n\x07version\"\x83\x06\n\x1dGetVotePollsByEndDateResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0H\x00\x1a\xee\x04\n\x1fGetVotePollsByEndDateResponseV0\x12\x9c\x01\n\x18vote_polls_by_timestamps\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestampsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aV\n\x1eSerializedVotePollsByTimestamp\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x15serialized_vote_polls\x18\x02 \x03(\x0c\x1a\xd7\x01\n\x1fSerializedVotePollsByTimestamps\x12\x99\x01\n\x18vote_polls_by_timestamps\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xff\x06\n$GetContestedResourceVoteStateRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0H\x00\x1a\xd5\x05\n&GetContestedResourceVoteStateRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x86\x01\n\x0bresult_type\x18\x05 \x01(\x0e\x32q.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType\x12\x36\n.allow_include_locked_and_abstaining_vote_tally\x18\x06 \x01(\x08\x12\xa3\x01\n\x18start_at_identifier_info\x18\x07 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x08 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\"I\n\nResultType\x12\r\n\tDOCUMENTS\x10\x00\x12\x0e\n\nVOTE_TALLY\x10\x01\x12\x1c\n\x18\x44OCUMENTS_AND_VOTE_TALLY\x10\x02\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\x94\x0c\n%GetContestedResourceVoteStateResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0H\x00\x1a\xe7\n\n\'GetContestedResourceVoteStateResponseV0\x12\xae\x01\n\x1d\x63ontested_resource_contenders\x18\x01 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContendersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xda\x03\n\x10\x46inishedVoteInfo\x12\xad\x01\n\x15\x66inished_vote_outcome\x18\x01 \x01(\x0e\x32\x8d\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome\x12\x1f\n\x12won_by_identity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12$\n\x18\x66inished_at_block_height\x18\x03 \x01(\x04\x42\x02\x30\x01\x12%\n\x1d\x66inished_at_core_block_height\x18\x04 \x01(\r\x12%\n\x19\x66inished_at_block_time_ms\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x66inished_at_epoch\x18\x06 \x01(\r\"O\n\x13\x46inishedVoteOutcome\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x16\n\x12NO_PREVIOUS_WINNER\x10\x02\x42\x15\n\x13_won_by_identity_id\x1a\xc4\x03\n\x1b\x43ontestedResourceContenders\x12\x86\x01\n\ncontenders\x18\x01 \x03(\x0b\x32r.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender\x12\x1f\n\x12\x61\x62stain_vote_tally\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1c\n\x0flock_vote_tally\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x9a\x01\n\x12\x66inished_vote_info\x18\x04 \x01(\x0b\x32y.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfoH\x02\x88\x01\x01\x42\x15\n\x13_abstain_vote_tallyB\x12\n\x10_lock_vote_tallyB\x15\n\x13_finished_vote_info\x1ak\n\tContender\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x17\n\nvote_count\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08\x64ocument\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\r\n\x0b_vote_countB\x0b\n\t_documentB\x08\n\x06resultB\t\n\x07version\"\xd5\x05\n,GetContestedResourceVotersForIdentityRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0H\x00\x1a\x92\x04\n.GetContestedResourceVotersForIdentityRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x15\n\rcontestant_id\x18\x05 \x01(\x0c\x12\xb4\x01\n\x18start_at_identifier_info\x18\x06 \x01(\x0b\x32\x8c\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\xf1\x04\n-GetContestedResourceVotersForIdentityResponse\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0H\x00\x1a\xab\x03\n/GetContestedResourceVotersForIdentityResponseV0\x12\xb6\x01\n\x19\x63ontested_resource_voters\x18\x01 \x01(\x0b\x32\x90\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVotersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x43\n\x17\x43ontestedResourceVoters\x12\x0e\n\x06voters\x18\x01 \x03(\x0c\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xad\x05\n(GetContestedResourceIdentityVotesRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0H\x00\x1a\xf7\x03\n*GetContestedResourceIdentityVotesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0forder_ascending\x18\x04 \x01(\x08\x12\xae\x01\n\x1astart_at_vote_poll_id_info\x18\x05 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfoH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x61\n\x15StartAtVotePollIdInfo\x12 \n\x18start_at_poll_identifier\x18\x01 \x01(\x0c\x12&\n\x1estart_poll_identifier_included\x18\x02 \x01(\x08\x42\x1d\n\x1b_start_at_vote_poll_id_infoB\t\n\x07version\"\xc8\n\n)GetContestedResourceIdentityVotesResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0H\x00\x1a\x8f\t\n+GetContestedResourceIdentityVotesResponseV0\x12\xa1\x01\n\x05votes\x18\x01 \x01(\x0b\x32\x8f\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xf7\x01\n\x1e\x43ontestedResourceIdentityVotes\x12\xba\x01\n!contested_resource_identity_votes\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x1a\xad\x02\n\x12ResourceVoteChoice\x12\xad\x01\n\x10vote_choice_type\x18\x01 \x01(\x0e\x32\x92\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType\x12\x18\n\x0bidentity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\"=\n\x0eVoteChoiceType\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\x0b\n\x07\x41\x42STAIN\x10\x01\x12\x08\n\x04LOCK\x10\x02\x42\x0e\n\x0c_identity_id\x1a\x95\x02\n\x1d\x43ontestedResourceIdentityVote\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\'\n\x1fserialized_index_storage_values\x18\x03 \x03(\x0c\x12\x99\x01\n\x0bvote_choice\x18\x04 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoiceB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n%GetPrefundedSpecializedBalanceRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0H\x00\x1a\x44\n\'GetPrefundedSpecializedBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xed\x02\n&GetPrefundedSpecializedBalanceResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0H\x00\x1a\xbd\x01\n(GetPrefundedSpecializedBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xd0\x01\n GetTotalCreditsInPlatformRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0H\x00\x1a\x33\n\"GetTotalCreditsInPlatformRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xd9\x02\n!GetTotalCreditsInPlatformResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0H\x00\x1a\xb8\x01\n#GetTotalCreditsInPlatformResponseV0\x12\x15\n\x07\x63redits\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x16GetPathElementsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0H\x00\x1a\x45\n\x18GetPathElementsRequestV0\x12\x0c\n\x04path\x18\x01 \x03(\x0c\x12\x0c\n\x04keys\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xa3\x03\n\x17GetPathElementsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0H\x00\x1a\xa0\x02\n\x19GetPathElementsResponseV0\x12i\n\x08\x65lements\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ElementsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1c\n\x08\x45lements\x12\x10\n\x08\x65lements\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\x81\x01\n\x10GetStatusRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0H\x00\x1a\x14\n\x12GetStatusRequestV0B\t\n\x07version\"\xd0\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xdf\x0f\n\x13GetStatusResponseV0\x12Y\n\x07version\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version\x12S\n\x04node\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node\x12U\n\x05\x63hain\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain\x12Y\n\x07network\x18\x04 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network\x12^\n\nstate_sync\x18\x05 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync\x12S\n\x04time\x18\x06 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time\x1a\xee\x04\n\x07Version\x12\x63\n\x08software\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software\x12\x63\n\x08protocol\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol\x1a^\n\x08Software\x12\x0c\n\x04\x64\x61pi\x18\x01 \x01(\t\x12\x12\n\x05\x64rive\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntenderdash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_driveB\r\n\x0b_tenderdash\x1a\xb8\x02\n\x08Protocol\x12p\n\ntenderdash\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash\x12\x66\n\x05\x64rive\x18\x02 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive\x1a(\n\nTenderdash\x12\x0b\n\x03p2p\x18\x01 \x01(\r\x12\r\n\x05\x62lock\x18\x02 \x01(\r\x1a(\n\x05\x44rive\x12\x0e\n\x06latest\x18\x03 \x01(\r\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\r\x1a\x7f\n\x04Time\x12\x11\n\x05local\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x05\x62lock\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x18\n\x07genesis\x18\x03 \x01(\x04\x42\x02\x30\x01H\x01\x88\x01\x01\x12\x12\n\x05\x65poch\x18\x04 \x01(\rH\x02\x88\x01\x01\x42\x08\n\x06_blockB\n\n\x08_genesisB\x08\n\x06_epoch\x1a<\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x0bpro_tx_hash\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_pro_tx_hash\x1a\xb3\x02\n\x05\x43hain\x12\x13\n\x0b\x63\x61tching_up\x18\x01 \x01(\x08\x12\x19\n\x11latest_block_hash\x18\x02 \x01(\x0c\x12\x17\n\x0flatest_app_hash\x18\x03 \x01(\x0c\x12\x1f\n\x13latest_block_height\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13\x65\x61rliest_block_hash\x18\x05 \x01(\x0c\x12\x19\n\x11\x65\x61rliest_app_hash\x18\x06 \x01(\x0c\x12!\n\x15\x65\x61rliest_block_height\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15max_peer_block_height\x18\t \x01(\x04\x42\x02\x30\x01\x12%\n\x18\x63ore_chain_locked_height\x18\n \x01(\rH\x00\x88\x01\x01\x42\x1b\n\x19_core_chain_locked_height\x1a\x43\n\x07Network\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\t\x12\x13\n\x0bpeers_count\x18\x02 \x01(\r\x12\x11\n\tlistening\x18\x03 \x01(\x08\x1a\x85\x02\n\tStateSync\x12\x1d\n\x11total_synced_time\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eremaining_time\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0ftotal_snapshots\x18\x03 \x01(\r\x12\"\n\x16\x63hunk_process_avg_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x0fsnapshot_height\x18\x05 \x01(\x04\x42\x02\x30\x01\x12!\n\x15snapshot_chunks_count\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x11\x62\x61\x63kfilled_blocks\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15\x62\x61\x63kfill_blocks_total\x18\x08 \x01(\x04\x42\x02\x30\x01\x42\t\n\x07version\"\xb1\x01\n\x1cGetCurrentQuorumsInfoRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0H\x00\x1a \n\x1eGetCurrentQuorumsInfoRequestV0B\t\n\x07version\"\xa1\x05\n\x1dGetCurrentQuorumsInfoResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0H\x00\x1a\x46\n\x0bValidatorV0\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07node_ip\x18\x02 \x01(\t\x12\x11\n\tis_banned\x18\x03 \x01(\x08\x1a\xaf\x01\n\x0eValidatorSetV0\x12\x13\n\x0bquorum_hash\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ore_height\x18\x02 \x01(\r\x12U\n\x07members\x18\x03 \x03(\x0b\x32\x44.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0\x12\x1c\n\x14threshold_public_key\x18\x04 \x01(\x0c\x1a\x92\x02\n\x1fGetCurrentQuorumsInfoResponseV0\x12\x15\n\rquorum_hashes\x18\x01 \x03(\x0c\x12\x1b\n\x13\x63urrent_quorum_hash\x18\x02 \x01(\x0c\x12_\n\x0evalidator_sets\x18\x03 \x03(\x0b\x32G.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0\x12\x1b\n\x13last_block_proposer\x18\x04 \x01(\x0c\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version\"\xf4\x01\n\x1fGetIdentityTokenBalancesRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0H\x00\x1aZ\n!GetIdentityTokenBalancesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xad\x05\n GetIdentityTokenBalancesResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0H\x00\x1a\x8f\x04\n\"GetIdentityTokenBalancesResponseV0\x12\x86\x01\n\x0etoken_balances\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aG\n\x11TokenBalanceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x9a\x01\n\rTokenBalances\x12\x88\x01\n\x0etoken_balances\x18\x01 \x03(\x0b\x32p.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xfc\x01\n!GetIdentitiesTokenBalancesRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0H\x00\x1a\\\n#GetIdentitiesTokenBalancesRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xf2\x05\n\"GetIdentitiesTokenBalancesResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0H\x00\x1a\xce\x04\n$GetIdentitiesTokenBalancesResponseV0\x12\x9b\x01\n\x17identity_token_balances\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aR\n\x19IdentityTokenBalanceEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\xb7\x01\n\x15IdentityTokenBalances\x12\x9d\x01\n\x17identity_token_balances\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xe8\x01\n\x1cGetIdentityTokenInfosRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0H\x00\x1aW\n\x1eGetIdentityTokenInfosRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x98\x06\n\x1dGetIdentityTokenInfosResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0H\x00\x1a\x83\x05\n\x1fGetIdentityTokenInfosResponseV0\x12z\n\x0btoken_infos\x18\x01 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb0\x01\n\x0eTokenInfoEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x82\x01\n\x04info\x18\x02 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x8a\x01\n\nTokenInfos\x12|\n\x0btoken_infos\x18\x01 \x03(\x0b\x32g.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n\x1eGetIdentitiesTokenInfosRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0H\x00\x1aY\n GetIdentitiesTokenInfosRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xca\x06\n\x1fGetIdentitiesTokenInfosResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0H\x00\x1a\xaf\x05\n!GetIdentitiesTokenInfosResponseV0\x12\x8f\x01\n\x14identity_token_infos\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb7\x01\n\x0eTokenInfoEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x86\x01\n\x04info\x18\x02 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x97\x01\n\x12IdentityTokenInfos\x12\x80\x01\n\x0btoken_infos\x18\x01 \x03(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbf\x01\n\x17GetTokenStatusesRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0H\x00\x1a=\n\x19GetTokenStatusesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xe7\x04\n\x18GetTokenStatusesResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0H\x00\x1a\xe1\x03\n\x1aGetTokenStatusesResponseV0\x12v\n\x0etoken_statuses\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x44\n\x10TokenStatusEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x06paused\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_paused\x1a\x88\x01\n\rTokenStatuses\x12w\n\x0etoken_statuses\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntryB\x08\n\x06resultB\t\n\x07version\"\xef\x01\n#GetTokenDirectPurchasePricesRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0H\x00\x1aI\n%GetTokenDirectPurchasePricesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xa2\n\n$GetTokenDirectPurchasePricesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0H\x00\x1a\xf8\x08\n&GetTokenDirectPurchasePricesResponseV0\x12\xa9\x01\n\x1ctoken_direct_purchase_prices\x18\x01 \x01(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePricesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xa7\x01\n\x0fPricingSchedule\x12\x93\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity\x1a\xba\x01\n\x05Price\x12\x15\n\x0b\x66ixed_price\x18\x01 \x01(\x04H\x00\x12\x90\x01\n\x0evariable_price\x18\x02 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingScheduleH\x00\x42\x07\n\x05price\x1a\xbe\x01\n\x1dTokenDirectPurchasePriceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x80\x01\n\x05price\x18\x02 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceH\x00\x88\x01\x01\x42\x08\n\x06_price\x1a\xc8\x01\n\x19TokenDirectPurchasePrices\x12\xaa\x01\n\x1btoken_direct_purchase_price\x18\x01 \x03(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntryB\x08\n\x06resultB\t\n\x07version\"\xef\x04\n)GetTokenPreProgrammedDistributionsRequest\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0H\x00\x1a\xb6\x03\n+GetTokenPreProgrammedDistributionsRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x98\x01\n\rstart_at_info\x18\x02 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfoH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x1a\x9a\x01\n\x0bStartAtInfo\x12\x15\n\rstart_time_ms\x18\x01 \x01(\x04\x12\x1c\n\x0fstart_recipient\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12%\n\x18start_recipient_included\x18\x03 \x01(\x08H\x01\x88\x01\x01\x42\x12\n\x10_start_recipientB\x1b\n\x19_start_recipient_includedB\x10\n\x0e_start_at_infoB\x08\n\x06_limitB\t\n\x07version\"\xec\x07\n*GetTokenPreProgrammedDistributionsResponse\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0H\x00\x1a\xaf\x06\n,GetTokenPreProgrammedDistributionsResponseV0\x12\xa5\x01\n\x13token_distributions\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a>\n\x16TokenDistributionEntry\x12\x14\n\x0crecipient_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x1a\xd4\x01\n\x1bTokenTimedDistributionEntry\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\xa1\x01\n\rdistributions\x18\x02 \x03(\x0b\x32\x89\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry\x1a\xc3\x01\n\x12TokenDistributions\x12\xac\x01\n\x13token_distributions\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntryB\x08\n\x06resultB\t\n\x07version\"\xca\x01\n\x1aGetTokenTotalSupplyRequest\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0H\x00\x1a?\n\x1cGetTokenTotalSupplyRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xaf\x04\n\x1bGetTokenTotalSupplyResponse\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0H\x00\x1a\xa0\x03\n\x1dGetTokenTotalSupplyResponseV0\x12\x88\x01\n\x12token_total_supply\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1ax\n\x15TokenTotalSupplyEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x30\n(total_aggregated_amount_in_user_accounts\x18\x02 \x01(\x04\x12\x1b\n\x13total_system_amount\x18\x03 \x01(\x04\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x01\n\x13GetGroupInfoRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0H\x00\x1a\\\n\x15GetGroupInfoRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xd4\x05\n\x14GetGroupInfoResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0H\x00\x1a\xda\x04\n\x16GetGroupInfoResponseV0\x12\x66\n\ngroup_info\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x98\x01\n\x0eGroupInfoEntry\x12h\n\x07members\x18\x01 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x02 \x01(\r\x1a\x8a\x01\n\tGroupInfo\x12n\n\ngroup_info\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntryH\x00\x88\x01\x01\x42\r\n\x0b_group_infoB\x08\n\x06resultB\t\n\x07version\"\xed\x03\n\x14GetGroupInfosRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0H\x00\x1au\n\x1cStartAtGroupContractPosition\x12%\n\x1dstart_group_contract_position\x18\x01 \x01(\r\x12.\n&start_group_contract_position_included\x18\x02 \x01(\x08\x1a\xfc\x01\n\x16GetGroupInfosRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12{\n start_at_group_contract_position\x18\x02 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPositionH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x42#\n!_start_at_group_contract_positionB\x08\n\x06_countB\t\n\x07version\"\xff\x05\n\x15GetGroupInfosResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0H\x00\x1a\x82\x05\n\x17GetGroupInfosResponseV0\x12j\n\x0bgroup_infos\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\xc3\x01\n\x16GroupPositionInfoEntry\x12\x1f\n\x17group_contract_position\x18\x01 \x01(\r\x12j\n\x07members\x18\x02 \x03(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x03 \x01(\r\x1a\x82\x01\n\nGroupInfos\x12t\n\x0bgroup_infos\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbe\x04\n\x16GetGroupActionsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0H\x00\x1aL\n\x0fStartAtActionId\x12\x17\n\x0fstart_action_id\x18\x01 \x01(\x0c\x12 \n\x18start_action_id_included\x18\x02 \x01(\x08\x1a\xc8\x02\n\x18GetGroupActionsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12N\n\x06status\x18\x03 \x01(\x0e\x32>.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus\x12\x62\n\x12start_at_action_id\x18\x04 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionIdH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x42\x15\n\x13_start_at_action_idB\x08\n\x06_count\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\xc0\x1e\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\xbd\x1d\n\x19GetGroupActionsResponseV0\x12r\n\rgroup_actions\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a[\n\tMintEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x14\n\x0crecipient_id\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x45\n\tBurnEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aJ\n\x0b\x46reezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aL\n\rUnfreezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x66\n\x17\x44\x65stroyFrozenFundsEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x13SharedEncryptedNote\x12\x18\n\x10sender_key_index\x18\x01 \x01(\r\x12\x1b\n\x13recipient_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a{\n\x15PersonalEncryptedNote\x12!\n\x19root_encryption_key_index\x18\x01 \x01(\r\x12\'\n\x1f\x64\x65rivation_encryption_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a\xe9\x01\n\x14\x45mergencyActionEvent\x12\x81\x01\n\x0b\x61\x63tion_type\x18\x01 \x01(\x0e\x32l.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\"#\n\nActionType\x12\t\n\x05PAUSE\x10\x00\x12\n\n\x06RESUME\x10\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x16TokenConfigUpdateEvent\x12 \n\x18token_config_update_item\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\xe6\x03\n\x1eUpdateDirectPurchasePriceEvent\x12\x15\n\x0b\x66ixed_price\x18\x01 \x01(\x04H\x00\x12\x95\x01\n\x0evariable_price\x18\x02 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingScheduleH\x00\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x01\x88\x01\x01\x1a\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xac\x01\n\x0fPricingSchedule\x12\x98\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantityB\x07\n\x05priceB\x0e\n\x0c_public_note\x1a\xfc\x02\n\x10GroupActionEvent\x12n\n\x0btoken_event\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEventH\x00\x12t\n\x0e\x64ocument_event\x18\x02 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEventH\x00\x12t\n\x0e\x63ontract_event\x18\x03 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEventH\x00\x42\x0c\n\nevent_type\x1a\x8b\x01\n\rDocumentEvent\x12r\n\x06\x63reate\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEventH\x00\x42\x06\n\x04type\x1a/\n\x13\x44ocumentCreateEvent\x12\x18\n\x10\x63reated_document\x18\x01 \x01(\x0c\x1a/\n\x13\x43ontractUpdateEvent\x12\x18\n\x10updated_contract\x18\x01 \x01(\x0c\x1a\x8b\x01\n\rContractEvent\x12r\n\x06update\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEventH\x00\x42\x06\n\x04type\x1a\xd1\x07\n\nTokenEvent\x12\x66\n\x04mint\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEventH\x00\x12\x66\n\x04\x62urn\x18\x02 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEventH\x00\x12j\n\x06\x66reeze\x18\x03 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEventH\x00\x12n\n\x08unfreeze\x18\x04 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEventH\x00\x12\x84\x01\n\x14\x64\x65stroy_frozen_funds\x18\x05 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEventH\x00\x12}\n\x10\x65mergency_action\x18\x06 \x01(\x0b\x32\x61.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEventH\x00\x12\x82\x01\n\x13token_config_update\x18\x07 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEventH\x00\x12\x83\x01\n\x0cupdate_price\x18\x08 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEventH\x00\x42\x06\n\x04type\x1a\x93\x01\n\x10GroupActionEntry\x12\x11\n\taction_id\x18\x01 \x01(\x0c\x12l\n\x05\x65vent\x18\x02 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent\x1a\x84\x01\n\x0cGroupActions\x12t\n\rgroup_actions\x18\x01 \x03(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntryB\x08\n\x06resultB\t\n\x07version\"\x88\x03\n\x1cGetGroupActionSignersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0H\x00\x1a\xce\x01\n\x1eGetGroupActionSignersRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12T\n\x06status\x18\x03 \x01(\x0e\x32\x44.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus\x12\x11\n\taction_id\x18\x04 \x01(\x0c\x12\r\n\x05prove\x18\x05 \x01(\x08\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\x8b\x05\n\x1dGetGroupActionSignersResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0H\x00\x1a\xf6\x03\n\x1fGetGroupActionSignersResponseV0\x12\x8b\x01\n\x14group_action_signers\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x35\n\x11GroupActionSigner\x12\x11\n\tsigner_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x91\x01\n\x12GroupActionSigners\x12{\n\x07signers\x18\x01 \x03(\x0b\x32j.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignerB\x08\n\x06resultB\t\n\x07version*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\xd4\x30\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponse\x12\xa5\x01\n\x1egetProtocolVersionUpgradeState\x12@.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest\x1a\x41.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse\x12\xb4\x01\n#getProtocolVersionUpgradeVoteStatus\x12\x45.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest\x1a\x46.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse\x12r\n\rgetEpochsInfo\x12/.org.dash.platform.dapi.v0.GetEpochsInfoRequest\x1a\x30.org.dash.platform.dapi.v0.GetEpochsInfoResponse\x12\x8a\x01\n\x15getContestedResources\x12\x37.org.dash.platform.dapi.v0.GetContestedResourcesRequest\x1a\x38.org.dash.platform.dapi.v0.GetContestedResourcesResponse\x12\xa2\x01\n\x1dgetContestedResourceVoteState\x12?.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest\x1a@.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse\x12\xba\x01\n%getContestedResourceVotersForIdentity\x12G.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest\x1aH.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse\x12\xae\x01\n!getContestedResourceIdentityVotes\x12\x43.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest\x1a\x44.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse\x12\x8a\x01\n\x15getVotePollsByEndDate\x12\x37.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest\x1a\x38.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse\x12\xa5\x01\n\x1egetPrefundedSpecializedBalance\x12@.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest\x1a\x41.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse\x12\x96\x01\n\x19getTotalCreditsInPlatform\x12;.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest\x1a<.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse\x12x\n\x0fgetPathElements\x12\x31.org.dash.platform.dapi.v0.GetPathElementsRequest\x1a\x32.org.dash.platform.dapi.v0.GetPathElementsResponse\x12\x66\n\tgetStatus\x12+.org.dash.platform.dapi.v0.GetStatusRequest\x1a,.org.dash.platform.dapi.v0.GetStatusResponse\x12\x8a\x01\n\x15getCurrentQuorumsInfo\x12\x37.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest\x1a\x38.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse\x12\x93\x01\n\x18getIdentityTokenBalances\x12:.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse\x12\x99\x01\n\x1agetIdentitiesTokenBalances\x12<.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest\x1a=.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse\x12\x8a\x01\n\x15getIdentityTokenInfos\x12\x37.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse\x12\x90\x01\n\x17getIdentitiesTokenInfos\x12\x39.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest\x1a:.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse\x12{\n\x10getTokenStatuses\x12\x32.org.dash.platform.dapi.v0.GetTokenStatusesRequest\x1a\x33.org.dash.platform.dapi.v0.GetTokenStatusesResponse\x12\x9f\x01\n\x1cgetTokenDirectPurchasePrices\x12>.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest\x1a?.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse\x12\xb1\x01\n\"getTokenPreProgrammedDistributions\x12\x44.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest\x1a\x45.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse\x12\x84\x01\n\x13getTokenTotalSupply\x12\x35.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest\x1a\x36.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse\x12o\n\x0cgetGroupInfo\x12..org.dash.platform.dapi.v0.GetGroupInfoRequest\x1a/.org.dash.platform.dapi.v0.GetGroupInfoResponse\x12r\n\rgetGroupInfos\x12/.org.dash.platform.dapi.v0.GetGroupInfosRequest\x1a\x30.org.dash.platform.dapi.v0.GetGroupInfosResponse\x12x\n\x0fgetGroupActions\x12\x31.org.dash.platform.dapi.v0.GetGroupActionsRequest\x1a\x32.org.dash.platform.dapi.v0.GetGroupActionsResponse\x12\x8a\x01\n\x15getGroupActionSigners\x12\x37.org.dash.platform.dapi.v0.GetGroupActionSignersRequest\x1a\x38.org.dash.platform.dapi.v0.GetGroupActionSignersResponseb\x06proto3' + serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x81\x01\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\x12\x15\n\rblock_id_hash\x18\x05 \x01(\x0c\x12\x13\n\x0bquorum_type\x18\x06 \x01(\r\"\x98\x01\n\x10ResponseMetadata\x12\x12\n\x06height\x18\x01 \x01(\x04\x42\x02\x30\x01\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\r\n\x05\x65poch\x18\x03 \x01(\r\x12\x13\n\x07time_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x18\n\x10protocol_version\x18\x05 \x01(\r\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\t\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"\xa4\x01\n\x12GetIdentityRequest\x12P\n\x02v0\x18\x01 \x01(\x0b\x32\x42.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0H\x00\x1a\x31\n\x14GetIdentityRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xc1\x01\n\x17GetIdentityNonceRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0H\x00\x1a?\n\x19GetIdentityNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xf6\x01\n\x1fGetIdentityContractNonceRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0H\x00\x1a\\\n!GetIdentityContractNonceRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xc0\x01\n\x19GetIdentityBalanceRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0H\x00\x1a\x38\n\x1bGetIdentityBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xec\x01\n$GetIdentityBalanceAndRevisionRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0H\x00\x1a\x43\n&GetIdentityBalanceAndRevisionRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9e\x02\n\x13GetIdentityResponse\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0H\x00\x1a\xa7\x01\n\x15GetIdentityResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbc\x02\n\x18GetIdentityNonceResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0H\x00\x1a\xb6\x01\n\x1aGetIdentityNonceResponseV0\x12\x1c\n\x0eidentity_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xe5\x02\n GetIdentityContractNonceResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0H\x00\x1a\xc7\x01\n\"GetIdentityContractNonceResponseV0\x12%\n\x17identity_contract_nonce\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xbd\x02\n\x1aGetIdentityBalanceResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0H\x00\x1a\xb1\x01\n\x1cGetIdentityBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb1\x04\n%GetIdentityBalanceAndRevisionResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0H\x00\x1a\x84\x03\n\'GetIdentityBalanceAndRevisionResponseV0\x12\x9b\x01\n\x14\x62\x61lance_and_revision\x18\x01 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevisionH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x12\x42\x61lanceAndRevision\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x14\n\x08revision\x18\x02 \x01(\x04\x42\x02\x30\x01\x42\x08\n\x06resultB\t\n\x07version\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xda\x02\n\x16GetIdentityKeysRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0H\x00\x1a\xda\x01\n\x18GetIdentityKeysRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\x99\x03\n\x17GetIdentityKeysResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0H\x00\x1a\x96\x02\n\x19GetIdentityKeysResponseV0\x12\x61\n\x04keys\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xef\x02\n GetIdentitiesContractKeysRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0H\x00\x1a\xd1\x01\n\"GetIdentitiesContractKeysRequestV0\x12\x16\n\x0eidentities_ids\x18\x01 \x03(\x0c\x12\x13\n\x0b\x63ontract_id\x18\x02 \x01(\x0c\x12\x1f\n\x12\x64ocument_type_name\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x37\n\x08purposes\x18\x04 \x03(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x15\n\x13_document_type_nameB\t\n\x07version\"\xdf\x06\n!GetIdentitiesContractKeysResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0H\x00\x1a\xbe\x05\n#GetIdentitiesContractKeysResponseV0\x12\x8a\x01\n\x0fidentities_keys\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aY\n\x0bPurposeKeys\x12\x36\n\x07purpose\x18\x01 \x01(\x0e\x32%.org.dash.platform.dapi.v0.KeyPurpose\x12\x12\n\nkeys_bytes\x18\x02 \x03(\x0c\x1a\x9f\x01\n\x0cIdentityKeys\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12z\n\x04keys\x18\x02 \x03(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys\x1a\x90\x01\n\x0eIdentitiesKeys\x12~\n\x07\x65ntries\x18\x01 \x03(\x0b\x32m.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeysB\x08\n\x06resultB\t\n\x07version\"\xa4\x02\n*GetEvonodesProposedEpochBlocksByIdsRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0H\x00\x1ah\n,GetEvonodesProposedEpochBlocksByIdsRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\x08\n\x06_epochB\t\n\x07version\"\x92\x06\n&GetEvonodesProposedEpochBlocksResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0H\x00\x1a\xe2\x04\n(GetEvonodesProposedEpochBlocksResponseV0\x12\xb1\x01\n#evonodes_proposed_block_counts_info\x18\x01 \x01(\x0b\x32\x81\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocksH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a?\n\x15\x45vonodeProposedBlocks\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x11\n\x05\x63ount\x18\x02 \x01(\x04\x42\x02\x30\x01\x1a\xc4\x01\n\x16\x45vonodesProposedBlocks\x12\xa9\x01\n\x1e\x65vonodes_proposed_block_counts\x18\x01 \x03(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocksB\x08\n\x06resultB\t\n\x07version\"\xf2\x02\n,GetEvonodesProposedEpochBlocksByRangeRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0H\x00\x1a\xaf\x01\n.GetEvonodesProposedEpochBlocksByRangeRequestV0\x12\x12\n\x05\x65poch\x18\x01 \x01(\rH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x02 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x0bstart_after\x18\x03 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x04 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\x07\n\x05startB\x08\n\x06_epochB\x08\n\x06_limitB\t\n\x07version\"\xcd\x01\n\x1cGetIdentitiesBalancesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0H\x00\x1a<\n\x1eGetIdentitiesBalancesRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9f\x05\n\x1dGetIdentitiesBalancesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0H\x00\x1a\x8a\x04\n\x1fGetIdentitiesBalancesResponseV0\x12\x8a\x01\n\x13identities_balances\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aL\n\x0fIdentityBalance\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x18\n\x07\x62\x61lance\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x8f\x01\n\x12IdentitiesBalances\x12y\n\x07\x65ntries\x18\x01 \x03(\x0b\x32h.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalanceB\x08\n\x06resultB\t\n\x07version\"\xb4\x01\n\x16GetDataContractRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0H\x00\x1a\x35\n\x18GetDataContractRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xb3\x02\n\x17GetDataContractResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0H\x00\x1a\xb0\x01\n\x19GetDataContractResponseV0\x12\x17\n\rdata_contract\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xb9\x01\n\x17GetDataContractsRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0H\x00\x1a\x37\n\x19GetDataContractsRequestV0\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xcf\x04\n\x18GetDataContractsResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0H\x00\x1a[\n\x11\x44\x61taContractEntry\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x32\n\rdata_contract\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.BytesValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry\x1a\xf5\x01\n\x1aGetDataContractsResponseV0\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc5\x02\n\x1dGetDataContractHistoryRequest\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0H\x00\x1a\xb0\x01\n\x1fGetDataContractHistoryRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0bstart_at_ms\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05prove\x18\x05 \x01(\x08\x42\t\n\x07version\"\xb2\x05\n\x1eGetDataContractHistoryResponse\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0H\x00\x1a\x9a\x04\n GetDataContractHistoryResponseV0\x12\x8f\x01\n\x15\x64\x61ta_contract_history\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a;\n\x18\x44\x61taContractHistoryEntry\x12\x10\n\x04\x64\x61te\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\r\n\x05value\x18\x02 \x01(\x0c\x1a\xaa\x01\n\x13\x44\x61taContractHistory\x12\x92\x01\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32s.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntryB\x08\n\x06resultB\t\n\x07version\"\xb2\x02\n\x13GetDocumentsRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0H\x00\x1a\xbb\x01\n\x15GetDocumentsRequestV0\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05startB\t\n\x07version\"\x95\x03\n\x14GetDocumentsResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0H\x00\x1a\x9b\x02\n\x16GetDocumentsResponseV0\x12\x65\n\tdocuments\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.DocumentsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1e\n\tDocuments\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xed\x01\n!GetIdentityByPublicKeyHashRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0H\x00\x1aM\n#GetIdentityByPublicKeyHashRequestV0\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xda\x02\n\"GetIdentityByPublicKeyHashResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0H\x00\x1a\xb6\x01\n$GetIdentityByPublicKeyHashResponseV0\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xfb\x01\n#WaitForStateTransitionResultRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0H\x00\x1aU\n%WaitForStateTransitionResultRequestV0\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x99\x03\n$WaitForStateTransitionResultResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0H\x00\x1a\xef\x01\n&WaitForStateTransitionResultResponseV0\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x19GetConsensusParamsRequest\x12^\n\x02v0\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0H\x00\x1a<\n\x1bGetConsensusParamsRequestV0\x12\x0e\n\x06height\x18\x01 \x01(\x05\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\x9c\x04\n\x1aGetConsensusParamsResponse\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0H\x00\x1aP\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\x1a\x62\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\x1a\xda\x01\n\x1cGetConsensusParamsResponseV0\x12Y\n\x05\x62lock\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock\x12_\n\x08\x65vidence\x18\x02 \x01(\x0b\x32M.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidenceB\t\n\x07version\"\xe4\x01\n%GetProtocolVersionUpgradeStateRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0H\x00\x1a\x38\n\'GetProtocolVersionUpgradeStateRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xb5\x05\n&GetProtocolVersionUpgradeStateResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0H\x00\x1a\x85\x04\n(GetProtocolVersionUpgradeStateResponseV0\x12\x87\x01\n\x08versions\x18\x01 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x96\x01\n\x08Versions\x12\x89\x01\n\x08versions\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry\x1a:\n\x0cVersionEntry\x12\x16\n\x0eversion_number\x18\x01 \x01(\r\x12\x12\n\nvote_count\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xa3\x02\n*GetProtocolVersionUpgradeVoteStatusRequest\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0H\x00\x1ag\n,GetProtocolVersionUpgradeVoteStatusRequestV0\x12\x19\n\x11start_pro_tx_hash\x18\x01 \x01(\x0c\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xef\x05\n+GetProtocolVersionUpgradeVoteStatusResponse\x12\x82\x01\n\x02v0\x18\x01 \x01(\x0b\x32t.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0H\x00\x1a\xaf\x04\n-GetProtocolVersionUpgradeVoteStatusResponseV0\x12\x98\x01\n\x08versions\x18\x01 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignalsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xaf\x01\n\x0eVersionSignals\x12\x9c\x01\n\x0fversion_signals\x18\x01 \x03(\x0b\x32\x82\x01.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal\x1a\x35\n\rVersionSignal\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07version\x18\x02 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xf5\x01\n\x14GetEpochsInfoRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0H\x00\x1a|\n\x16GetEpochsInfoRequestV0\x12\x31\n\x0bstart_epoch\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05\x63ount\x18\x02 \x01(\r\x12\x11\n\tascending\x18\x03 \x01(\x08\x12\r\n\x05prove\x18\x04 \x01(\x08\x42\t\n\x07version\"\x99\x05\n\x15GetEpochsInfoResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0H\x00\x1a\x9c\x04\n\x17GetEpochsInfoResponseV0\x12\x65\n\x06\x65pochs\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1au\n\nEpochInfos\x12g\n\x0b\x65poch_infos\x18\x01 \x03(\x0b\x32R.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo\x1a\xa6\x01\n\tEpochInfo\x12\x0e\n\x06number\x18\x01 \x01(\r\x12\x1e\n\x12\x66irst_block_height\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x1f\n\x17\x66irst_core_block_height\x18\x03 \x01(\r\x12\x16\n\nstart_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x0e\x66\x65\x65_multiplier\x18\x05 \x01(\x01\x12\x18\n\x10protocol_version\x18\x06 \x01(\rB\x08\n\x06resultB\t\n\x07version\"\xde\x04\n\x1cGetContestedResourcesRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0H\x00\x1a\xcc\x03\n\x1eGetContestedResourcesRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x1a\n\x12start_index_values\x18\x04 \x03(\x0c\x12\x18\n\x10\x65nd_index_values\x18\x05 \x03(\x0c\x12\x89\x01\n\x13start_at_value_info\x18\x06 \x01(\x0b\x32g.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1a\x45\n\x10StartAtValueInfo\x12\x13\n\x0bstart_value\x18\x01 \x01(\x0c\x12\x1c\n\x14start_value_included\x18\x02 \x01(\x08\x42\x16\n\x14_start_at_value_infoB\x08\n\x06_countB\t\n\x07version\"\x88\x04\n\x1dGetContestedResourcesResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0H\x00\x1a\xf3\x02\n\x1fGetContestedResourcesResponseV0\x12\x95\x01\n\x19\x63ontested_resource_values\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValuesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a<\n\x17\x43ontestedResourceValues\x12!\n\x19\x63ontested_resource_values\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x05\n\x1cGetVotePollsByEndDateRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0H\x00\x1a\xc0\x04\n\x1eGetVotePollsByEndDateRequestV0\x12\x84\x01\n\x0fstart_time_info\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfoH\x00\x88\x01\x01\x12\x80\x01\n\rend_time_info\x18\x02 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfoH\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x13\n\x06offset\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x11\n\tascending\x18\x05 \x01(\x08\x12\r\n\x05prove\x18\x06 \x01(\x08\x1aI\n\x0fStartAtTimeInfo\x12\x19\n\rstart_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13start_time_included\x18\x02 \x01(\x08\x1a\x43\n\rEndAtTimeInfo\x12\x17\n\x0b\x65nd_time_ms\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x65nd_time_included\x18\x02 \x01(\x08\x42\x12\n\x10_start_time_infoB\x10\n\x0e_end_time_infoB\x08\n\x06_limitB\t\n\x07_offsetB\t\n\x07version\"\x83\x06\n\x1dGetVotePollsByEndDateResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0H\x00\x1a\xee\x04\n\x1fGetVotePollsByEndDateResponseV0\x12\x9c\x01\n\x18vote_polls_by_timestamps\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestampsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aV\n\x1eSerializedVotePollsByTimestamp\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x15serialized_vote_polls\x18\x02 \x03(\x0c\x1a\xd7\x01\n\x1fSerializedVotePollsByTimestamps\x12\x99\x01\n\x18vote_polls_by_timestamps\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xff\x06\n$GetContestedResourceVoteStateRequest\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0H\x00\x1a\xd5\x05\n&GetContestedResourceVoteStateRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x86\x01\n\x0bresult_type\x18\x05 \x01(\x0e\x32q.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType\x12\x36\n.allow_include_locked_and_abstaining_vote_tally\x18\x06 \x01(\x08\x12\xa3\x01\n\x18start_at_identifier_info\x18\x07 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x08 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\"I\n\nResultType\x12\r\n\tDOCUMENTS\x10\x00\x12\x0e\n\nVOTE_TALLY\x10\x01\x12\x1c\n\x18\x44OCUMENTS_AND_VOTE_TALLY\x10\x02\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\x94\x0c\n%GetContestedResourceVoteStateResponse\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0H\x00\x1a\xe7\n\n\'GetContestedResourceVoteStateResponseV0\x12\xae\x01\n\x1d\x63ontested_resource_contenders\x18\x01 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContendersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xda\x03\n\x10\x46inishedVoteInfo\x12\xad\x01\n\x15\x66inished_vote_outcome\x18\x01 \x01(\x0e\x32\x8d\x01.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome\x12\x1f\n\x12won_by_identity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12$\n\x18\x66inished_at_block_height\x18\x03 \x01(\x04\x42\x02\x30\x01\x12%\n\x1d\x66inished_at_core_block_height\x18\x04 \x01(\r\x12%\n\x19\x66inished_at_block_time_ms\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x66inished_at_epoch\x18\x06 \x01(\r\"O\n\x13\x46inishedVoteOutcome\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\n\n\x06LOCKED\x10\x01\x12\x16\n\x12NO_PREVIOUS_WINNER\x10\x02\x42\x15\n\x13_won_by_identity_id\x1a\xc4\x03\n\x1b\x43ontestedResourceContenders\x12\x86\x01\n\ncontenders\x18\x01 \x03(\x0b\x32r.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender\x12\x1f\n\x12\x61\x62stain_vote_tally\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1c\n\x0flock_vote_tally\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x9a\x01\n\x12\x66inished_vote_info\x18\x04 \x01(\x0b\x32y.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfoH\x02\x88\x01\x01\x42\x15\n\x13_abstain_vote_tallyB\x12\n\x10_lock_vote_tallyB\x15\n\x13_finished_vote_info\x1ak\n\tContender\x12\x12\n\nidentifier\x18\x01 \x01(\x0c\x12\x17\n\nvote_count\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08\x64ocument\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x42\r\n\x0b_vote_countB\x0b\n\t_documentB\x08\n\x06resultB\t\n\x07version\"\xd5\x05\n,GetContestedResourceVotersForIdentityRequest\x12\x84\x01\n\x02v0\x18\x01 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0H\x00\x1a\x92\x04\n.GetContestedResourceVotersForIdentityRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\x12\n\nindex_name\x18\x03 \x01(\t\x12\x14\n\x0cindex_values\x18\x04 \x03(\x0c\x12\x15\n\rcontestant_id\x18\x05 \x01(\x0c\x12\xb4\x01\n\x18start_at_identifier_info\x18\x06 \x01(\x0b\x32\x8c\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfoH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x07 \x01(\rH\x01\x88\x01\x01\x12\x17\n\x0forder_ascending\x18\x08 \x01(\x08\x12\r\n\x05prove\x18\t \x01(\x08\x1aT\n\x15StartAtIdentifierInfo\x12\x18\n\x10start_identifier\x18\x01 \x01(\x0c\x12!\n\x19start_identifier_included\x18\x02 \x01(\x08\x42\x1b\n\x19_start_at_identifier_infoB\x08\n\x06_countB\t\n\x07version\"\xf1\x04\n-GetContestedResourceVotersForIdentityResponse\x12\x86\x01\n\x02v0\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0H\x00\x1a\xab\x03\n/GetContestedResourceVotersForIdentityResponseV0\x12\xb6\x01\n\x19\x63ontested_resource_voters\x18\x01 \x01(\x0b\x32\x90\x01.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVotersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x43\n\x17\x43ontestedResourceVoters\x12\x0e\n\x06voters\x18\x01 \x03(\x0c\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x42\x08\n\x06resultB\t\n\x07version\"\xad\x05\n(GetContestedResourceIdentityVotesRequest\x12|\n\x02v0\x18\x01 \x01(\x0b\x32n.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0H\x00\x1a\xf7\x03\n*GetContestedResourceIdentityVotesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12+\n\x05limit\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x17\n\x0forder_ascending\x18\x04 \x01(\x08\x12\xae\x01\n\x1astart_at_vote_poll_id_info\x18\x05 \x01(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfoH\x00\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x1a\x61\n\x15StartAtVotePollIdInfo\x12 \n\x18start_at_poll_identifier\x18\x01 \x01(\x0c\x12&\n\x1estart_poll_identifier_included\x18\x02 \x01(\x08\x42\x1d\n\x1b_start_at_vote_poll_id_infoB\t\n\x07version\"\xc8\n\n)GetContestedResourceIdentityVotesResponse\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0H\x00\x1a\x8f\t\n+GetContestedResourceIdentityVotesResponseV0\x12\xa1\x01\n\x05votes\x18\x01 \x01(\x0b\x32\x8f\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\xf7\x01\n\x1e\x43ontestedResourceIdentityVotes\x12\xba\x01\n!contested_resource_identity_votes\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote\x12\x18\n\x10\x66inished_results\x18\x02 \x01(\x08\x1a\xad\x02\n\x12ResourceVoteChoice\x12\xad\x01\n\x10vote_choice_type\x18\x01 \x01(\x0e\x32\x92\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType\x12\x18\n\x0bidentity_id\x18\x02 \x01(\x0cH\x00\x88\x01\x01\"=\n\x0eVoteChoiceType\x12\x14\n\x10TOWARDS_IDENTITY\x10\x00\x12\x0b\n\x07\x41\x42STAIN\x10\x01\x12\x08\n\x04LOCK\x10\x02\x42\x0e\n\x0c_identity_id\x1a\x95\x02\n\x1d\x43ontestedResourceIdentityVote\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1a\n\x12\x64ocument_type_name\x18\x02 \x01(\t\x12\'\n\x1fserialized_index_storage_values\x18\x03 \x03(\x0c\x12\x99\x01\n\x0bvote_choice\x18\x04 \x01(\x0b\x32\x83\x01.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoiceB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n%GetPrefundedSpecializedBalanceRequest\x12v\n\x02v0\x18\x01 \x01(\x0b\x32h.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0H\x00\x1a\x44\n\'GetPrefundedSpecializedBalanceRequestV0\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xed\x02\n&GetPrefundedSpecializedBalanceResponse\x12x\n\x02v0\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0H\x00\x1a\xbd\x01\n(GetPrefundedSpecializedBalanceResponseV0\x12\x15\n\x07\x62\x61lance\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xd0\x01\n GetTotalCreditsInPlatformRequest\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0H\x00\x1a\x33\n\"GetTotalCreditsInPlatformRequestV0\x12\r\n\x05prove\x18\x01 \x01(\x08\x42\t\n\x07version\"\xd9\x02\n!GetTotalCreditsInPlatformResponse\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0H\x00\x1a\xb8\x01\n#GetTotalCreditsInPlatformResponseV0\x12\x15\n\x07\x63redits\x18\x01 \x01(\x04\x42\x02\x30\x01H\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06resultB\t\n\x07version\"\xc4\x01\n\x16GetPathElementsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0H\x00\x1a\x45\n\x18GetPathElementsRequestV0\x12\x0c\n\x04path\x18\x01 \x03(\x0c\x12\x0c\n\x04keys\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xa3\x03\n\x17GetPathElementsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0H\x00\x1a\xa0\x02\n\x19GetPathElementsResponseV0\x12i\n\x08\x65lements\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.ElementsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1c\n\x08\x45lements\x12\x10\n\x08\x65lements\x18\x01 \x03(\x0c\x42\x08\n\x06resultB\t\n\x07version\"\x81\x01\n\x10GetStatusRequest\x12L\n\x02v0\x18\x01 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0H\x00\x1a\x14\n\x12GetStatusRequestV0B\t\n\x07version\"\xd0\x10\n\x11GetStatusResponse\x12N\n\x02v0\x18\x01 \x01(\x0b\x32@.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0H\x00\x1a\xdf\x0f\n\x13GetStatusResponseV0\x12Y\n\x07version\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version\x12S\n\x04node\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node\x12U\n\x05\x63hain\x18\x03 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain\x12Y\n\x07network\x18\x04 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network\x12^\n\nstate_sync\x18\x05 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync\x12S\n\x04time\x18\x06 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time\x1a\xee\x04\n\x07Version\x12\x63\n\x08software\x18\x01 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software\x12\x63\n\x08protocol\x18\x02 \x01(\x0b\x32Q.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol\x1a^\n\x08Software\x12\x0c\n\x04\x64\x61pi\x18\x01 \x01(\t\x12\x12\n\x05\x64rive\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntenderdash\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_driveB\r\n\x0b_tenderdash\x1a\xb8\x02\n\x08Protocol\x12p\n\ntenderdash\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash\x12\x66\n\x05\x64rive\x18\x02 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive\x1a(\n\nTenderdash\x12\x0b\n\x03p2p\x18\x01 \x01(\r\x12\r\n\x05\x62lock\x18\x02 \x01(\r\x1a(\n\x05\x44rive\x12\x0e\n\x06latest\x18\x03 \x01(\r\x12\x0f\n\x07\x63urrent\x18\x04 \x01(\r\x1a\x7f\n\x04Time\x12\x11\n\x05local\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x16\n\x05\x62lock\x18\x02 \x01(\x04\x42\x02\x30\x01H\x00\x88\x01\x01\x12\x18\n\x07genesis\x18\x03 \x01(\x04\x42\x02\x30\x01H\x01\x88\x01\x01\x12\x12\n\x05\x65poch\x18\x04 \x01(\rH\x02\x88\x01\x01\x42\x08\n\x06_blockB\n\n\x08_genesisB\x08\n\x06_epoch\x1a<\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x0bpro_tx_hash\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\x0e\n\x0c_pro_tx_hash\x1a\xb3\x02\n\x05\x43hain\x12\x13\n\x0b\x63\x61tching_up\x18\x01 \x01(\x08\x12\x19\n\x11latest_block_hash\x18\x02 \x01(\x0c\x12\x17\n\x0flatest_app_hash\x18\x03 \x01(\x0c\x12\x1f\n\x13latest_block_height\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x13\x65\x61rliest_block_hash\x18\x05 \x01(\x0c\x12\x19\n\x11\x65\x61rliest_app_hash\x18\x06 \x01(\x0c\x12!\n\x15\x65\x61rliest_block_height\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15max_peer_block_height\x18\t \x01(\x04\x42\x02\x30\x01\x12%\n\x18\x63ore_chain_locked_height\x18\n \x01(\rH\x00\x88\x01\x01\x42\x1b\n\x19_core_chain_locked_height\x1a\x43\n\x07Network\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\t\x12\x13\n\x0bpeers_count\x18\x02 \x01(\r\x12\x11\n\tlistening\x18\x03 \x01(\x08\x1a\x85\x02\n\tStateSync\x12\x1d\n\x11total_synced_time\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x1a\n\x0eremaining_time\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0ftotal_snapshots\x18\x03 \x01(\r\x12\"\n\x16\x63hunk_process_avg_time\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x1b\n\x0fsnapshot_height\x18\x05 \x01(\x04\x42\x02\x30\x01\x12!\n\x15snapshot_chunks_count\x18\x06 \x01(\x04\x42\x02\x30\x01\x12\x1d\n\x11\x62\x61\x63kfilled_blocks\x18\x07 \x01(\x04\x42\x02\x30\x01\x12!\n\x15\x62\x61\x63kfill_blocks_total\x18\x08 \x01(\x04\x42\x02\x30\x01\x42\t\n\x07version\"\xb1\x01\n\x1cGetCurrentQuorumsInfoRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0H\x00\x1a \n\x1eGetCurrentQuorumsInfoRequestV0B\t\n\x07version\"\xa1\x05\n\x1dGetCurrentQuorumsInfoResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0H\x00\x1a\x46\n\x0bValidatorV0\x12\x13\n\x0bpro_tx_hash\x18\x01 \x01(\x0c\x12\x0f\n\x07node_ip\x18\x02 \x01(\t\x12\x11\n\tis_banned\x18\x03 \x01(\x08\x1a\xaf\x01\n\x0eValidatorSetV0\x12\x13\n\x0bquorum_hash\x18\x01 \x01(\x0c\x12\x13\n\x0b\x63ore_height\x18\x02 \x01(\r\x12U\n\x07members\x18\x03 \x03(\x0b\x32\x44.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0\x12\x1c\n\x14threshold_public_key\x18\x04 \x01(\x0c\x1a\x92\x02\n\x1fGetCurrentQuorumsInfoResponseV0\x12\x15\n\rquorum_hashes\x18\x01 \x03(\x0c\x12\x1b\n\x13\x63urrent_quorum_hash\x18\x02 \x01(\x0c\x12_\n\x0evalidator_sets\x18\x03 \x03(\x0b\x32G.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0\x12\x1b\n\x13last_block_proposer\x18\x04 \x01(\x0c\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\t\n\x07version\"\xf4\x01\n\x1fGetIdentityTokenBalancesRequest\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0H\x00\x1aZ\n!GetIdentityTokenBalancesRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xad\x05\n GetIdentityTokenBalancesResponse\x12l\n\x02v0\x18\x01 \x01(\x0b\x32^.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0H\x00\x1a\x8f\x04\n\"GetIdentityTokenBalancesResponseV0\x12\x86\x01\n\x0etoken_balances\x18\x01 \x01(\x0b\x32l.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aG\n\x11TokenBalanceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\x9a\x01\n\rTokenBalances\x12\x88\x01\n\x0etoken_balances\x18\x01 \x03(\x0b\x32p.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xfc\x01\n!GetIdentitiesTokenBalancesRequest\x12n\n\x02v0\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0H\x00\x1a\\\n#GetIdentitiesTokenBalancesRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xf2\x05\n\"GetIdentitiesTokenBalancesResponse\x12p\n\x02v0\x18\x01 \x01(\x0b\x32\x62.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0H\x00\x1a\xce\x04\n$GetIdentitiesTokenBalancesResponseV0\x12\x9b\x01\n\x17identity_token_balances\x18\x01 \x01(\x0b\x32x.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalancesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1aR\n\x19IdentityTokenBalanceEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x14\n\x07\x62\x61lance\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_balance\x1a\xb7\x01\n\x15IdentityTokenBalances\x12\x9d\x01\n\x17identity_token_balances\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntryB\x08\n\x06resultB\t\n\x07version\"\xe8\x01\n\x1cGetIdentityTokenInfosRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0H\x00\x1aW\n\x1eGetIdentityTokenInfosRequestV0\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x11\n\ttoken_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\x98\x06\n\x1dGetIdentityTokenInfosResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0H\x00\x1a\x83\x05\n\x1fGetIdentityTokenInfosResponseV0\x12z\n\x0btoken_infos\x18\x01 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb0\x01\n\x0eTokenInfoEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x82\x01\n\x04info\x18\x02 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x8a\x01\n\nTokenInfos\x12|\n\x0btoken_infos\x18\x01 \x03(\x0b\x32g.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xf0\x01\n\x1eGetIdentitiesTokenInfosRequest\x12h\n\x02v0\x18\x01 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0H\x00\x1aY\n GetIdentitiesTokenInfosRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_ids\x18\x02 \x03(\x0c\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xca\x06\n\x1fGetIdentitiesTokenInfosResponse\x12j\n\x02v0\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0H\x00\x1a\xaf\x05\n!GetIdentitiesTokenInfosResponseV0\x12\x8f\x01\n\x14identity_token_infos\x18\x01 \x01(\x0b\x32o.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a(\n\x16TokenIdentityInfoEntry\x12\x0e\n\x06\x66rozen\x18\x01 \x01(\x08\x1a\xb7\x01\n\x0eTokenInfoEntry\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12\x86\x01\n\x04info\x18\x02 \x01(\x0b\x32s.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntryH\x00\x88\x01\x01\x42\x07\n\x05_info\x1a\x97\x01\n\x12IdentityTokenInfos\x12\x80\x01\n\x0btoken_infos\x18\x01 \x03(\x0b\x32k.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbf\x01\n\x17GetTokenStatusesRequest\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0H\x00\x1a=\n\x19GetTokenStatusesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xe7\x04\n\x18GetTokenStatusesResponse\x12\\\n\x02v0\x18\x01 \x01(\x0b\x32N.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0H\x00\x1a\xe1\x03\n\x1aGetTokenStatusesResponseV0\x12v\n\x0etoken_statuses\x18\x01 \x01(\x0b\x32\\.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x44\n\x10TokenStatusEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x13\n\x06paused\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\t\n\x07_paused\x1a\x88\x01\n\rTokenStatuses\x12w\n\x0etoken_statuses\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntryB\x08\n\x06resultB\t\n\x07version\"\x8b\t\n$GetTokenDirectPurchasePricesResponse\x12t\n\x02v0\x18\x01 \x01(\x0b\x32\x66.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0H\x00\x1a\xe1\x07\n&GetTokenDirectPurchasePricesResponseV0\x12\xa9\x01\n\x1ctoken_direct_purchase_prices\x18\x01 \x01(\x0b\x32\x80\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePricesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xa7\x01\n\x0fPricingSchedule\x12\x93\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32w.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity\x1a\xe4\x01\n\x1dTokenDirectPurchasePriceEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x15\n\x0b\x66ixed_price\x18\x02 \x01(\x04H\x00\x12\x90\x01\n\x0evariable_price\x18\x03 \x01(\x0b\x32v.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingScheduleH\x00\x42\x07\n\x05price\x1a\xc8\x01\n\x19TokenDirectPurchasePrices\x12\xaa\x01\n\x1btoken_direct_purchase_price\x18\x01 \x03(\x0b\x32\x84\x01.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntryB\x08\n\x06resultB\t\n\x07version\"\xef\x01\n#GetTokenDirectPurchasePricesRequest\x12r\n\x02v0\x18\x01 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0H\x00\x1aI\n%GetTokenDirectPurchasePricesRequestV0\x12\x11\n\ttoken_ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xef\x04\n)GetTokenPreProgrammedDistributionsRequest\x12~\n\x02v0\x18\x01 \x01(\x0b\x32p.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0H\x00\x1a\xb6\x03\n+GetTokenPreProgrammedDistributionsRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x98\x01\n\rstart_at_info\x18\x02 \x01(\x0b\x32|.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfoH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x1a\x9a\x01\n\x0bStartAtInfo\x12\x15\n\rstart_time_ms\x18\x01 \x01(\x04\x12\x1c\n\x0fstart_recipient\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12%\n\x18start_recipient_included\x18\x03 \x01(\x08H\x01\x88\x01\x01\x42\x12\n\x10_start_recipientB\x1b\n\x19_start_recipient_includedB\x10\n\x0e_start_at_infoB\x08\n\x06_limitB\t\n\x07version\"\xec\x07\n*GetTokenPreProgrammedDistributionsResponse\x12\x80\x01\n\x02v0\x18\x01 \x01(\x0b\x32r.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0H\x00\x1a\xaf\x06\n,GetTokenPreProgrammedDistributionsResponseV0\x12\xa5\x01\n\x13token_distributions\x18\x01 \x01(\x0b\x32\x85\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a>\n\x16TokenDistributionEntry\x12\x14\n\x0crecipient_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x1a\xd4\x01\n\x1bTokenTimedDistributionEntry\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\xa1\x01\n\rdistributions\x18\x02 \x03(\x0b\x32\x89\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry\x1a\xc3\x01\n\x12TokenDistributions\x12\xac\x01\n\x13token_distributions\x18\x01 \x03(\x0b\x32\x8e\x01.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntryB\x08\n\x06resultB\t\n\x07version\"\xca\x01\n\x1aGetTokenTotalSupplyRequest\x12`\n\x02v0\x18\x01 \x01(\x0b\x32R.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0H\x00\x1a?\n\x1cGetTokenTotalSupplyRequestV0\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\x42\t\n\x07version\"\xaf\x04\n\x1bGetTokenTotalSupplyResponse\x12\x62\n\x02v0\x18\x01 \x01(\x0b\x32T.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0H\x00\x1a\xa0\x03\n\x1dGetTokenTotalSupplyResponseV0\x12\x88\x01\n\x12token_total_supply\x18\x01 \x01(\x0b\x32j.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntryH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1ax\n\x15TokenTotalSupplyEntry\x12\x10\n\x08token_id\x18\x01 \x01(\x0c\x12\x30\n(total_aggregated_amount_in_user_accounts\x18\x02 \x01(\x04\x12\x1b\n\x13total_system_amount\x18\x03 \x01(\x04\x42\x08\n\x06resultB\t\n\x07version\"\xd2\x01\n\x13GetGroupInfoRequest\x12R\n\x02v0\x18\x01 \x01(\x0b\x32\x44.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0H\x00\x1a\\\n\x15GetGroupInfoRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12\r\n\x05prove\x18\x03 \x01(\x08\x42\t\n\x07version\"\xd4\x05\n\x14GetGroupInfoResponse\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0H\x00\x1a\xda\x04\n\x16GetGroupInfoResponseV0\x12\x66\n\ngroup_info\x18\x01 \x01(\x0b\x32P.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x98\x01\n\x0eGroupInfoEntry\x12h\n\x07members\x18\x01 \x03(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x02 \x01(\r\x1a\x8a\x01\n\tGroupInfo\x12n\n\ngroup_info\x18\x01 \x01(\x0b\x32U.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntryH\x00\x88\x01\x01\x42\r\n\x0b_group_infoB\x08\n\x06resultB\t\n\x07version\"\xed\x03\n\x14GetGroupInfosRequest\x12T\n\x02v0\x18\x01 \x01(\x0b\x32\x46.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0H\x00\x1au\n\x1cStartAtGroupContractPosition\x12%\n\x1dstart_group_contract_position\x18\x01 \x01(\r\x12.\n&start_group_contract_position_included\x18\x02 \x01(\x08\x1a\xfc\x01\n\x16GetGroupInfosRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12{\n start_at_group_contract_position\x18\x02 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPositionH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x04 \x01(\x08\x42#\n!_start_at_group_contract_positionB\x08\n\x06_countB\t\n\x07version\"\xff\x05\n\x15GetGroupInfosResponse\x12V\n\x02v0\x18\x01 \x01(\x0b\x32H.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0H\x00\x1a\x82\x05\n\x17GetGroupInfosResponseV0\x12j\n\x0bgroup_infos\x18\x01 \x01(\x0b\x32S.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfosH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x34\n\x10GroupMemberEntry\x12\x11\n\tmember_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\xc3\x01\n\x16GroupPositionInfoEntry\x12\x1f\n\x17group_contract_position\x18\x01 \x01(\r\x12j\n\x07members\x18\x02 \x03(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry\x12\x1c\n\x14group_required_power\x18\x03 \x01(\r\x1a\x82\x01\n\nGroupInfos\x12t\n\x0bgroup_infos\x18\x01 \x03(\x0b\x32_.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntryB\x08\n\x06resultB\t\n\x07version\"\xbe\x04\n\x16GetGroupActionsRequest\x12X\n\x02v0\x18\x01 \x01(\x0b\x32J.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0H\x00\x1aL\n\x0fStartAtActionId\x12\x17\n\x0fstart_action_id\x18\x01 \x01(\x0c\x12 \n\x18start_action_id_included\x18\x02 \x01(\x08\x1a\xc8\x02\n\x18GetGroupActionsRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12N\n\x06status\x18\x03 \x01(\x0e\x32>.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus\x12\x62\n\x12start_at_action_id\x18\x04 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionIdH\x00\x88\x01\x01\x12\x12\n\x05\x63ount\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\r\n\x05prove\x18\x06 \x01(\x08\x42\x15\n\x13_start_at_action_idB\x08\n\x06_count\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\xc0\x1e\n\x17GetGroupActionsResponse\x12Z\n\x02v0\x18\x01 \x01(\x0b\x32L.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0H\x00\x1a\xbd\x1d\n\x19GetGroupActionsResponseV0\x12r\n\rgroup_actions\x18\x01 \x01(\x0b\x32Y.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a[\n\tMintEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x14\n\x0crecipient_id\x18\x02 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x45\n\tBurnEvent\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aJ\n\x0b\x46reezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1aL\n\rUnfreezeEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x66\n\x17\x44\x65stroyFrozenFundsEvent\x12\x11\n\tfrozen_id\x18\x01 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x04\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x13SharedEncryptedNote\x12\x18\n\x10sender_key_index\x18\x01 \x01(\r\x12\x1b\n\x13recipient_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a{\n\x15PersonalEncryptedNote\x12!\n\x19root_encryption_key_index\x18\x01 \x01(\r\x12\'\n\x1f\x64\x65rivation_encryption_key_index\x18\x02 \x01(\r\x12\x16\n\x0e\x65ncrypted_data\x18\x03 \x01(\x0c\x1a\xe9\x01\n\x14\x45mergencyActionEvent\x12\x81\x01\n\x0b\x61\x63tion_type\x18\x01 \x01(\x0e\x32l.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\"#\n\nActionType\x12\t\n\x05PAUSE\x10\x00\x12\n\n\x06RESUME\x10\x01\x42\x0e\n\x0c_public_note\x1a\x64\n\x16TokenConfigUpdateEvent\x12 \n\x18token_config_update_item\x18\x01 \x01(\x0c\x12\x18\n\x0bpublic_note\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x0e\n\x0c_public_note\x1a\xe6\x03\n\x1eUpdateDirectPurchasePriceEvent\x12\x15\n\x0b\x66ixed_price\x18\x01 \x01(\x04H\x00\x12\x95\x01\n\x0evariable_price\x18\x02 \x01(\x0b\x32{.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingScheduleH\x00\x12\x18\n\x0bpublic_note\x18\x03 \x01(\tH\x01\x88\x01\x01\x1a\x33\n\x10PriceForQuantity\x12\x10\n\x08quantity\x18\x01 \x01(\x04\x12\r\n\x05price\x18\x02 \x01(\x04\x1a\xac\x01\n\x0fPricingSchedule\x12\x98\x01\n\x12price_for_quantity\x18\x01 \x03(\x0b\x32|.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantityB\x07\n\x05priceB\x0e\n\x0c_public_note\x1a\xfc\x02\n\x10GroupActionEvent\x12n\n\x0btoken_event\x18\x01 \x01(\x0b\x32W.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEventH\x00\x12t\n\x0e\x64ocument_event\x18\x02 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEventH\x00\x12t\n\x0e\x63ontract_event\x18\x03 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEventH\x00\x42\x0c\n\nevent_type\x1a\x8b\x01\n\rDocumentEvent\x12r\n\x06\x63reate\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEventH\x00\x42\x06\n\x04type\x1a/\n\x13\x44ocumentCreateEvent\x12\x18\n\x10\x63reated_document\x18\x01 \x01(\x0c\x1a/\n\x13\x43ontractUpdateEvent\x12\x18\n\x10updated_contract\x18\x01 \x01(\x0c\x1a\x8b\x01\n\rContractEvent\x12r\n\x06update\x18\x01 \x01(\x0b\x32`.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEventH\x00\x42\x06\n\x04type\x1a\xd1\x07\n\nTokenEvent\x12\x66\n\x04mint\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEventH\x00\x12\x66\n\x04\x62urn\x18\x02 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEventH\x00\x12j\n\x06\x66reeze\x18\x03 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEventH\x00\x12n\n\x08unfreeze\x18\x04 \x01(\x0b\x32Z.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEventH\x00\x12\x84\x01\n\x14\x64\x65stroy_frozen_funds\x18\x05 \x01(\x0b\x32\x64.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEventH\x00\x12}\n\x10\x65mergency_action\x18\x06 \x01(\x0b\x32\x61.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEventH\x00\x12\x82\x01\n\x13token_config_update\x18\x07 \x01(\x0b\x32\x63.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEventH\x00\x12\x83\x01\n\x0cupdate_price\x18\x08 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEventH\x00\x42\x06\n\x04type\x1a\x93\x01\n\x10GroupActionEntry\x12\x11\n\taction_id\x18\x01 \x01(\x0c\x12l\n\x05\x65vent\x18\x02 \x01(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent\x1a\x84\x01\n\x0cGroupActions\x12t\n\rgroup_actions\x18\x01 \x03(\x0b\x32].org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntryB\x08\n\x06resultB\t\n\x07version\"\x88\x03\n\x1cGetGroupActionSignersRequest\x12\x64\n\x02v0\x18\x01 \x01(\x0b\x32V.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0H\x00\x1a\xce\x01\n\x1eGetGroupActionSignersRequestV0\x12\x13\n\x0b\x63ontract_id\x18\x01 \x01(\x0c\x12\x1f\n\x17group_contract_position\x18\x02 \x01(\r\x12T\n\x06status\x18\x03 \x01(\x0e\x32\x44.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus\x12\x11\n\taction_id\x18\x04 \x01(\x0c\x12\r\n\x05prove\x18\x05 \x01(\x08\"&\n\x0c\x41\x63tionStatus\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\n\n\x06\x43LOSED\x10\x01\x42\t\n\x07version\"\x8b\x05\n\x1dGetGroupActionSignersResponse\x12\x66\n\x02v0\x18\x01 \x01(\x0b\x32X.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0H\x00\x1a\xf6\x03\n\x1fGetGroupActionSignersResponseV0\x12\x8b\x01\n\x14group_action_signers\x18\x01 \x01(\x0b\x32k.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignersH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x35\n\x11GroupActionSigner\x12\x11\n\tsigner_id\x18\x01 \x01(\x0c\x12\r\n\x05power\x18\x02 \x01(\r\x1a\x91\x01\n\x12GroupActionSigners\x12{\n\x07signers\x18\x01 \x03(\x0b\x32j.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSignerB\x08\n\x06resultB\t\n\x07version*Z\n\nKeyPurpose\x12\x12\n\x0e\x41UTHENTICATION\x10\x00\x12\x0e\n\nENCRYPTION\x10\x01\x12\x0e\n\nDECRYPTION\x10\x02\x12\x0c\n\x08TRANSFER\x10\x03\x12\n\n\x06VOTING\x10\x05\x32\xd4\x30\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12\x96\x01\n\x19getIdentitiesContractKeys\x12;.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest\x1a<.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse\x12{\n\x10getIdentityNonce\x12\x32.org.dash.platform.dapi.v0.GetIdentityNonceRequest\x1a\x33.org.dash.platform.dapi.v0.GetIdentityNonceResponse\x12\x93\x01\n\x18getIdentityContractNonce\x12:.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse\x12\x81\x01\n\x12getIdentityBalance\x12\x34.org.dash.platform.dapi.v0.GetIdentityBalanceRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x8a\x01\n\x15getIdentitiesBalances\x12\x37.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse\x12\xa2\x01\n\x1dgetIdentityBalanceAndRevision\x12?.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12\xaf\x01\n#getEvonodesProposedEpochBlocksByIds\x12\x45.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12\xb3\x01\n%getEvonodesProposedEpochBlocksByRange\x12G.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest\x1a\x41.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12\x8d\x01\n\x16getDataContractHistory\x12\x38.org.dash.platform.dapi.v0.GetDataContractHistoryRequest\x1a\x39.org.dash.platform.dapi.v0.GetDataContractHistoryResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\x99\x01\n\x1agetIdentityByPublicKeyHash\x12<.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest\x1a=.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponse\x12\xa5\x01\n\x1egetProtocolVersionUpgradeState\x12@.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest\x1a\x41.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse\x12\xb4\x01\n#getProtocolVersionUpgradeVoteStatus\x12\x45.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest\x1a\x46.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse\x12r\n\rgetEpochsInfo\x12/.org.dash.platform.dapi.v0.GetEpochsInfoRequest\x1a\x30.org.dash.platform.dapi.v0.GetEpochsInfoResponse\x12\x8a\x01\n\x15getContestedResources\x12\x37.org.dash.platform.dapi.v0.GetContestedResourcesRequest\x1a\x38.org.dash.platform.dapi.v0.GetContestedResourcesResponse\x12\xa2\x01\n\x1dgetContestedResourceVoteState\x12?.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest\x1a@.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse\x12\xba\x01\n%getContestedResourceVotersForIdentity\x12G.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest\x1aH.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse\x12\xae\x01\n!getContestedResourceIdentityVotes\x12\x43.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest\x1a\x44.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse\x12\x8a\x01\n\x15getVotePollsByEndDate\x12\x37.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest\x1a\x38.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse\x12\xa5\x01\n\x1egetPrefundedSpecializedBalance\x12@.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest\x1a\x41.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse\x12\x96\x01\n\x19getTotalCreditsInPlatform\x12;.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest\x1a<.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse\x12x\n\x0fgetPathElements\x12\x31.org.dash.platform.dapi.v0.GetPathElementsRequest\x1a\x32.org.dash.platform.dapi.v0.GetPathElementsResponse\x12\x66\n\tgetStatus\x12+.org.dash.platform.dapi.v0.GetStatusRequest\x1a,.org.dash.platform.dapi.v0.GetStatusResponse\x12\x8a\x01\n\x15getCurrentQuorumsInfo\x12\x37.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest\x1a\x38.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse\x12\x93\x01\n\x18getIdentityTokenBalances\x12:.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest\x1a;.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse\x12\x99\x01\n\x1agetIdentitiesTokenBalances\x12<.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest\x1a=.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse\x12\x8a\x01\n\x15getIdentityTokenInfos\x12\x37.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest\x1a\x38.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse\x12\x90\x01\n\x17getIdentitiesTokenInfos\x12\x39.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest\x1a:.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse\x12{\n\x10getTokenStatuses\x12\x32.org.dash.platform.dapi.v0.GetTokenStatusesRequest\x1a\x33.org.dash.platform.dapi.v0.GetTokenStatusesResponse\x12\x9f\x01\n\x1cgetTokenDirectPurchasePrices\x12>.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest\x1a?.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse\x12\xb1\x01\n\"getTokenPreProgrammedDistributions\x12\x44.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest\x1a\x45.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse\x12\x84\x01\n\x13getTokenTotalSupply\x12\x35.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest\x1a\x36.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse\x12o\n\x0cgetGroupInfo\x12..org.dash.platform.dapi.v0.GetGroupInfoRequest\x1a/.org.dash.platform.dapi.v0.GetGroupInfoResponse\x12r\n\rgetGroupInfos\x12/.org.dash.platform.dapi.v0.GetGroupInfosRequest\x1a\x30.org.dash.platform.dapi.v0.GetGroupInfosResponse\x12x\n\x0fgetGroupActions\x12\x31.org.dash.platform.dapi.v0.GetGroupActionsRequest\x1a\x32.org.dash.platform.dapi.v0.GetGroupActionsResponse\x12\x8a\x01\n\x15getGroupActionSigners\x12\x37.org.dash.platform.dapi.v0.GetGroupActionSignersRequest\x1a\x38.org.dash.platform.dapi.v0.GetGroupActionSignersResponseb\x06proto3' , dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) @@ -62,8 +62,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=46472, - serialized_end=46562, + serialized_start=46321, + serialized_end=46411, ) _sym_db.RegisterEnumDescriptor(_KEYPURPOSE) @@ -210,8 +210,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=41465, - serialized_end=41503, + serialized_start=41314, + serialized_end=41352, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSREQUEST_ACTIONSTATUS) @@ -235,8 +235,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=42728, - serialized_end=42763, + serialized_start=42577, + serialized_end=42612, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT_ACTIONTYPE) @@ -260,8 +260,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=41465, - serialized_end=41503, + serialized_start=41314, + serialized_end=41352, ) _sym_db.RegisterEnumDescriptor(_GETGROUPACTIONSIGNERSREQUEST_ACTIONSTATUS) @@ -9399,25 +9399,25 @@ ) -_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0 = _descriptor.Descriptor( - name='GetTokenDirectPurchasePricesRequestV0', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0', +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY = _descriptor.Descriptor( + name='PriceForQuantity', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='token_ids', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.token_ids', index=0, - number=1, type=12, cpp_type=9, label=3, - has_default_value=False, default_value=[], + name='quantity', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.quantity', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='prove', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prove', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, + name='price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.price', index=1, + number=2, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -9433,29 +9433,29 @@ extension_ranges=[], oneofs=[ ], - serialized_start=34930, - serialized_end=35003, + serialized_start=35262, + serialized_end=35313, ) -_GETTOKENDIRECTPURCHASEPRICESREQUEST = _descriptor.Descriptor( - name='GetTokenDirectPurchasePricesRequest', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest', +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE = _descriptor.Descriptor( + name='PricingSchedule', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='v0', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.v0', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='price_for_quantity', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.price_for_quantity', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0, ], + nested_types=[], enum_types=[ ], serialized_options=None, @@ -9463,39 +9463,40 @@ syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.version', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=34775, - serialized_end=35014, + serialized_start=35316, + serialized_end=35483, ) - -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY = _descriptor.Descriptor( - name='PriceForQuantity', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity', +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY = _descriptor.Descriptor( + name='TokenDirectPurchasePriceEntry', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='quantity', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.quantity', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, + name='token_id', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.token_id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.price', index=1, + name='fixed_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.fixed_price', index=1, number=2, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='variable_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.variable_price', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -9507,21 +9508,26 @@ syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.price', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=35504, - serialized_end=35555, + serialized_start=35486, + serialized_end=35714, ) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE = _descriptor.Descriptor( - name='PricingSchedule', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule', +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES = _descriptor.Descriptor( + name='TokenDirectPurchasePrices', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='price_for_quantity', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.price_for_quantity', index=0, + name='token_direct_purchase_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.token_direct_purchase_price', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -9539,36 +9545,43 @@ extension_ranges=[], oneofs=[ ], - serialized_start=35558, - serialized_end=35725, + serialized_start=35717, + serialized_end=35917, ) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE = _descriptor.Descriptor( - name='Price', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price', +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 = _descriptor.Descriptor( + name='GetTokenDirectPurchasePricesResponseV0', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='fixed_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.fixed_price', index=0, - number=1, type=4, cpp_type=4, label=1, - has_default_value=False, default_value=0, + name='token_direct_purchase_prices', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.token_direct_purchase_prices', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='variable_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.variable_price', index=1, + name='proof', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.proof', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[], + nested_types=[_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES, ], enum_types=[ ], serialized_options=None, @@ -9577,33 +9590,26 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.price', + name='result', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.result', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35728, - serialized_end=35914, + serialized_start=34934, + serialized_end=35927, ) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY = _descriptor.Descriptor( - name='TokenDirectPurchasePriceEntry', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry', +_GETTOKENDIRECTPURCHASEPRICESRESPONSE = _descriptor.Descriptor( + name='GetTokenDirectPurchasePricesResponse', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='token_id', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.token_id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.price', index=1, - number=2, type=11, cpp_type=10, label=1, + name='v0', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.v0', index=0, + number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -9611,7 +9617,7 @@ ], extensions=[ ], - nested_types=[], + nested_types=[_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0, ], enum_types=[ ], serialized_options=None, @@ -9620,79 +9626,42 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry._price', + name='version', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.version', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35917, - serialized_end=36107, + serialized_start=34775, + serialized_end=35938, ) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES = _descriptor.Descriptor( - name='TokenDirectPurchasePrices', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='token_direct_purchase_price', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.token_direct_purchase_price', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=36110, - serialized_end=36310, -) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 = _descriptor.Descriptor( - name='GetTokenDirectPurchasePricesResponseV0', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0', +_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0 = _descriptor.Descriptor( + name='GetTokenDirectPurchasePricesRequestV0', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='token_direct_purchase_prices', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.token_direct_purchase_prices', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='proof', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.proof', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='token_ids', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.token_ids', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='metadata', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.metadata', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='prove', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prove', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], - nested_types=[_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY, _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES, ], + nested_types=[], enum_types=[ ], serialized_options=None, @@ -9700,26 +9669,21 @@ syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='result', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.result', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=35176, - serialized_end=36320, + serialized_start=36096, + serialized_end=36169, ) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE = _descriptor.Descriptor( - name='GetTokenDirectPurchasePricesResponse', - full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse', +_GETTOKENDIRECTPURCHASEPRICESREQUEST = _descriptor.Descriptor( + name='GetTokenDirectPurchasePricesRequest', + full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='v0', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.v0', index=0, + name='v0', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.v0', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -9728,7 +9692,7 @@ ], extensions=[ ], - nested_types=[_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0, ], + nested_types=[_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0, ], enum_types=[ ], serialized_options=None, @@ -9737,13 +9701,13 @@ extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( - name='version', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.version', + name='version', full_name='org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.version', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=35017, - serialized_end=36331, + serialized_start=35941, + serialized_end=36180, ) @@ -9798,8 +9762,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36764, - serialized_end=36918, + serialized_start=36613, + serialized_end=36767, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0 = _descriptor.Descriptor( @@ -9860,8 +9824,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36508, - serialized_end=36946, + serialized_start=36357, + serialized_end=36795, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST = _descriptor.Descriptor( @@ -9896,8 +9860,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36334, - serialized_end=36957, + serialized_start=36183, + serialized_end=36806, ) @@ -9935,8 +9899,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=37468, - serialized_end=37530, + serialized_start=37317, + serialized_end=37379, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENTIMEDDISTRIBUTIONENTRY = _descriptor.Descriptor( @@ -9973,8 +9937,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=37533, - serialized_end=37745, + serialized_start=37382, + serialized_end=37594, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0_TOKENDISTRIBUTIONS = _descriptor.Descriptor( @@ -10004,8 +9968,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=37748, - serialized_end=37943, + serialized_start=37597, + serialized_end=37792, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE_GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -10054,8 +10018,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37138, - serialized_end=37953, + serialized_start=36987, + serialized_end=37802, ) _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE = _descriptor.Descriptor( @@ -10090,8 +10054,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=36960, - serialized_end=37964, + serialized_start=36809, + serialized_end=37813, ) @@ -10129,8 +10093,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38095, - serialized_end=38158, + serialized_start=37944, + serialized_end=38007, ) _GETTOKENTOTALSUPPLYREQUEST = _descriptor.Descriptor( @@ -10165,8 +10129,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=37967, - serialized_end=38169, + serialized_start=37816, + serialized_end=38018, ) @@ -10211,8 +10175,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38590, - serialized_end=38710, + serialized_start=38439, + serialized_end=38559, ) _GETTOKENTOTALSUPPLYRESPONSE_GETTOKENTOTALSUPPLYRESPONSEV0 = _descriptor.Descriptor( @@ -10261,8 +10225,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38304, - serialized_end=38720, + serialized_start=38153, + serialized_end=38569, ) _GETTOKENTOTALSUPPLYRESPONSE = _descriptor.Descriptor( @@ -10297,8 +10261,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38172, - serialized_end=38731, + serialized_start=38021, + serialized_end=38580, ) @@ -10343,8 +10307,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=38841, - serialized_end=38933, + serialized_start=38690, + serialized_end=38782, ) _GETGROUPINFOREQUEST = _descriptor.Descriptor( @@ -10379,8 +10343,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38734, - serialized_end=38944, + serialized_start=38583, + serialized_end=38793, ) @@ -10418,8 +10382,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39302, - serialized_end=39354, + serialized_start=39151, + serialized_end=39203, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFOENTRY = _descriptor.Descriptor( @@ -10456,8 +10420,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39357, - serialized_end=39509, + serialized_start=39206, + serialized_end=39358, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0_GROUPINFO = _descriptor.Descriptor( @@ -10492,8 +10456,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39512, - serialized_end=39650, + serialized_start=39361, + serialized_end=39499, ) _GETGROUPINFORESPONSE_GETGROUPINFORESPONSEV0 = _descriptor.Descriptor( @@ -10542,8 +10506,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39058, - serialized_end=39660, + serialized_start=38907, + serialized_end=39509, ) _GETGROUPINFORESPONSE = _descriptor.Descriptor( @@ -10578,8 +10542,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=38947, - serialized_end=39671, + serialized_start=38796, + serialized_end=39520, ) @@ -10617,8 +10581,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39784, - serialized_end=39901, + serialized_start=39633, + serialized_end=39750, ) _GETGROUPINFOSREQUEST_GETGROUPINFOSREQUESTV0 = _descriptor.Descriptor( @@ -10679,8 +10643,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39904, - serialized_end=40156, + serialized_start=39753, + serialized_end=40005, ) _GETGROUPINFOSREQUEST = _descriptor.Descriptor( @@ -10715,8 +10679,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=39674, - serialized_end=40167, + serialized_start=39523, + serialized_end=40016, ) @@ -10754,8 +10718,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=39302, - serialized_end=39354, + serialized_start=39151, + serialized_end=39203, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPPOSITIONINFOENTRY = _descriptor.Descriptor( @@ -10799,8 +10763,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40588, - serialized_end=40783, + serialized_start=40437, + serialized_end=40632, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0_GROUPINFOS = _descriptor.Descriptor( @@ -10830,8 +10794,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=40786, - serialized_end=40916, + serialized_start=40635, + serialized_end=40765, ) _GETGROUPINFOSRESPONSE_GETGROUPINFOSRESPONSEV0 = _descriptor.Descriptor( @@ -10880,8 +10844,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40284, - serialized_end=40926, + serialized_start=40133, + serialized_end=40775, ) _GETGROUPINFOSRESPONSE = _descriptor.Descriptor( @@ -10916,8 +10880,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40170, - serialized_end=40937, + serialized_start=40019, + serialized_end=40786, ) @@ -10955,8 +10919,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=41056, - serialized_end=41132, + serialized_start=40905, + serialized_end=40981, ) _GETGROUPACTIONSREQUEST_GETGROUPACTIONSREQUESTV0 = _descriptor.Descriptor( @@ -11031,8 +10995,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41135, - serialized_end=41463, + serialized_start=40984, + serialized_end=41312, ) _GETGROUPACTIONSREQUEST = _descriptor.Descriptor( @@ -11068,8 +11032,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=40940, - serialized_end=41514, + serialized_start=40789, + serialized_end=41363, ) @@ -11119,8 +11083,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41896, - serialized_end=41987, + serialized_start=41745, + serialized_end=41836, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_BURNEVENT = _descriptor.Descriptor( @@ -11162,8 +11126,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41989, - serialized_end=42058, + serialized_start=41838, + serialized_end=41907, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_FREEZEEVENT = _descriptor.Descriptor( @@ -11205,8 +11169,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42060, - serialized_end=42134, + serialized_start=41909, + serialized_end=41983, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UNFREEZEEVENT = _descriptor.Descriptor( @@ -11248,8 +11212,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42136, - serialized_end=42212, + serialized_start=41985, + serialized_end=42061, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DESTROYFROZENFUNDSEVENT = _descriptor.Descriptor( @@ -11298,8 +11262,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42214, - serialized_end=42316, + serialized_start=42063, + serialized_end=42165, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_SHAREDENCRYPTEDNOTE = _descriptor.Descriptor( @@ -11343,8 +11307,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=42318, - serialized_end=42418, + serialized_start=42167, + serialized_end=42267, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_PERSONALENCRYPTEDNOTE = _descriptor.Descriptor( @@ -11388,8 +11352,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=42420, - serialized_end=42543, + serialized_start=42269, + serialized_end=42392, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_EMERGENCYACTIONEVENT = _descriptor.Descriptor( @@ -11432,8 +11396,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42546, - serialized_end=42779, + serialized_start=42395, + serialized_end=42628, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENCONFIGUPDATEEVENT = _descriptor.Descriptor( @@ -11475,8 +11439,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42781, - serialized_end=42881, + serialized_start=42630, + serialized_end=42730, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICEFORQUANTITY = _descriptor.Descriptor( @@ -11513,8 +11477,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=35504, - serialized_end=35555, + serialized_start=35262, + serialized_end=35313, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT_PRICINGSCHEDULE = _descriptor.Descriptor( @@ -11544,8 +11508,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43173, - serialized_end=43345, + serialized_start=43022, + serialized_end=43194, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_UPDATEDIRECTPURCHASEPRICEEVENT = _descriptor.Descriptor( @@ -11599,8 +11563,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=42884, - serialized_end=43370, + serialized_start=42733, + serialized_end=43219, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONEVENT = _descriptor.Descriptor( @@ -11649,8 +11613,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43373, - serialized_end=43753, + serialized_start=43222, + serialized_end=43602, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTEVENT = _descriptor.Descriptor( @@ -11685,8 +11649,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43756, - serialized_end=43895, + serialized_start=43605, + serialized_end=43744, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_DOCUMENTCREATEEVENT = _descriptor.Descriptor( @@ -11716,8 +11680,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43897, - serialized_end=43944, + serialized_start=43746, + serialized_end=43793, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTUPDATEEVENT = _descriptor.Descriptor( @@ -11747,8 +11711,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=43946, - serialized_end=43993, + serialized_start=43795, + serialized_end=43842, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_CONTRACTEVENT = _descriptor.Descriptor( @@ -11783,8 +11747,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=43996, - serialized_end=44135, + serialized_start=43845, + serialized_end=43984, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_TOKENEVENT = _descriptor.Descriptor( @@ -11868,8 +11832,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=44138, - serialized_end=45115, + serialized_start=43987, + serialized_end=44964, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONENTRY = _descriptor.Descriptor( @@ -11906,8 +11870,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45118, - serialized_end=45265, + serialized_start=44967, + serialized_end=45114, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0_GROUPACTIONS = _descriptor.Descriptor( @@ -11937,8 +11901,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45268, - serialized_end=45400, + serialized_start=45117, + serialized_end=45249, ) _GETGROUPACTIONSRESPONSE_GETGROUPACTIONSRESPONSEV0 = _descriptor.Descriptor( @@ -11987,8 +11951,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41637, - serialized_end=45410, + serialized_start=41486, + serialized_end=45259, ) _GETGROUPACTIONSRESPONSE = _descriptor.Descriptor( @@ -12023,8 +11987,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=41517, - serialized_end=45421, + serialized_start=41366, + serialized_end=45270, ) @@ -12083,8 +12047,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=45559, - serialized_end=45765, + serialized_start=45408, + serialized_end=45614, ) _GETGROUPACTIONSIGNERSREQUEST = _descriptor.Descriptor( @@ -12120,8 +12084,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45424, - serialized_end=45816, + serialized_start=45273, + serialized_end=45665, ) @@ -12159,8 +12123,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46248, - serialized_end=46301, + serialized_start=46097, + serialized_end=46150, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0_GROUPACTIONSIGNERS = _descriptor.Descriptor( @@ -12190,8 +12154,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=46304, - serialized_end=46449, + serialized_start=46153, + serialized_end=46298, ) _GETGROUPACTIONSIGNERSRESPONSE_GETGROUPACTIONSIGNERSRESPONSEV0 = _descriptor.Descriptor( @@ -12240,8 +12204,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45957, - serialized_end=46459, + serialized_start=45806, + serialized_end=46308, ) _GETGROUPACTIONSIGNERSRESPONSE = _descriptor.Descriptor( @@ -12276,8 +12240,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=45819, - serialized_end=46470, + serialized_start=45668, + serialized_end=46319, ) _GETIDENTITYREQUEST_GETIDENTITYREQUESTV0.containing_type = _GETIDENTITYREQUEST @@ -13154,27 +13118,17 @@ _GETTOKENSTATUSESRESPONSE.oneofs_by_name['version'].fields.append( _GETTOKENSTATUSESRESPONSE.fields_by_name['v0']) _GETTOKENSTATUSESRESPONSE.fields_by_name['v0'].containing_oneof = _GETTOKENSTATUSESRESPONSE.oneofs_by_name['version'] -_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0.containing_type = _GETTOKENDIRECTPURCHASEPRICESREQUEST -_GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0'].message_type = _GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0 -_GETTOKENDIRECTPURCHASEPRICESREQUEST.oneofs_by_name['version'].fields.append( - _GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0']) -_GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESREQUEST.oneofs_by_name['version'] _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE.fields_by_name['price_for_quantity'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICEFORQUANTITY _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['variable_price'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.oneofs_by_name['price'].fields.append( - _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['fixed_price']) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['fixed_price'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.oneofs_by_name['price'] -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.oneofs_by_name['price'].fields.append( - _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['variable_price']) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.fields_by_name['variable_price'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE.oneofs_by_name['price'] -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['price'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['variable_price'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICINGSCHEDULE _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.oneofs_by_name['_price'].fields.append( - _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['price']) -_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['price'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.oneofs_by_name['_price'] +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.oneofs_by_name['price'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['fixed_price']) +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['fixed_price'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.oneofs_by_name['price'] +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.oneofs_by_name['price'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['variable_price']) +_GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.fields_by_name['variable_price'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY.oneofs_by_name['price'] _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES.fields_by_name['token_direct_purchase_price'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES.containing_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0 _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0.fields_by_name['token_direct_purchase_prices'].message_type = _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICES @@ -13191,6 +13145,11 @@ _GETTOKENDIRECTPURCHASEPRICESRESPONSE.oneofs_by_name['version'].fields.append( _GETTOKENDIRECTPURCHASEPRICESRESPONSE.fields_by_name['v0']) _GETTOKENDIRECTPURCHASEPRICESRESPONSE.fields_by_name['v0'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESRESPONSE.oneofs_by_name['version'] +_GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0.containing_type = _GETTOKENDIRECTPURCHASEPRICESREQUEST +_GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0'].message_type = _GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0 +_GETTOKENDIRECTPURCHASEPRICESREQUEST.oneofs_by_name['version'].fields.append( + _GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0']) +_GETTOKENDIRECTPURCHASEPRICESREQUEST.fields_by_name['v0'].containing_oneof = _GETTOKENDIRECTPURCHASEPRICESREQUEST.oneofs_by_name['version'] _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0_STARTATINFO.containing_type = _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0 _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0_STARTATINFO.oneofs_by_name['_start_recipient'].fields.append( _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST_GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUESTV0_STARTATINFO.fields_by_name['start_recipient']) @@ -13548,8 +13507,8 @@ DESCRIPTOR.message_types_by_name['GetIdentitiesTokenInfosResponse'] = _GETIDENTITIESTOKENINFOSRESPONSE DESCRIPTOR.message_types_by_name['GetTokenStatusesRequest'] = _GETTOKENSTATUSESREQUEST DESCRIPTOR.message_types_by_name['GetTokenStatusesResponse'] = _GETTOKENSTATUSESRESPONSE -DESCRIPTOR.message_types_by_name['GetTokenDirectPurchasePricesRequest'] = _GETTOKENDIRECTPURCHASEPRICESREQUEST DESCRIPTOR.message_types_by_name['GetTokenDirectPurchasePricesResponse'] = _GETTOKENDIRECTPURCHASEPRICESRESPONSE +DESCRIPTOR.message_types_by_name['GetTokenDirectPurchasePricesRequest'] = _GETTOKENDIRECTPURCHASEPRICESREQUEST DESCRIPTOR.message_types_by_name['GetTokenPreProgrammedDistributionsRequest'] = _GETTOKENPREPROGRAMMEDDISTRIBUTIONSREQUEST DESCRIPTOR.message_types_by_name['GetTokenPreProgrammedDistributionsResponse'] = _GETTOKENPREPROGRAMMEDDISTRIBUTIONSRESPONSE DESCRIPTOR.message_types_by_name['GetTokenTotalSupplyRequest'] = _GETTOKENTOTALSUPPLYREQUEST @@ -15190,21 +15149,6 @@ _sym_db.RegisterMessage(GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry) _sym_db.RegisterMessage(GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses) -GetTokenDirectPurchasePricesRequest = _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesRequest', (_message.Message,), { - - 'GetTokenDirectPurchasePricesRequestV0' : _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesRequestV0', (_message.Message,), { - 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) - }) - , - 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESREQUEST, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest) - }) -_sym_db.RegisterMessage(GetTokenDirectPurchasePricesRequest) -_sym_db.RegisterMessage(GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) - GetTokenDirectPurchasePricesResponse = _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesResponse', (_message.Message,), { 'GetTokenDirectPurchasePricesResponseV0' : _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesResponseV0', (_message.Message,), { @@ -15223,13 +15167,6 @@ }) , - 'Price' : _reflection.GeneratedProtocolMessageType('Price', (_message.Message,), { - 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_PRICE, - '__module__' : 'platform_pb2' - # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price) - }) - , - 'TokenDirectPurchasePriceEntry' : _reflection.GeneratedProtocolMessageType('TokenDirectPurchasePriceEntry', (_message.Message,), { 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESRESPONSE_GETTOKENDIRECTPURCHASEPRICESRESPONSEV0_TOKENDIRECTPURCHASEPRICEENTRY, '__module__' : 'platform_pb2' @@ -15256,10 +15193,24 @@ _sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0) _sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity) _sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule) -_sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price) _sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry) _sym_db.RegisterMessage(GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices) +GetTokenDirectPurchasePricesRequest = _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesRequest', (_message.Message,), { + + 'GetTokenDirectPurchasePricesRequestV0' : _reflection.GeneratedProtocolMessageType('GetTokenDirectPurchasePricesRequestV0', (_message.Message,), { + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESREQUEST_GETTOKENDIRECTPURCHASEPRICESREQUESTV0, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) + }) + , + 'DESCRIPTOR' : _GETTOKENDIRECTPURCHASEPRICESREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest) + }) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesRequest) +_sym_db.RegisterMessage(GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) + GetTokenPreProgrammedDistributionsRequest = _reflection.GeneratedProtocolMessageType('GetTokenPreProgrammedDistributionsRequest', (_message.Message,), { 'GetTokenPreProgrammedDistributionsRequestV0' : _reflection.GeneratedProtocolMessageType('GetTokenPreProgrammedDistributionsRequestV0', (_message.Message,), { @@ -15764,8 +15715,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=46565, - serialized_end=52793, + serialized_start=46414, + serialized_end=52642, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts index 75201acf3d8..11dd344c487 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts @@ -6636,62 +6636,6 @@ export namespace GetTokenStatusesResponse { } } -export class GetTokenDirectPurchasePricesRequest extends jspb.Message { - hasV0(): boolean; - clearV0(): void; - getV0(): GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 | undefined; - setV0(value?: GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0): void; - - getVersionCase(): GetTokenDirectPurchasePricesRequest.VersionCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetTokenDirectPurchasePricesRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetTokenDirectPurchasePricesRequest): GetTokenDirectPurchasePricesRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetTokenDirectPurchasePricesRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetTokenDirectPurchasePricesRequest; - static deserializeBinaryFromReader(message: GetTokenDirectPurchasePricesRequest, reader: jspb.BinaryReader): GetTokenDirectPurchasePricesRequest; -} - -export namespace GetTokenDirectPurchasePricesRequest { - export type AsObject = { - v0?: GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.AsObject, - } - - export class GetTokenDirectPurchasePricesRequestV0 extends jspb.Message { - clearTokenIdsList(): void; - getTokenIdsList(): Array; - getTokenIdsList_asU8(): Array; - getTokenIdsList_asB64(): Array; - setTokenIdsList(value: Array): void; - addTokenIds(value: Uint8Array | string, index?: number): Uint8Array | string; - - getProve(): boolean; - setProve(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetTokenDirectPurchasePricesRequestV0.AsObject; - static toObject(includeInstance: boolean, msg: GetTokenDirectPurchasePricesRequestV0): GetTokenDirectPurchasePricesRequestV0.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetTokenDirectPurchasePricesRequestV0, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetTokenDirectPurchasePricesRequestV0; - static deserializeBinaryFromReader(message: GetTokenDirectPurchasePricesRequestV0, reader: jspb.BinaryReader): GetTokenDirectPurchasePricesRequestV0; - } - - export namespace GetTokenDirectPurchasePricesRequestV0 { - export type AsObject = { - tokenIdsList: Array, - prove: boolean, - } - } - - export enum VersionCase { - VERSION_NOT_SET = 0, - V0 = 1, - } -} - export class GetTokenDirectPurchasePricesResponse extends jspb.Message { hasV0(): boolean; clearV0(): void; @@ -6794,7 +6738,12 @@ export namespace GetTokenDirectPurchasePricesResponse { } } - export class Price extends jspb.Message { + export class TokenDirectPurchasePriceEntry extends jspb.Message { + getTokenId(): Uint8Array | string; + getTokenId_asU8(): Uint8Array; + getTokenId_asB64(): string; + setTokenId(value: Uint8Array | string): void; + hasFixedPrice(): boolean; clearFixedPrice(): void; getFixedPrice(): number; @@ -6805,41 +6754,7 @@ export namespace GetTokenDirectPurchasePricesResponse { getVariablePrice(): GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule | undefined; setVariablePrice(value?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule): void; - getPriceCase(): Price.PriceCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Price.AsObject; - static toObject(includeInstance: boolean, msg: Price): Price.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Price, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Price; - static deserializeBinaryFromReader(message: Price, reader: jspb.BinaryReader): Price; - } - - export namespace Price { - export type AsObject = { - fixedPrice: number, - variablePrice?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.AsObject, - } - - export enum PriceCase { - PRICE_NOT_SET = 0, - FIXED_PRICE = 1, - VARIABLE_PRICE = 2, - } - } - - export class TokenDirectPurchasePriceEntry extends jspb.Message { - getTokenId(): Uint8Array | string; - getTokenId_asU8(): Uint8Array; - getTokenId_asB64(): string; - setTokenId(value: Uint8Array | string): void; - - hasPrice(): boolean; - clearPrice(): void; - getPrice(): GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price | undefined; - setPrice(value?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price): void; - + getPriceCase(): TokenDirectPurchasePriceEntry.PriceCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TokenDirectPurchasePriceEntry.AsObject; static toObject(includeInstance: boolean, msg: TokenDirectPurchasePriceEntry): TokenDirectPurchasePriceEntry.AsObject; @@ -6853,7 +6768,14 @@ export namespace GetTokenDirectPurchasePricesResponse { export namespace TokenDirectPurchasePriceEntry { export type AsObject = { tokenId: Uint8Array | string, - price?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.AsObject, + fixedPrice: number, + variablePrice?: GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.AsObject, + } + + export enum PriceCase { + PRICE_NOT_SET = 0, + FIXED_PRICE = 2, + VARIABLE_PRICE = 3, } } @@ -6892,6 +6814,62 @@ export namespace GetTokenDirectPurchasePricesResponse { } } +export class GetTokenDirectPurchasePricesRequest extends jspb.Message { + hasV0(): boolean; + clearV0(): void; + getV0(): GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 | undefined; + setV0(value?: GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0): void; + + getVersionCase(): GetTokenDirectPurchasePricesRequest.VersionCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetTokenDirectPurchasePricesRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetTokenDirectPurchasePricesRequest): GetTokenDirectPurchasePricesRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetTokenDirectPurchasePricesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetTokenDirectPurchasePricesRequest; + static deserializeBinaryFromReader(message: GetTokenDirectPurchasePricesRequest, reader: jspb.BinaryReader): GetTokenDirectPurchasePricesRequest; +} + +export namespace GetTokenDirectPurchasePricesRequest { + export type AsObject = { + v0?: GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.AsObject, + } + + export class GetTokenDirectPurchasePricesRequestV0 extends jspb.Message { + clearTokenIdsList(): void; + getTokenIdsList(): Array; + getTokenIdsList_asU8(): Array; + getTokenIdsList_asB64(): Array; + setTokenIdsList(value: Array): void; + addTokenIds(value: Uint8Array | string, index?: number): Uint8Array | string; + + getProve(): boolean; + setProve(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetTokenDirectPurchasePricesRequestV0.AsObject; + static toObject(includeInstance: boolean, msg: GetTokenDirectPurchasePricesRequestV0): GetTokenDirectPurchasePricesRequestV0.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetTokenDirectPurchasePricesRequestV0, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetTokenDirectPurchasePricesRequestV0; + static deserializeBinaryFromReader(message: GetTokenDirectPurchasePricesRequestV0, reader: jspb.BinaryReader): GetTokenDirectPurchasePricesRequestV0; + } + + export namespace GetTokenDirectPurchasePricesRequestV0 { + export type AsObject = { + tokenIdsList: Array, + prove: boolean, + } + } + + export enum VersionCase { + VERSION_NOT_SET = 0, + V0 = 1, + } +} + export class GetTokenPreProgrammedDistributionsRequest extends jspb.Message { hasV0(): boolean; clearV0(): void; diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js index 388fe00b802..ad8743c4214 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js @@ -367,12 +367,11 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesR goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price', null, { proto }); -goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.PriceCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.VersionCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest', null, { proto }); @@ -4879,37 +4878,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_); -}; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse'; } /** * Generated by JsPbCodeGenerator. @@ -4921,16 +4899,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0'; } /** * Generated by JsPbCodeGenerator. @@ -4942,16 +4920,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity'; } /** * Generated by JsPbCodeGenerator. @@ -4963,16 +4941,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule'; } /** * Generated by JsPbCodeGenerator. @@ -4984,16 +4962,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry'; } /** * Generated by JsPbCodeGenerator. @@ -5005,16 +4983,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices'; } /** * Generated by JsPbCodeGenerator. @@ -5026,16 +5004,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest'; } /** * Generated by JsPbCodeGenerator. @@ -5047,16 +5025,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices'; + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.displayName = 'proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0'; } /** * Generated by JsPbCodeGenerator. @@ -51984,392 +51962,6 @@ proto.org.dash.platform.dapi.v0.GetTokenStatusesResponse.prototype.hasV0 = funct -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase = { - VERSION_NOT_SET: 0, - V0: 1 -}; - -/** - * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getVersionCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject = function(includeInstance, msg) { - var f, obj = { - v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest; - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader); - msg.setV0(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getV0(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject = function(includeInstance, msg) { - var f, obj = { - tokenIdsList: msg.getTokenIdsList_asB64(), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addTokenIds(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setProve(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTokenIdsList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 1, - f - ); - } - f = message.getProve(); - if (f) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * repeated bytes token_ids = 1; - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * repeated bytes token_ids = 1; - * This is a type-conversion wrapper around `getTokenIdsList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getTokenIdsList())); -}; - - -/** - * repeated bytes token_ids = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTokenIdsList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getTokenIdsList())); -}; - - -/** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setTokenIdsList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.addTokenIds = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.clearTokenIdsList = function() { - return this.setTokenIdsList([]); -}; - - -/** - * optional bool prove = 2; - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - -/** - * optional GetTokenDirectPurchasePricesRequestV0 v0 = 1; - * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getV0 = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, 1)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this -*/ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.setV0 = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.clearV0 = function() { - return this.setV0(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.hasV0 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -53005,225 +52597,26 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_ = [[1,2]]; +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_ = [[2,3]]; /** * @enum {number} */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase = { +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.PriceCase = { PRICE_NOT_SET: 0, - FIXED_PRICE: 1, - VARIABLE_PRICE: 2 + FIXED_PRICE: 2, + VARIABLE_PRICE: 3 }; /** - * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase} + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.PriceCase} */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getPriceCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.PriceCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0])); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getPriceCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.PriceCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_[0])); }; -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject = function(includeInstance, msg) { - var f, obj = { - fixedPrice: jspb.Message.getFieldWithDefault(msg, 1, 0), - variablePrice: (f = msg.getVariablePrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price; - return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setFixedPrice(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader); - msg.setVariablePrice(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeUint64( - 1, - f - ); - } - f = message.getVariablePrice(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter - ); - } -}; - - -/** - * optional uint64 fixed_price = 1; - * @return {number} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getFixedPrice = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.setFixedPrice = function(value) { - return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.clearFixedPrice = function() { - return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.hasFixedPrice = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional PricingSchedule variable_price = 2; - * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.getVariablePrice = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, 2)); -}; - - -/** - * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this -*/ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.setVariablePrice = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} returns this - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.clearVariablePrice = function() { - return this.setVariablePrice(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.prototype.hasVariablePrice = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - - - if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -53254,7 +52647,8 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject = function(includeInstance, msg) { var f, obj = { tokenId: msg.getTokenId_asB64(), - price: (f = msg.getPrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.toObject(includeInstance, f) + fixedPrice: jspb.Message.getFieldWithDefault(msg, 2, 0), + variablePrice: (f = msg.getVariablePrice()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(includeInstance, f) }; if (includeInstance) { @@ -53296,9 +52690,13 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir msg.setTokenId(value); break; case 2: - var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.deserializeBinaryFromReader); - msg.setPrice(value); + var value = /** @type {number} */ (reader.readUint64()); + msg.setFixedPrice(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.deserializeBinaryFromReader); + msg.setVariablePrice(value); break; default: reader.skipField(); @@ -53336,12 +52734,19 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir f ); } - f = message.getPrice(); + f = /** @type {number} */ (jspb.Message.getField(message, 2)); if (f != null) { - writer.writeMessage( + writer.writeUint64( 2, + f + ); + } + f = message.getVariablePrice(); + if (f != null) { + writer.writeMessage( + 3, f, - proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.serializeBinaryToWriter ); } }; @@ -53390,21 +52795,57 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir /** - * optional Price price = 2; - * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} + * optional uint64 fixed_price = 2; + * @return {number} */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getPrice = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price, 2)); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getFixedPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.Price|undefined} value + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setFixedPrice = function(value) { + return jspb.Message.setOneofField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.clearFixedPrice = function() { + return jspb.Message.setOneofField(this, 2, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.hasFixedPrice = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional PricingSchedule variable_price = 3; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.getVariablePrice = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule|undefined} value * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setPrice = function(value) { - return jspb.Message.setWrapperField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.setVariablePrice = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.oneofGroups_[0], value); }; @@ -53412,8 +52853,8 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir * Clears the message field making it undefined. * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.clearPrice = function() { - return this.setPrice(undefined); +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.clearVariablePrice = function() { + return this.setVariablePrice(undefined); }; @@ -53421,8 +52862,8 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDir * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.hasPrice = function() { - return jspb.Message.getField(this, 2) != null; +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.prototype.hasVariablePrice = function() { + return jspb.Message.getField(this, 3) != null; }; @@ -53735,6 +53176,392 @@ proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.prototype.h +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase = { + VERSION_NOT_SET: 0, + V0: 1 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getVersionCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.VersionCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + v0: (f = msg.getV0()) && proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader); + msg.setV0(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getV0(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject = function(includeInstance, msg) { + var f, obj = { + tokenIdsList: msg.getTokenIdsList_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0; + return proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addTokenIds(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTokenIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * repeated bytes token_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes token_ids = 1; + * This is a type-conversion wrapper around `getTokenIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getTokenIdsList())); +}; + + +/** + * repeated bytes token_ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getTokenIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getTokenIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setTokenIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.addTokenIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.clearTokenIdsList = function() { + return this.setTokenIdsList([]); +}; + + +/** + * optional bool prove = 2; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional GetTokenDirectPurchasePricesRequestV0 v0 = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.getV0 = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.setV0 = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.clearV0 = function() { + return this.setV0(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.prototype.hasV0 = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index ddc8ca417b6..0b735b67ea0 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -11,18 +11,23 @@ service Platform { returns (BroadcastStateTransitionResponse); rpc getIdentity(GetIdentityRequest) returns (GetIdentityResponse); rpc getIdentityKeys(GetIdentityKeysRequest) returns (GetIdentityKeysResponse); - rpc getIdentitiesContractKeys(GetIdentitiesContractKeysRequest) returns (GetIdentitiesContractKeysResponse); - rpc getIdentityNonce(GetIdentityNonceRequest) returns (GetIdentityNonceResponse); - rpc getIdentityContractNonce(GetIdentityContractNonceRequest) returns (GetIdentityContractNonceResponse); + rpc getIdentitiesContractKeys(GetIdentitiesContractKeysRequest) + returns (GetIdentitiesContractKeysResponse); + rpc getIdentityNonce(GetIdentityNonceRequest) + returns (GetIdentityNonceResponse); + rpc getIdentityContractNonce(GetIdentityContractNonceRequest) + returns (GetIdentityContractNonceResponse); rpc getIdentityBalance(GetIdentityBalanceRequest) returns (GetIdentityBalanceResponse); rpc getIdentitiesBalances(GetIdentitiesBalancesRequest) returns (GetIdentitiesBalancesResponse); rpc getIdentityBalanceAndRevision(GetIdentityBalanceAndRevisionRequest) returns (GetIdentityBalanceAndRevisionResponse); - rpc getEvonodesProposedEpochBlocksByIds(GetEvonodesProposedEpochBlocksByIdsRequest) + rpc getEvonodesProposedEpochBlocksByIds( + GetEvonodesProposedEpochBlocksByIdsRequest) returns (GetEvonodesProposedEpochBlocksResponse); - rpc getEvonodesProposedEpochBlocksByRange(GetEvonodesProposedEpochBlocksByRangeRequest) + rpc getEvonodesProposedEpochBlocksByRange( + GetEvonodesProposedEpochBlocksByRangeRequest) returns (GetEvonodesProposedEpochBlocksResponse); rpc getDataContract(GetDataContractRequest) returns (GetDataContractResponse); rpc getDataContractHistory(GetDataContractHistoryRequest) @@ -36,56 +41,80 @@ service Platform { returns (WaitForStateTransitionResultResponse); rpc getConsensusParams(GetConsensusParamsRequest) returns (GetConsensusParamsResponse); - rpc getProtocolVersionUpgradeState(GetProtocolVersionUpgradeStateRequest) returns (GetProtocolVersionUpgradeStateResponse); - rpc getProtocolVersionUpgradeVoteStatus(GetProtocolVersionUpgradeVoteStatusRequest) returns (GetProtocolVersionUpgradeVoteStatusResponse); + rpc getProtocolVersionUpgradeState(GetProtocolVersionUpgradeStateRequest) + returns (GetProtocolVersionUpgradeStateResponse); + rpc getProtocolVersionUpgradeVoteStatus( + GetProtocolVersionUpgradeVoteStatusRequest) + returns (GetProtocolVersionUpgradeVoteStatusResponse); rpc getEpochsInfo(GetEpochsInfoRequest) returns (GetEpochsInfoResponse); // What votes are currently happening for a specific contested index - rpc getContestedResources(GetContestedResourcesRequest) returns (GetContestedResourcesResponse); + rpc getContestedResources(GetContestedResourcesRequest) + returns (GetContestedResourcesResponse); // What's the state of a contested resource vote? (ie who is winning?) - rpc getContestedResourceVoteState(GetContestedResourceVoteStateRequest) returns (GetContestedResourceVoteStateResponse); + rpc getContestedResourceVoteState(GetContestedResourceVoteStateRequest) + returns (GetContestedResourceVoteStateResponse); // Who voted for a contested resource to go to a specific identity? - rpc getContestedResourceVotersForIdentity(GetContestedResourceVotersForIdentityRequest) returns (GetContestedResourceVotersForIdentityResponse); + rpc getContestedResourceVotersForIdentity( + GetContestedResourceVotersForIdentityRequest) + returns (GetContestedResourceVotersForIdentityResponse); // How did an identity vote? - rpc getContestedResourceIdentityVotes(GetContestedResourceIdentityVotesRequest) returns (GetContestedResourceIdentityVotesResponse); + rpc getContestedResourceIdentityVotes( + GetContestedResourceIdentityVotesRequest) + returns (GetContestedResourceIdentityVotesResponse); // What vote polls will end soon? - rpc getVotePollsByEndDate(GetVotePollsByEndDateRequest) returns (GetVotePollsByEndDateResponse); - rpc getPrefundedSpecializedBalance(GetPrefundedSpecializedBalanceRequest) returns (GetPrefundedSpecializedBalanceResponse); - rpc getTotalCreditsInPlatform(GetTotalCreditsInPlatformRequest) returns (GetTotalCreditsInPlatformResponse); + rpc getVotePollsByEndDate(GetVotePollsByEndDateRequest) + returns (GetVotePollsByEndDateResponse); + rpc getPrefundedSpecializedBalance(GetPrefundedSpecializedBalanceRequest) + returns (GetPrefundedSpecializedBalanceResponse); + rpc getTotalCreditsInPlatform(GetTotalCreditsInPlatformRequest) + returns (GetTotalCreditsInPlatformResponse); rpc getPathElements(GetPathElementsRequest) returns (GetPathElementsResponse); rpc getStatus(GetStatusRequest) returns (GetStatusResponse); - rpc getCurrentQuorumsInfo(GetCurrentQuorumsInfoRequest) returns (GetCurrentQuorumsInfoResponse); - rpc getIdentityTokenBalances(GetIdentityTokenBalancesRequest) returns (GetIdentityTokenBalancesResponse); - rpc getIdentitiesTokenBalances(GetIdentitiesTokenBalancesRequest) returns (GetIdentitiesTokenBalancesResponse); - rpc getIdentityTokenInfos(GetIdentityTokenInfosRequest) returns (GetIdentityTokenInfosResponse); - rpc getIdentitiesTokenInfos(GetIdentitiesTokenInfosRequest) returns (GetIdentitiesTokenInfosResponse); - rpc getTokenStatuses(GetTokenStatusesRequest) returns (GetTokenStatusesResponse); - rpc getTokenDirectPurchasePrices(GetTokenDirectPurchasePricesRequest) returns (GetTokenDirectPurchasePricesResponse); - rpc getTokenPreProgrammedDistributions(GetTokenPreProgrammedDistributionsRequest) returns (GetTokenPreProgrammedDistributionsResponse); - rpc getTokenTotalSupply(GetTokenTotalSupplyRequest) returns (GetTokenTotalSupplyResponse); + rpc getCurrentQuorumsInfo(GetCurrentQuorumsInfoRequest) + returns (GetCurrentQuorumsInfoResponse); + rpc getIdentityTokenBalances(GetIdentityTokenBalancesRequest) + returns (GetIdentityTokenBalancesResponse); + rpc getIdentitiesTokenBalances(GetIdentitiesTokenBalancesRequest) + returns (GetIdentitiesTokenBalancesResponse); + rpc getIdentityTokenInfos(GetIdentityTokenInfosRequest) + returns (GetIdentityTokenInfosResponse); + rpc getIdentitiesTokenInfos(GetIdentitiesTokenInfosRequest) + returns (GetIdentitiesTokenInfosResponse); + rpc getTokenStatuses(GetTokenStatusesRequest) + returns (GetTokenStatusesResponse); + rpc getTokenDirectPurchasePrices(GetTokenDirectPurchasePricesRequest) + returns (GetTokenDirectPurchasePricesResponse); + rpc getTokenPreProgrammedDistributions( + GetTokenPreProgrammedDistributionsRequest) + returns (GetTokenPreProgrammedDistributionsResponse); + rpc getTokenTotalSupply(GetTokenTotalSupplyRequest) + returns (GetTokenTotalSupplyResponse); rpc getGroupInfo(GetGroupInfoRequest) returns (GetGroupInfoResponse); rpc getGroupInfos(GetGroupInfosRequest) returns (GetGroupInfosResponse); rpc getGroupActions(GetGroupActionsRequest) returns (GetGroupActionsResponse); - rpc getGroupActionSigners(GetGroupActionSignersRequest) returns (GetGroupActionSignersResponse); + rpc getGroupActionSigners(GetGroupActionSignersRequest) + returns (GetGroupActionSignersResponse); } // Proof message includes cryptographic proofs for validating responses message Proof { - bytes grovedb_proof = 1; // GroveDB proof for the data - bytes quorum_hash = 2; // Hash of the quorum validating the data - bytes signature = 3; // Signature proving data authenticity - uint32 round = 4; // Consensus round number - bytes block_id_hash = 5; // Hash of the block ID - uint32 quorum_type = 6; // Type of the quorum + bytes grovedb_proof = 1; // GroveDB proof for the data + bytes quorum_hash = 2; // Hash of the quorum validating the data + bytes signature = 3; // Signature proving data authenticity + uint32 round = 4; // Consensus round number + bytes block_id_hash = 5; // Hash of the block ID + uint32 quorum_type = 6; // Type of the quorum } -// ResponseMetadata provides metadata about the blockchain state at the time of response +// ResponseMetadata provides metadata about the blockchain state at the time of +// response message ResponseMetadata { - uint64 height = 1 [jstype = JS_STRING]; // Current blockchain height - uint32 core_chain_locked_height = 2; // Latest known core height in consensus - uint32 epoch = 3; // Current epoch number - uint64 time_ms = 4 [jstype = JS_STRING]; // Timestamp in milliseconds - uint32 protocol_version = 5; // Protocol version - string chain_id = 6; // Identifier of the blockchain + uint64 height = 1 [ jstype = JS_STRING ]; // Current blockchain height + uint32 core_chain_locked_height = 2; // Latest known core height in consensus + uint32 epoch = 3; // Current epoch number + uint64 time_ms = 4 [ jstype = JS_STRING ]; // Timestamp in milliseconds + uint32 protocol_version = 5; // Protocol version + string chain_id = 6; // Identifier of the blockchain } message StateTransitionBroadcastError { @@ -109,8 +138,8 @@ message BroadcastStateTransitionResponse {} message GetIdentityRequest { message GetIdentityRequestV0 { - bytes id = 1; // The ID of the identity being requested - bool prove = 2; // Flag to request a proof as the response + bytes id = 1; // The ID of the identity being requested + bool prove = 2; // Flag to request a proof as the response } oneof version { GetIdentityRequestV0 v0 = 1; } @@ -126,7 +155,6 @@ message GetIdentityNonceRequest { oneof version { GetIdentityNonceRequestV0 v0 = 1; } } - message GetIdentityContractNonceRequest { message GetIdentityContractNonceRequestV0 { @@ -141,8 +169,8 @@ message GetIdentityContractNonceRequest { message GetIdentityBalanceRequest { message GetIdentityBalanceRequestV0 { - bytes id = 1; // ID of the identity whose balance is requested - bool prove = 2; // Flag to request a proof as the response + bytes id = 1; // ID of the identity whose balance is requested + bool prove = 2; // Flag to request a proof as the response } oneof version { GetIdentityBalanceRequestV0 v0 = 1; } @@ -151,8 +179,8 @@ message GetIdentityBalanceRequest { message GetIdentityBalanceAndRevisionRequest { message GetIdentityBalanceAndRevisionRequestV0 { - bytes id = 1; // ID of the identity for balance and revision - bool prove = 2; // Flag to request a proof as the response + bytes id = 1; // ID of the identity for balance and revision + bool prove = 2; // Flag to request a proof as the response } oneof version { GetIdentityBalanceAndRevisionRequestV0 v0 = 1; } @@ -162,10 +190,10 @@ message GetIdentityResponse { message GetIdentityResponseV0 { oneof result { - bytes identity = 1; // The requested identity data - Proof proof = 2; // Proof of the identity data, if requested + bytes identity = 1; // The requested identity data + Proof proof = 2; // Proof of the identity data, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetIdentityResponseV0 v0 = 1; } @@ -175,7 +203,7 @@ message GetIdentityNonceResponse { message GetIdentityNonceResponseV0 { oneof result { - uint64 identity_nonce = 1 [jstype = JS_STRING]; + uint64 identity_nonce = 1 [ jstype = JS_STRING ]; Proof proof = 2; } ResponseMetadata metadata = 3; @@ -188,7 +216,7 @@ message GetIdentityContractNonceResponse { message GetIdentityContractNonceResponseV0 { oneof result { - uint64 identity_contract_nonce = 1 [jstype = JS_STRING]; + uint64 identity_contract_nonce = 1 [ jstype = JS_STRING ]; Proof proof = 2; } ResponseMetadata metadata = 3; @@ -201,10 +229,11 @@ message GetIdentityBalanceResponse { message GetIdentityBalanceResponseV0 { oneof result { - uint64 balance = 1 [jstype = JS_STRING]; // The balance of the requested identity - Proof proof = 2; // Proof of the balance, if requested + uint64 balance = 1 + [ jstype = JS_STRING ]; // The balance of the requested identity + Proof proof = 2; // Proof of the balance, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetIdentityBalanceResponseV0 v0 = 1; } @@ -214,15 +243,17 @@ message GetIdentityBalanceAndRevisionResponse { message GetIdentityBalanceAndRevisionResponseV0 { message BalanceAndRevision { - uint64 balance = 1 [jstype = JS_STRING]; // Balance of the identity - uint64 revision = 2 [jstype = JS_STRING]; // Revision number of the identity + uint64 balance = 1 [ jstype = JS_STRING ]; // Balance of the identity + uint64 revision = 2 + [ jstype = JS_STRING ]; // Revision number of the identity } oneof result { - BalanceAndRevision balance_and_revision = 1; // The balance and revision data - Proof proof = 2; // Proof of the data, if requested + BalanceAndRevision balance_and_revision = + 1; // The balance and revision data + Proof proof = 2; // Proof of the data, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetIdentityBalanceAndRevisionResponseV0 v0 = 1; } @@ -230,9 +261,9 @@ message GetIdentityBalanceAndRevisionResponse { message KeyRequestType { oneof request { - AllKeys all_keys = 1; // Request for all keys - SpecificKeys specific_keys = 2; // Request for specific keys by their IDs - SearchKey search_key = 3; // Request for keys based on a search criteria + AllKeys all_keys = 1; // Request for all keys + SpecificKeys specific_keys = 2; // Request for specific keys by their IDs + SearchKey search_key = 3; // Request for keys based on a search criteria } } @@ -241,31 +272,37 @@ message AllKeys {} // SpecificKeys is used to request specific keys by their IDs message SpecificKeys { - repeated uint32 key_ids = 1; // List of key IDs + repeated uint32 key_ids = 1; // List of key IDs } // SearchKey represents a request to search for keys based on specific criteria message SearchKey { - map purpose_map = 1; // Map of purposes to their security level maps + map purpose_map = + 1; // Map of purposes to their security level maps } // SecurityLevelMap maps security levels to a request type for key retrieval message SecurityLevelMap { enum KeyKindRequestType { - CURRENT_KEY_OF_KIND_REQUEST = 0; // Request the current key of a particular kind - ALL_KEYS_OF_KIND_REQUEST = 1; // Request all keys of a particular kind + CURRENT_KEY_OF_KIND_REQUEST = + 0; // Request the current key of a particular kind + ALL_KEYS_OF_KIND_REQUEST = 1; // Request all keys of a particular kind } - map security_level_map = 1; // Maps security levels to key request types + map security_level_map = + 1; // Maps security levels to key request types } message GetIdentityKeysRequest { message GetIdentityKeysRequestV0 { - bytes identity_id = 1; // ID of the identity for key retrieval - KeyRequestType request_type = 2; // Type of key request: all, specific, or search - google.protobuf.UInt32Value limit = 3; // Limit on the number of keys to be returned - google.protobuf.UInt32Value offset = 4; // Offset for pagination through the keys - bool prove = 5; // Flag to request a proof as the response + bytes identity_id = 1; // ID of the identity for key retrieval + KeyRequestType request_type = + 2; // Type of key request: all, specific, or search + google.protobuf.UInt32Value limit = + 3; // Limit on the number of keys to be returned + google.protobuf.UInt32Value offset = + 4; // Offset for pagination through the keys + bool prove = 5; // Flag to request a proof as the response } oneof version { GetIdentityKeysRequestV0 v0 = 1; } @@ -274,13 +311,15 @@ message GetIdentityKeysRequest { message GetIdentityKeysResponse { message GetIdentityKeysResponseV0 { - message Keys { repeated bytes keys_bytes = 1; } // Collection of keys as byte sequences + message Keys { + repeated bytes keys_bytes = 1; + } // Collection of keys as byte sequences oneof result { - Keys keys = 1; // The actual key data - Proof proof = 2; // Proof of the keys data, if requested + Keys keys = 1; // The actual key data + Proof proof = 2; // Proof of the keys data, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetIdentityKeysResponseV0 v0 = 1; } } @@ -294,9 +333,7 @@ message GetIdentitiesContractKeysRequest { bool prove = 5; } - oneof version { - GetIdentitiesContractKeysRequestV0 v0 = 1; - } + oneof version { GetIdentitiesContractKeysRequestV0 v0 = 1; } } message GetIdentitiesContractKeysResponse { @@ -311,9 +348,7 @@ message GetIdentitiesContractKeysResponse { repeated PurposeKeys keys = 2; } - message IdentitiesKeys { - repeated IdentityKeys entries = 1; - }; + message IdentitiesKeys { repeated IdentityKeys entries = 1; }; oneof result { IdentitiesKeys identities_keys = 1; @@ -328,9 +363,11 @@ message GetIdentitiesContractKeysResponse { message GetEvonodesProposedEpochBlocksByIdsRequest { message GetEvonodesProposedEpochBlocksByIdsRequestV0 { - optional uint32 epoch = 1; // The epoch we are querying for, if none is set, get current epoch - repeated bytes ids = 2; // IDs of the evonodes for which we want to get their proposed blocks - bool prove = 3; // Flag to request a proof as the response + optional uint32 epoch = + 1; // The epoch we are querying for, if none is set, get current epoch + repeated bytes ids = + 2; // IDs of the evonodes for which we want to get their proposed blocks + bool prove = 3; // Flag to request a proof as the response } oneof version { GetEvonodesProposedEpochBlocksByIdsRequestV0 v0 = 1; } @@ -341,7 +378,7 @@ message GetEvonodesProposedEpochBlocksResponse { message GetEvonodesProposedEpochBlocksResponseV0 { message EvonodeProposedBlocks { bytes pro_tx_hash = 1; - uint64 count = 2 [jstype = JS_STRING]; + uint64 count = 2 [ jstype = JS_STRING ]; } message EvonodesProposedBlocks { @@ -349,10 +386,11 @@ message GetEvonodesProposedEpochBlocksResponse { } oneof result { - EvonodesProposedBlocks evonodes_proposed_block_counts_info = 1; // The actual result - Proof proof = 2; // Proof of the keys data, if requested + EvonodesProposedBlocks evonodes_proposed_block_counts_info = + 1; // The actual result + Proof proof = 2; // Proof of the keys data, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetEvonodesProposedEpochBlocksResponseV0 v0 = 1; } } @@ -360,13 +398,15 @@ message GetEvonodesProposedEpochBlocksResponse { message GetEvonodesProposedEpochBlocksByRangeRequest { message GetEvonodesProposedEpochBlocksByRangeRequestV0 { - optional uint32 epoch = 1; // The epoch we are querying for, if none is set, get current epoch - optional uint32 limit = 2; // Maximum number of evonodes proposed epoch blocks to return + optional uint32 epoch = + 1; // The epoch we are querying for, if none is set, get current epoch + optional uint32 limit = + 2; // Maximum number of evonodes proposed epoch blocks to return oneof start { - bytes start_after = 3; // Start retrieval after this document - bytes start_at = 4; // Start retrieval at this document + bytes start_after = 3; // Start retrieval after this document + bytes start_at = 4; // Start retrieval at this document } - bool prove = 5; // Flag to request a proof as the response + bool prove = 5; // Flag to request a proof as the response } oneof version { GetEvonodesProposedEpochBlocksByRangeRequestV0 v0 = 1; } @@ -378,21 +418,17 @@ message GetIdentitiesBalancesRequest { bool prove = 2; } - oneof version { - GetIdentitiesBalancesRequestV0 v0 = 1; - } + oneof version { GetIdentitiesBalancesRequestV0 v0 = 1; } } message GetIdentitiesBalancesResponse { message GetIdentitiesBalancesResponseV0 { message IdentityBalance { bytes identity_id = 1; - optional uint64 balance = 2 [jstype = JS_STRING]; + optional uint64 balance = 2 [ jstype = JS_STRING ]; } - message IdentitiesBalances { - repeated IdentityBalance entries = 1; - }; + message IdentitiesBalances { repeated IdentityBalance entries = 1; }; oneof result { IdentitiesBalances identities_balances = 1; @@ -406,8 +442,8 @@ message GetIdentitiesBalancesResponse { message GetDataContractRequest { message GetDataContractRequestV0 { - bytes id = 1; // The ID of the data contract being requested - bool prove = 2; // Flag to request a proof as the response + bytes id = 1; // The ID of the data contract being requested + bool prove = 2; // Flag to request a proof as the response } oneof version { GetDataContractRequestV0 v0 = 1; } } @@ -415,50 +451,58 @@ message GetDataContractRequest { message GetDataContractResponse { message GetDataContractResponseV0 { oneof result { - bytes data_contract = 1; // The actual data contract in binary form - Proof proof = 2; // Cryptographic proof of the data contract, if requested + bytes data_contract = 1; // The actual data contract in binary form + Proof proof = 2; // Cryptographic proof of the data contract, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetDataContractResponseV0 v0 = 1; } } message GetDataContractsRequest { message GetDataContractsRequestV0 { - repeated bytes ids = 1; // A list of unique IDs for the data contracts being requested - bool prove = 2; // Flag to request a proof as the response + repeated bytes ids = + 1; // A list of unique IDs for the data contracts being requested + bool prove = 2; // Flag to request a proof as the response } oneof version { GetDataContractsRequestV0 v0 = 1; } } message GetDataContractsResponse { message DataContractEntry { - bytes identifier = 1; // The unique identifier of the data contract - google.protobuf.BytesValue data_contract = 2; // The actual data contract content + bytes identifier = 1; // The unique identifier of the data contract + google.protobuf.BytesValue data_contract = + 2; // The actual data contract content } // DataContracts is a collection of data contract entries. message DataContracts { - repeated DataContractEntry data_contract_entries = 1; // A list of data contract entries + repeated DataContractEntry data_contract_entries = + 1; // A list of data contract entries } message GetDataContractsResponseV0 { oneof result { - DataContracts data_contracts = 1; // The actual data contracts requested - Proof proof = 2; // Cryptographic proof for the data contracts, if requested + DataContracts data_contracts = 1; // The actual data contracts requested + Proof proof = + 2; // Cryptographic proof for the data contracts, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetDataContractsResponseV0 v0 = 1; } } message GetDataContractHistoryRequest { message GetDataContractHistoryRequestV0 { - bytes id = 1; // The unique ID of the data contract - google.protobuf.UInt32Value limit = 2; // The maximum number of history entries to return - google.protobuf.UInt32Value offset = 3; // The offset for pagination through the contract history - uint64 start_at_ms = 4 [jstype = JS_STRING]; // Only return results starting at this time in milliseconds - bool prove = 5; // Flag to request a proof as the response + bytes id = 1; // The unique ID of the data contract + google.protobuf.UInt32Value limit = + 2; // The maximum number of history entries to return + google.protobuf.UInt32Value offset = + 3; // The offset for pagination through the contract history + uint64 start_at_ms = 4 [ + jstype = JS_STRING + ]; // Only return results starting at this time in milliseconds + bool prove = 5; // Flag to request a proof as the response } oneof version { GetDataContractHistoryRequestV0 v0 = 1; } } @@ -467,39 +511,44 @@ message GetDataContractHistoryResponse { message GetDataContractHistoryResponseV0 { // Represents a single entry in the data contract's history message DataContractHistoryEntry { - uint64 date = 1 [jstype = JS_STRING]; // The date of the history entry - bytes value = 2; // The value of the data contract at this point in history + uint64 date = 1 [ jstype = JS_STRING ]; // The date of the history entry + bytes value = + 2; // The value of the data contract at this point in history } // Collection of data contract history entries message DataContractHistory { - repeated DataContractHistoryEntry data_contract_entries = 1; // List of history entries + repeated DataContractHistoryEntry data_contract_entries = + 1; // List of history entries } oneof result { - DataContractHistory data_contract_history = 1; // The actual history of the data contract - Proof proof = 2; // Cryptographic proof of the data contract history, if requested + DataContractHistory data_contract_history = + 1; // The actual history of the data contract + Proof proof = + 2; // Cryptographic proof of the data contract history, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetDataContractHistoryResponseV0 v0 = 1; } } message GetDocumentsRequest { message GetDocumentsRequestV0 { - bytes data_contract_id = 1; // The ID of the data contract containing the documents - string document_type = 2; // The type of document being requested - bytes where = 3; // Conditions to be met by the requested documents - bytes order_by = 4; // Ordering criteria for the documents - uint32 limit = 5; // Maximum number of documents to return + bytes data_contract_id = + 1; // The ID of the data contract containing the documents + string document_type = 2; // The type of document being requested + bytes where = 3; // Conditions to be met by the requested documents + bytes order_by = 4; // Ordering criteria for the documents + uint32 limit = 5; // Maximum number of documents to return // Specifies the starting point for the document retrieval oneof start { - bytes start_after = 6; // Start retrieval after this document - bytes start_at = 7; // Start retrieval at this document + bytes start_after = 6; // Start retrieval after this document + bytes start_at = 7; // Start retrieval at this document } - bool prove = 8; // Flag to request a proof as the response + bool prove = 8; // Flag to request a proof as the response } oneof version { GetDocumentsRequestV0 v0 = 1; } } @@ -508,22 +557,23 @@ message GetDocumentsResponse { message GetDocumentsResponseV0 { // Represents a collection of documents message Documents { - repeated bytes documents = 1; // The actual documents in binary form + repeated bytes documents = 1; // The actual documents in binary form } oneof result { - Documents documents = 1; // The actual documents requested - Proof proof = 2; // Cryptographic proof of the documents, if requested + Documents documents = 1; // The actual documents requested + Proof proof = 2; // Cryptographic proof of the documents, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetDocumentsResponseV0 v0 = 1; } } message GetIdentityByPublicKeyHashRequest { message GetIdentityByPublicKeyHashRequestV0 { - bytes public_key_hash = 1; // The public key hash of the identity being requested - bool prove = 2; // Flag to request a proof as the response + bytes public_key_hash = + 1; // The public key hash of the identity being requested + bool prove = 2; // Flag to request a proof as the response } oneof version { GetIdentityByPublicKeyHashRequestV0 v0 = 1; } } @@ -531,19 +581,22 @@ message GetIdentityByPublicKeyHashRequest { message GetIdentityByPublicKeyHashResponse { message GetIdentityByPublicKeyHashResponseV0 { oneof result { - bytes identity = 1; // The actual identity data corresponding to the requested public key hash - Proof proof = 2; // Cryptographic proof for the identity data, if requested + bytes identity = 1; // The actual identity data corresponding to the + // requested public key hash + Proof proof = + 2; // Cryptographic proof for the identity data, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { GetIdentityByPublicKeyHashResponseV0 v0 = 1; } } message WaitForStateTransitionResultRequest { message WaitForStateTransitionResultRequestV0 { - bytes state_transition_hash = 1; // The hash of the state transition to wait for - bool prove = 2; // Flag to request a proof as the response + bytes state_transition_hash = + 1; // The hash of the state transition to wait for + bool prove = 2; // Flag to request a proof as the response } oneof version { WaitForStateTransitionResultRequestV0 v0 = 1; } } @@ -551,155 +604,162 @@ message WaitForStateTransitionResultRequest { message WaitForStateTransitionResultResponse { message WaitForStateTransitionResultResponseV0 { oneof result { - StateTransitionBroadcastError error = 1; // Any error that occurred during the state transition broadcast - Proof proof = 2; // Cryptographic proof for the state transition, if requested + StateTransitionBroadcastError error = + 1; // Any error that occurred during the state transition broadcast + Proof proof = + 2; // Cryptographic proof for the state transition, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } oneof version { WaitForStateTransitionResultResponseV0 v0 = 1; } } message GetConsensusParamsRequest { message GetConsensusParamsRequestV0 { - int32 height = 1; // The blockchain height at which to get the consensus parameters - bool prove = 2; // Flag to request a proof as the response + int32 height = + 1; // The blockchain height at which to get the consensus parameters + bool prove = 2; // Flag to request a proof as the response } oneof version { GetConsensusParamsRequestV0 v0 = 1; } } message GetConsensusParamsResponse { message ConsensusParamsBlock { - string max_bytes = 1; // The maximum size of a block in bytes - string max_gas = 2; // The maximum gas allowed in a block - string time_iota_ms = 3; // The minimum time increment between consecutive blocks, in milliseconds + string max_bytes = 1; // The maximum size of a block in bytes + string max_gas = 2; // The maximum gas allowed in a block + string time_iota_ms = 3; // The minimum time increment between consecutive + // blocks, in milliseconds } message ConsensusParamsEvidence { - string max_age_num_blocks = 1; // The maximum age of evidence, in number of blocks - string max_age_duration = 2; // The maximum age of evidence, as a duration - string max_bytes = 3; // The maximum size of evidence in bytes + string max_age_num_blocks = + 1; // The maximum age of evidence, in number of blocks + string max_age_duration = 2; // The maximum age of evidence, as a duration + string max_bytes = 3; // The maximum size of evidence in bytes } message GetConsensusParamsResponseV0 { - ConsensusParamsBlock block = 1; // Consensus parameters related to block creation and validation - ConsensusParamsEvidence evidence = 2; // Consensus parameters related to evidence + ConsensusParamsBlock block = + 1; // Consensus parameters related to block creation and validation + ConsensusParamsEvidence evidence = + 2; // Consensus parameters related to evidence } oneof version { GetConsensusParamsResponseV0 v0 = 1; } } - message GetProtocolVersionUpgradeStateRequest { message GetProtocolVersionUpgradeStateRequestV0 { - bool prove = 1; // Flag to request a proof as the response + bool prove = 1; // Flag to request a proof as the response } - oneof version { - GetProtocolVersionUpgradeStateRequestV0 v0 = 1; - } + oneof version { GetProtocolVersionUpgradeStateRequestV0 v0 = 1; } } message GetProtocolVersionUpgradeStateResponse { message GetProtocolVersionUpgradeStateResponseV0 { // Versions holds a collection of version entries message Versions { - repeated VersionEntry versions = 1; // List of protocol version entries + repeated VersionEntry versions = 1; // List of protocol version entries } // VersionEntry represents a single entry of a protocol version message VersionEntry { - uint32 version_number = 1; // The protocol version number - uint32 vote_count = 2; // The vote count for this protocol version + uint32 version_number = 1; // The protocol version number + uint32 vote_count = 2; // The vote count for this protocol version } oneof result { - Versions versions = 1; // The actual protocol version information - Proof proof = 2; // Cryptographic proof of the protocol version information, if requested + Versions versions = 1; // The actual protocol version information + Proof proof = 2; // Cryptographic proof of the protocol version + // information, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } - oneof version { - GetProtocolVersionUpgradeStateResponseV0 v0 = 1; - } + oneof version { GetProtocolVersionUpgradeStateResponseV0 v0 = 1; } } message GetProtocolVersionUpgradeVoteStatusRequest { message GetProtocolVersionUpgradeVoteStatusRequestV0 { - bytes start_pro_tx_hash = 1; // The starting masternode provider transaction hash to filter the votes by - uint32 count = 2; // The number of vote entries to retrieve - bool prove = 3; // Flag to request a proof as the response + bytes start_pro_tx_hash = 1; // The starting masternode provider transaction + // hash to filter the votes by + uint32 count = 2; // The number of vote entries to retrieve + bool prove = 3; // Flag to request a proof as the response } - oneof version { - GetProtocolVersionUpgradeVoteStatusRequestV0 v0 = 1; - } + oneof version { GetProtocolVersionUpgradeVoteStatusRequestV0 v0 = 1; } } message GetProtocolVersionUpgradeVoteStatusResponse { message GetProtocolVersionUpgradeVoteStatusResponseV0 { // VersionSignals holds a collection of version signal entries message VersionSignals { - repeated VersionSignal version_signals = 1; // List of version signal entries + repeated VersionSignal version_signals = + 1; // List of version signal entries } // VersionSignal represents a single voting signal for a protocol version message VersionSignal { - bytes pro_tx_hash = 1; // The masternode provider transaction hash associated with the vote - uint32 version = 2; // The protocol version number that is being voted on + bytes pro_tx_hash = 1; // The masternode provider transaction hash + // associated with the vote + uint32 version = 2; // The protocol version number that is being voted on } oneof result { - VersionSignals versions = 1; // The actual version signal information - Proof proof = 2; // Cryptographic proof of the version signal information, if requested + VersionSignals versions = 1; // The actual version signal information + Proof proof = 2; // Cryptographic proof of the version signal information, + // if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } - oneof version { - GetProtocolVersionUpgradeVoteStatusResponseV0 v0 = 1; - } + oneof version { GetProtocolVersionUpgradeVoteStatusResponseV0 v0 = 1; } } message GetEpochsInfoRequest { message GetEpochsInfoRequestV0 { - google.protobuf.UInt32Value start_epoch = 1; // The starting epoch for the request - uint32 count = 2; // The number of epochs to retrieve information for - bool ascending = 3; // Flag indicating if the epochs should be listed in ascending order - bool prove = 4; // Flag to request a proof as the response + google.protobuf.UInt32Value start_epoch = + 1; // The starting epoch for the request + uint32 count = 2; // The number of epochs to retrieve information for + bool ascending = + 3; // Flag indicating if the epochs should be listed in ascending order + bool prove = 4; // Flag to request a proof as the response } - oneof version { - GetEpochsInfoRequestV0 v0 = 1; - } + oneof version { GetEpochsInfoRequestV0 v0 = 1; } } message GetEpochsInfoResponse { message GetEpochsInfoResponseV0 { // EpochInfos holds a collection of epoch information entries message EpochInfos { - repeated EpochInfo epoch_infos = 1; // List of information for each requested epoch + repeated EpochInfo epoch_infos = + 1; // List of information for each requested epoch } // EpochInfo represents information about a single epoch message EpochInfo { - uint32 number = 1; // The number of the epoch - uint64 first_block_height = 2 [jstype = JS_STRING]; // The height of the first block in this epoch - uint32 first_core_block_height = 3; // The height of the first Core block in this epoch - uint64 start_time = 4 [jstype = JS_STRING]; // The start time of the epoch - double fee_multiplier = 5; // The fee multiplier applicable in this epoch + uint32 number = 1; // The number of the epoch + uint64 first_block_height = 2 + [ jstype = JS_STRING ]; // The height of the first block in this epoch + uint32 first_core_block_height = + 3; // The height of the first Core block in this epoch + uint64 start_time = 4 + [ jstype = JS_STRING ]; // The start time of the epoch + double fee_multiplier = 5; // The fee multiplier applicable in this epoch uint32 protocol_version = 6; } oneof result { - EpochInfos epochs = 1; // The actual information about the requested epochs - Proof proof = 2; // Cryptographic proof of the epoch information, if requested + EpochInfos epochs = + 1; // The actual information about the requested epochs + Proof proof = + 2; // Cryptographic proof of the epoch information, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state + ResponseMetadata metadata = 3; // Metadata about the blockchain state } - oneof version { - GetEpochsInfoResponseV0 v0 = 1; - } + oneof version { GetEpochsInfoResponseV0 v0 = 1; } } message GetContestedResourcesRequest { @@ -720,9 +780,7 @@ message GetContestedResourcesRequest { bool prove = 9; } - oneof version { - GetContestedResourcesRequestV0 v0 = 1; - } + oneof version { GetContestedResourcesRequestV0 v0 = 1; } } message GetContestedResourcesResponse { @@ -738,19 +796,17 @@ message GetContestedResourcesResponse { ResponseMetadata metadata = 3; } - oneof version { - GetContestedResourcesResponseV0 v0 = 1; - } + oneof version { GetContestedResourcesResponseV0 v0 = 1; } } message GetVotePollsByEndDateRequest { message GetVotePollsByEndDateRequestV0 { message StartAtTimeInfo { - uint64 start_time_ms = 1 [jstype = JS_STRING]; + uint64 start_time_ms = 1 [ jstype = JS_STRING ]; bool start_time_included = 2; } message EndAtTimeInfo { - uint64 end_time_ms = 1 [jstype = JS_STRING]; + uint64 end_time_ms = 1 [ jstype = JS_STRING ]; bool end_time_included = 2; } optional StartAtTimeInfo start_time_info = 1; @@ -761,15 +817,13 @@ message GetVotePollsByEndDateRequest { bool prove = 6; } - oneof version { - GetVotePollsByEndDateRequestV0 v0 = 1; - } + oneof version { GetVotePollsByEndDateRequestV0 v0 = 1; } } message GetVotePollsByEndDateResponse { message GetVotePollsByEndDateResponseV0 { message SerializedVotePollsByTimestamp { - uint64 timestamp = 1 [jstype = JS_STRING]; + uint64 timestamp = 1 [ jstype = JS_STRING ]; repeated bytes serialized_vote_polls = 2; } @@ -785,9 +839,7 @@ message GetVotePollsByEndDateResponse { ResponseMetadata metadata = 3; } - oneof version { - GetVotePollsByEndDateResponseV0 v0 = 1; - } + oneof version { GetVotePollsByEndDateResponseV0 v0 = 1; } } // What's the state of a contested resource vote? (ie who is winning?) @@ -814,9 +866,7 @@ message GetContestedResourceVoteStateRequest { bool prove = 9; } - oneof version { - GetContestedResourceVoteStateRequestV0 v0 = 1; - } + oneof version { GetContestedResourceVoteStateRequestV0 v0 = 1; } } message GetContestedResourceVoteStateResponse { @@ -828,10 +878,11 @@ message GetContestedResourceVoteStateResponse { NO_PREVIOUS_WINNER = 2; } FinishedVoteOutcome finished_vote_outcome = 1; - optional bytes won_by_identity_id = 2; // Only used when vote_choice_type is TOWARDS_IDENTITY - uint64 finished_at_block_height = 3 [jstype = JS_STRING]; + optional bytes won_by_identity_id = + 2; // Only used when vote_choice_type is TOWARDS_IDENTITY + uint64 finished_at_block_height = 3 [ jstype = JS_STRING ]; uint32 finished_at_core_block_height = 4; - uint64 finished_at_block_time_ms = 5 [jstype = JS_STRING]; + uint64 finished_at_block_time_ms = 5 [ jstype = JS_STRING ]; uint32 finished_at_epoch = 6; } @@ -855,9 +906,7 @@ message GetContestedResourceVoteStateResponse { ResponseMetadata metadata = 3; } - oneof version { - GetContestedResourceVoteStateResponseV0 v0 = 1; - } + oneof version { GetContestedResourceVoteStateResponseV0 v0 = 1; } } // Who voted for a contested resource to go to a specific identity? @@ -878,9 +927,7 @@ message GetContestedResourceVotersForIdentityRequest { bool prove = 9; } - oneof version { - GetContestedResourceVotersForIdentityRequestV0 v0 = 1; - } + oneof version { GetContestedResourceVotersForIdentityRequestV0 v0 = 1; } } message GetContestedResourceVotersForIdentityResponse { @@ -897,9 +944,7 @@ message GetContestedResourceVotersForIdentityResponse { ResponseMetadata metadata = 3; } - oneof version { - GetContestedResourceVotersForIdentityResponseV0 v0 = 1; - } + oneof version { GetContestedResourceVotersForIdentityResponseV0 v0 = 1; } } // How did an identity vote? @@ -917,15 +962,14 @@ message GetContestedResourceIdentityVotesRequest { bool prove = 6; } - oneof version { - GetContestedResourceIdentityVotesRequestV0 v0 = 1; - } + oneof version { GetContestedResourceIdentityVotesRequestV0 v0 = 1; } } message GetContestedResourceIdentityVotesResponse { message GetContestedResourceIdentityVotesResponseV0 { message ContestedResourceIdentityVotes { - repeated ContestedResourceIdentityVote contested_resource_identity_votes = 1; + repeated ContestedResourceIdentityVote contested_resource_identity_votes = + 1; bool finished_results = 2; } @@ -936,7 +980,8 @@ message GetContestedResourceIdentityVotesResponse { LOCK = 2; } VoteChoiceType vote_choice_type = 1; - optional bytes identity_id = 2; // Only used when vote_choice_type is TOWARDS_IDENTITY + optional bytes identity_id = + 2; // Only used when vote_choice_type is TOWARDS_IDENTITY } message ContestedResourceIdentityVote { @@ -953,9 +998,7 @@ message GetContestedResourceIdentityVotesResponse { ResponseMetadata metadata = 3; } - oneof version { - GetContestedResourceIdentityVotesResponseV0 v0 = 1; - } + oneof version { GetContestedResourceIdentityVotesResponseV0 v0 = 1; } } message GetPrefundedSpecializedBalanceRequest { @@ -972,7 +1015,7 @@ message GetPrefundedSpecializedBalanceResponse { message GetPrefundedSpecializedBalanceResponseV0 { oneof result { - uint64 balance = 1 [jstype = JS_STRING]; + uint64 balance = 1 [ jstype = JS_STRING ]; Proof proof = 2; } ResponseMetadata metadata = 3; @@ -982,28 +1025,22 @@ message GetPrefundedSpecializedBalanceResponse { } message GetTotalCreditsInPlatformRequest { - message GetTotalCreditsInPlatformRequestV0 { - bool prove = 1; - } + message GetTotalCreditsInPlatformRequestV0 { bool prove = 1; } - oneof version { - GetTotalCreditsInPlatformRequestV0 v0 = 1; - } + oneof version { GetTotalCreditsInPlatformRequestV0 v0 = 1; } } message GetTotalCreditsInPlatformResponse { message GetTotalCreditsInPlatformResponseV0 { oneof result { - uint64 credits = 1 [jstype = JS_STRING]; + uint64 credits = 1 [ jstype = JS_STRING ]; Proof proof = 2; } ResponseMetadata metadata = 3; } - oneof version { - GetTotalCreditsInPlatformResponseV0 v0 = 1; - } + oneof version { GetTotalCreditsInPlatformResponseV0 v0 = 1; } } message GetPathElementsRequest { @@ -1013,16 +1050,12 @@ message GetPathElementsRequest { bool prove = 3; } - oneof version { - GetPathElementsRequestV0 v0 = 1; - } + oneof version { GetPathElementsRequestV0 v0 = 1; } } message GetPathElementsResponse { message GetPathElementsResponseV0 { - message Elements { - repeated bytes elements = 1; - } + message Elements { repeated bytes elements = 1; } oneof result { Elements elements = 1; @@ -1032,19 +1065,15 @@ message GetPathElementsResponse { ResponseMetadata metadata = 3; } - oneof version { - GetPathElementsResponseV0 v0 = 1; - } + oneof version { GetPathElementsResponseV0 v0 = 1; } } message GetStatusRequest { - message GetStatusRequestV0 { - } + message GetStatusRequestV0 {} oneof version { GetStatusRequestV0 v0 = 1; } } - message GetStatusResponse { message GetStatusResponseV0 { message Version { @@ -1076,11 +1105,11 @@ message GetStatusResponse { } message Time { - uint64 local = 1 [jstype = JS_STRING]; + uint64 local = 1 [ jstype = JS_STRING ]; // It will be missing if Drive is not responding - optional uint64 block = 2 [jstype = JS_STRING]; + optional uint64 block = 2 [ jstype = JS_STRING ]; // It will be missing if Drive is not responding - optional uint64 genesis = 3 [jstype = JS_STRING]; + optional uint64 genesis = 3 [ jstype = JS_STRING ]; // It will be missing if Drive is not responding optional uint32 epoch = 4; } @@ -1096,11 +1125,11 @@ message GetStatusResponse { bool catching_up = 1; bytes latest_block_hash = 2; bytes latest_app_hash = 3; - uint64 latest_block_height = 4 [jstype = JS_STRING]; + uint64 latest_block_height = 4 [ jstype = JS_STRING ]; bytes earliest_block_hash = 5; bytes earliest_app_hash = 6; - uint64 earliest_block_height = 7 [jstype = JS_STRING]; - uint64 max_peer_block_height = 9 [jstype = JS_STRING]; + uint64 earliest_block_height = 7 [ jstype = JS_STRING ]; + uint64 max_peer_block_height = 9 [ jstype = JS_STRING ]; // Latest known core height in consensus. // It will be missing if Drive is not responding optional uint32 core_chain_locked_height = 10; @@ -1113,14 +1142,14 @@ message GetStatusResponse { } message StateSync { - uint64 total_synced_time = 1 [jstype = JS_STRING]; - uint64 remaining_time = 2 [jstype = JS_STRING]; + uint64 total_synced_time = 1 [ jstype = JS_STRING ]; + uint64 remaining_time = 2 [ jstype = JS_STRING ]; uint32 total_snapshots = 3; - uint64 chunk_process_avg_time = 4 [jstype = JS_STRING]; - uint64 snapshot_height = 5 [jstype = JS_STRING]; - uint64 snapshot_chunks_count = 6 [jstype = JS_STRING]; - uint64 backfilled_blocks = 7 [jstype = JS_STRING]; - uint64 backfill_blocks_total = 8 [jstype = JS_STRING]; + uint64 chunk_process_avg_time = 4 [ jstype = JS_STRING ]; + uint64 snapshot_height = 5 [ jstype = JS_STRING ]; + uint64 snapshot_chunks_count = 6 [ jstype = JS_STRING ]; + uint64 backfilled_blocks = 7 [ jstype = JS_STRING ]; + uint64 backfill_blocks_total = 8 [ jstype = JS_STRING ]; } Version version = 1; @@ -1135,8 +1164,7 @@ message GetStatusResponse { } message GetCurrentQuorumsInfoRequest { - message GetCurrentQuorumsInfoRequestV0 { - } + message GetCurrentQuorumsInfoRequestV0 {} oneof version { GetCurrentQuorumsInfoRequestV0 v0 = 1; } } @@ -1166,97 +1194,83 @@ message GetCurrentQuorumsInfoResponse { message GetIdentityTokenBalancesRequest { message GetIdentityTokenBalancesRequestV0 { - bytes identity_id = 1; // ID of the identity - repeated bytes token_ids = 2; // List of token IDs - bool prove = 3; // Flag to request a proof as the response - } - oneof version { - GetIdentityTokenBalancesRequestV0 v0 = 1; + bytes identity_id = 1; // ID of the identity + repeated bytes token_ids = 2; // List of token IDs + bool prove = 3; // Flag to request a proof as the response } + oneof version { GetIdentityTokenBalancesRequestV0 v0 = 1; } } message GetIdentityTokenBalancesResponse { message GetIdentityTokenBalancesResponseV0 { message TokenBalanceEntry { - bytes token_id = 1; // Token ID - optional uint64 balance = 2; // Token balance for the contract + bytes token_id = 1; // Token ID + optional uint64 balance = 2; // Token balance for the contract } message TokenBalances { - repeated TokenBalanceEntry token_balances = 1; // List of token balances + repeated TokenBalanceEntry token_balances = 1; // List of token balances } oneof result { - TokenBalances token_balances = 1; // Actual token balances - Proof proof = 2; // Proof of the token balances, if requested + TokenBalances token_balances = 1; // Actual token balances + Proof proof = 2; // Proof of the token balances, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state - } - oneof version { - GetIdentityTokenBalancesResponseV0 v0 = 1; + ResponseMetadata metadata = 3; // Metadata about the blockchain state } + oneof version { GetIdentityTokenBalancesResponseV0 v0 = 1; } } message GetIdentitiesTokenBalancesRequest { message GetIdentitiesTokenBalancesRequestV0 { - bytes token_id = 1; // Token ID - repeated bytes identity_ids = 2; // List of identity IDs - bool prove = 3; // Flag to request a proof as the response - } - oneof version { - GetIdentitiesTokenBalancesRequestV0 v0 = 1; + bytes token_id = 1; // Token ID + repeated bytes identity_ids = 2; // List of identity IDs + bool prove = 3; // Flag to request a proof as the response } + oneof version { GetIdentitiesTokenBalancesRequestV0 v0 = 1; } } message GetIdentitiesTokenBalancesResponse { message GetIdentitiesTokenBalancesResponseV0 { message IdentityTokenBalanceEntry { - bytes identity_id = 1; // Identity ID - optional uint64 balance = 2; // Token balance for the identity + bytes identity_id = 1; // Identity ID + optional uint64 balance = 2; // Token balance for the identity } message IdentityTokenBalances { - repeated IdentityTokenBalanceEntry identity_token_balances = 1; // List of identity token balances + repeated IdentityTokenBalanceEntry identity_token_balances = + 1; // List of identity token balances } oneof result { - IdentityTokenBalances identity_token_balances = 1; // Actual identity token balances - Proof proof = 2; // Proof of the balances, if requested + IdentityTokenBalances identity_token_balances = + 1; // Actual identity token balances + Proof proof = 2; // Proof of the balances, if requested } - ResponseMetadata metadata = 3; // Metadata about the blockchain state - } - oneof version { - GetIdentitiesTokenBalancesResponseV0 v0 = 1; + ResponseMetadata metadata = 3; // Metadata about the blockchain state } + oneof version { GetIdentitiesTokenBalancesResponseV0 v0 = 1; } } - - message GetIdentityTokenInfosRequest { message GetIdentityTokenInfosRequestV0 { bytes identity_id = 1; repeated bytes token_ids = 2; bool prove = 3; } - oneof version { - GetIdentityTokenInfosRequestV0 v0 = 1; - } + oneof version { GetIdentityTokenInfosRequestV0 v0 = 1; } } message GetIdentityTokenInfosResponse { message GetIdentityTokenInfosResponseV0 { - message TokenIdentityInfoEntry { - bool frozen = 1; - } + message TokenIdentityInfoEntry { bool frozen = 1; } message TokenInfoEntry { bytes token_id = 1; optional TokenIdentityInfoEntry info = 2; } - message TokenInfos { - repeated TokenInfoEntry token_infos = 1; - } + message TokenInfos { repeated TokenInfoEntry token_infos = 1; } oneof result { TokenInfos token_infos = 1; @@ -1264,9 +1278,7 @@ message GetIdentityTokenInfosResponse { } ResponseMetadata metadata = 3; } - oneof version { - GetIdentityTokenInfosResponseV0 v0 = 1; - } + oneof version { GetIdentityTokenInfosResponseV0 v0 = 1; } } message GetIdentitiesTokenInfosRequest { @@ -1275,25 +1287,19 @@ message GetIdentitiesTokenInfosRequest { repeated bytes identity_ids = 2; bool prove = 3; } - oneof version { - GetIdentitiesTokenInfosRequestV0 v0 = 1; - } + oneof version { GetIdentitiesTokenInfosRequestV0 v0 = 1; } } message GetIdentitiesTokenInfosResponse { message GetIdentitiesTokenInfosResponseV0 { - message TokenIdentityInfoEntry { - bool frozen = 1; - } + message TokenIdentityInfoEntry { bool frozen = 1; } message TokenInfoEntry { bytes identity_id = 1; optional TokenIdentityInfoEntry info = 2; } - message IdentityTokenInfos { - repeated TokenInfoEntry token_infos = 1; - } + message IdentityTokenInfos { repeated TokenInfoEntry token_infos = 1; } oneof result { IdentityTokenInfos identity_token_infos = 1; @@ -1301,9 +1307,7 @@ message GetIdentitiesTokenInfosResponse { } ResponseMetadata metadata = 3; } - oneof version { - GetIdentitiesTokenInfosResponseV0 v0 = 1; - } + oneof version { GetIdentitiesTokenInfosResponseV0 v0 = 1; } } message GetTokenStatusesRequest { @@ -1311,9 +1315,7 @@ message GetTokenStatusesRequest { repeated bytes token_ids = 1; bool prove = 2; } - oneof version { - GetTokenStatusesRequestV0 v0 = 1; - } + oneof version { GetTokenStatusesRequestV0 v0 = 1; } } message GetTokenStatusesResponse { @@ -1323,9 +1325,7 @@ message GetTokenStatusesResponse { optional bool paused = 2; } - message TokenStatuses { - repeated TokenStatusEntry token_statuses = 1; - } + message TokenStatuses { repeated TokenStatusEntry token_statuses = 1; } oneof result { TokenStatuses token_statuses = 1; @@ -1333,20 +1333,7 @@ message GetTokenStatusesResponse { } ResponseMetadata metadata = 3; } - oneof version { - GetTokenStatusesResponseV0 v0 = 1; - } -} - - -message GetTokenDirectPurchasePricesRequest { - message GetTokenDirectPurchasePricesRequestV0 { - repeated bytes token_ids = 1; - bool prove = 2; - } - oneof version { - GetTokenDirectPurchasePricesRequestV0 v0 = 1; - } + oneof version { GetTokenStatusesResponseV0 v0 = 1; } } message GetTokenDirectPurchasePricesResponse { @@ -1360,16 +1347,14 @@ message GetTokenDirectPurchasePricesResponse { repeated PriceForQuantity price_for_quantity = 1; } - message Price { - oneof price { - uint64 fixed_price = 1; - PricingSchedule variable_price = 2; - } - } - message TokenDirectPurchasePriceEntry { bytes token_id = 1; - optional Price price = 2; + + // Price of the token; optional + oneof price { + uint64 fixed_price = 2; + PricingSchedule variable_price = 3; + } } message TokenDirectPurchasePrices { @@ -1382,9 +1367,15 @@ message GetTokenDirectPurchasePricesResponse { } ResponseMetadata metadata = 3; } - oneof version { - GetTokenDirectPurchasePricesResponseV0 v0 = 1; + oneof version { GetTokenDirectPurchasePricesResponseV0 v0 = 1; } +} + +message GetTokenDirectPurchasePricesRequest { + message GetTokenDirectPurchasePricesRequestV0 { + repeated bytes token_ids = 1; + bool prove = 2; } + oneof version { GetTokenDirectPurchasePricesRequestV0 v0 = 1; } } message GetTokenPreProgrammedDistributionsRequest { @@ -1399,9 +1390,7 @@ message GetTokenPreProgrammedDistributionsRequest { optional uint32 limit = 3; bool prove = 4; } - oneof version { - GetTokenPreProgrammedDistributionsRequestV0 v0 = 1; - } + oneof version { GetTokenPreProgrammedDistributionsRequestV0 v0 = 1; } } message GetTokenPreProgrammedDistributionsResponse { @@ -1426,9 +1415,7 @@ message GetTokenPreProgrammedDistributionsResponse { } ResponseMetadata metadata = 3; } - oneof version { - GetTokenPreProgrammedDistributionsResponseV0 v0 = 1; - } + oneof version { GetTokenPreProgrammedDistributionsResponseV0 v0 = 1; } } message GetTokenTotalSupplyRequest { @@ -1436,9 +1423,7 @@ message GetTokenTotalSupplyRequest { bytes token_id = 1; bool prove = 2; } - oneof version { - GetTokenTotalSupplyRequestV0 v0 = 1; - } + oneof version { GetTokenTotalSupplyRequestV0 v0 = 1; } } message GetTokenTotalSupplyResponse { @@ -1455,9 +1440,7 @@ message GetTokenTotalSupplyResponse { } ResponseMetadata metadata = 3; } - oneof version { - GetTokenTotalSupplyResponseV0 v0 = 1; - } + oneof version { GetTokenTotalSupplyResponseV0 v0 = 1; } } message GetGroupInfoRequest { @@ -1466,9 +1449,7 @@ message GetGroupInfoRequest { uint32 group_contract_position = 2; bool prove = 3; } - oneof version { - GetGroupInfoRequestV0 v0 = 1; - } + oneof version { GetGroupInfoRequestV0 v0 = 1; } } message GetGroupInfoResponse { @@ -1483,9 +1464,7 @@ message GetGroupInfoResponse { uint32 group_required_power = 2; } - message GroupInfo { - optional GroupInfoEntry group_info = 1; - } + message GroupInfo { optional GroupInfoEntry group_info = 1; } oneof result { GroupInfo group_info = 1; @@ -1493,9 +1472,7 @@ message GetGroupInfoResponse { } ResponseMetadata metadata = 4; } - oneof version { - GetGroupInfoResponseV0 v0 = 1; - } + oneof version { GetGroupInfoResponseV0 v0 = 1; } } message GetGroupInfosRequest { @@ -1510,9 +1487,7 @@ message GetGroupInfosRequest { optional uint32 count = 3; bool prove = 4; } - oneof version { - GetGroupInfosRequestV0 v0 = 1; - } + oneof version { GetGroupInfosRequestV0 v0 = 1; } } message GetGroupInfosResponse { @@ -1528,9 +1503,7 @@ message GetGroupInfosResponse { uint32 group_required_power = 3; } - message GroupInfos { - repeated GroupPositionInfoEntry group_infos = 1; - } + message GroupInfos { repeated GroupPositionInfoEntry group_infos = 1; } oneof result { GroupInfos group_infos = 1; @@ -1538,9 +1511,7 @@ message GetGroupInfosResponse { } ResponseMetadata metadata = 4; } - oneof version { - GetGroupInfosResponseV0 v0 = 1; - } + oneof version { GetGroupInfosResponseV0 v0 = 1; } } message GetGroupActionsRequest { @@ -1562,56 +1533,55 @@ message GetGroupActionsRequest { optional uint32 count = 5; bool prove = 6; } - oneof version { - GetGroupActionsRequestV0 v0 = 1; - } + oneof version { GetGroupActionsRequestV0 v0 = 1; } } message GetGroupActionsResponse { message GetGroupActionsResponseV0 { // Mint event message MintEvent { - uint64 amount = 1; // Amount to mint - bytes recipient_id = 2; // Recipient identifier + uint64 amount = 1; // Amount to mint + bytes recipient_id = 2; // Recipient identifier optional string public_note = 3; // Public note } // Burn event message BurnEvent { - uint64 amount = 1; // Amount to burn + uint64 amount = 1; // Amount to burn optional string public_note = 2; // Public note } // Freeze event message FreezeEvent { - bytes frozen_id = 1; // Identifier of the frozen entity + bytes frozen_id = 1; // Identifier of the frozen entity optional string public_note = 2; // Public note } // Unfreeze event message UnfreezeEvent { - bytes frozen_id = 1; // Identifier of the unfrozen entity + bytes frozen_id = 1; // Identifier of the unfrozen entity optional string public_note = 2; // Public note } // Destroy frozen funds event message DestroyFrozenFundsEvent { - bytes frozen_id = 1; // Identifier of the frozen entity - uint64 amount = 2; // Amount to destroy + bytes frozen_id = 1; // Identifier of the frozen entity + uint64 amount = 2; // Amount to destroy optional string public_note = 3; // Public note } // Shared encrypted note message SharedEncryptedNote { - uint32 sender_key_index = 1; // Sender key index + uint32 sender_key_index = 1; // Sender key index uint32 recipient_key_index = 2; // Recipient key index - bytes encrypted_data = 3; // Encrypted data + bytes encrypted_data = 3; // Encrypted data } // Personal encrypted note message PersonalEncryptedNote { uint32 root_encryption_key_index = 1; // Root encryption key index - uint32 derivation_encryption_key_index = 2; // Derivation encryption key index + uint32 derivation_encryption_key_index = + 2; // Derivation encryption key index bytes encrypted_data = 3; // Encrypted data } @@ -1619,18 +1589,18 @@ message GetGroupActionsResponse { message EmergencyActionEvent { // Enum for emergency action types enum ActionType { - PAUSE = 0; // Pause action + PAUSE = 0; // Pause action RESUME = 1; // Resume action } - ActionType action_type = 1; // Emergency action type + ActionType action_type = 1; // Emergency action type optional string public_note = 2; // Public note } // Token config update event message TokenConfigUpdateEvent { bytes token_config_update_item = 1; // Token config update item - optional string public_note = 2; // Public note + optional string public_note = 2; // Public note } // UpdatePrice event @@ -1661,46 +1631,43 @@ message GetGroupActionsResponse { message DocumentEvent { oneof type { - DocumentCreateEvent create = 1; // Create event details + DocumentCreateEvent create = 1; // Create event details } } - message DocumentCreateEvent { - bytes created_document = 1; - } + message DocumentCreateEvent { bytes created_document = 1; } - message ContractUpdateEvent { - bytes updated_contract = 1; - } + message ContractUpdateEvent { bytes updated_contract = 1; } message ContractEvent { oneof type { - ContractUpdateEvent update = 1; // Contract update event + ContractUpdateEvent update = 1; // Contract update event } } // Details for token events message TokenEvent { oneof type { - MintEvent mint = 1; // Mint event details - BurnEvent burn = 2; // Burn event details - FreezeEvent freeze = 3; // Freeze event details - UnfreezeEvent unfreeze = 4; // Unfreeze event details - DestroyFrozenFundsEvent destroy_frozen_funds = 5; // Destroy frozen funds + MintEvent mint = 1; // Mint event details + BurnEvent burn = 2; // Burn event details + FreezeEvent freeze = 3; // Freeze event details + UnfreezeEvent unfreeze = 4; // Unfreeze event details + DestroyFrozenFundsEvent destroy_frozen_funds = + 5; // Destroy frozen funds EmergencyActionEvent emergency_action = 6; // Emergency action details - TokenConfigUpdateEvent token_config_update = 7; // Token configuration update details - UpdateDirectPurchasePriceEvent update_price = 8; // Updating the token direct selling price + TokenConfigUpdateEvent token_config_update = + 7; // Token configuration update details + UpdateDirectPurchasePriceEvent update_price = + 8; // Updating the token direct selling price } } message GroupActionEntry { - bytes action_id = 1; // Unique identifier for the action + bytes action_id = 1; // Unique identifier for the action GroupActionEvent event = 2; // The event data } - message GroupActions { - repeated GroupActionEntry group_actions = 1; - } + message GroupActions { repeated GroupActionEntry group_actions = 1; } oneof result { GroupActions group_actions = 1; @@ -1708,12 +1675,9 @@ message GetGroupActionsResponse { } ResponseMetadata metadata = 3; } - oneof version { - GetGroupActionsResponseV0 v0 = 1; - } + oneof version { GetGroupActionsResponseV0 v0 = 1; } } - message GetGroupActionSignersRequest { enum ActionStatus { ACTIVE = 0; // Request the active actions @@ -1727,9 +1691,7 @@ message GetGroupActionSignersRequest { bytes action_id = 4; bool prove = 5; } - oneof version { - GetGroupActionSignersRequestV0 v0 = 1; - } + oneof version { GetGroupActionSignersRequestV0 v0 = 1; } } message GetGroupActionSignersResponse { @@ -1738,9 +1700,7 @@ message GetGroupActionSignersResponse { bytes signer_id = 1; uint32 power = 2; } - message GroupActionSigners { - repeated GroupActionSigner signers = 1; - } + message GroupActionSigners { repeated GroupActionSigner signers = 1; } oneof result { GroupActionSigners group_action_signers = 1; @@ -1749,7 +1709,5 @@ message GetGroupActionSignersResponse { ResponseMetadata metadata = 3; } - oneof version { - GetGroupActionSignersResponseV0 v0 = 1; - } + oneof version { GetGroupActionSignersResponseV0 v0 = 1; } } diff --git a/packages/rs-drive-abci/src/query/service.rs b/packages/rs-drive-abci/src/query/service.rs index 3fa53667f32..f099e531d1d 100644 --- a/packages/rs-drive-abci/src/query/service.rs +++ b/packages/rs-drive-abci/src/query/service.rs @@ -742,9 +742,14 @@ impl PlatformService for QueryService { async fn get_token_direct_purchase_prices( &self, - _request: Request, + request: Request, ) -> Result, Status> { - todo!() + self.handle_blocking_query( + request, + Platform::::query_token_direct_purchase_prices, + "get_token_direct_purchase_prices", + ) + .await } } diff --git a/packages/rs-drive-abci/src/query/token_queries/mod.rs b/packages/rs-drive-abci/src/query/token_queries/mod.rs index 9b4efdf4707..6a5a0ff1fd0 100644 --- a/packages/rs-drive-abci/src/query/token_queries/mod.rs +++ b/packages/rs-drive-abci/src/query/token_queries/mod.rs @@ -2,6 +2,7 @@ mod identities_token_balances; mod identities_token_infos; mod identity_token_balances; mod identity_token_infos; +mod token_direct_purchase_prices; mod token_pre_programmed_distributions; mod token_status; mod token_total_supply; diff --git a/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/mod.rs b/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/mod.rs new file mode 100644 index 00000000000..e71568c260f --- /dev/null +++ b/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/mod.rs @@ -0,0 +1,66 @@ +use crate::error::query::QueryError; +use crate::error::Error; +use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::PlatformState; +use crate::query::QueryValidationResult; +use dapi_grpc::platform::v0::get_token_direct_purchase_prices_request::Version as RequestVersion; +use dapi_grpc::platform::v0::get_token_direct_purchase_prices_response::Version as ResponseVersion; +use dapi_grpc::platform::v0::{ + GetTokenDirectPurchasePricesRequest, GetTokenDirectPurchasePricesResponse, +}; +use dpp::version::PlatformVersion; +mod v0; + +impl Platform { + /// Retrieve the token direct purchase prices for given token ids + pub fn query_token_direct_purchase_prices( + &self, + GetTokenDirectPurchasePricesRequest { version }: GetTokenDirectPurchasePricesRequest, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let Some(version) = version else { + return Ok(QueryValidationResult::new_with_error( + QueryError::DecodingError( + "could not decode token direct pruchase prices query".to_string(), + ), + )); + }; + + let feature_version_bounds = &platform_version + .drive_abci + .query + .token_queries + .token_direct_purchase_prices; + + let feature_version = match &version { + RequestVersion::V0(_) => 0, + }; + if !feature_version_bounds.check_version(feature_version) { + return Ok(QueryValidationResult::new_with_error( + QueryError::UnsupportedQueryVersion( + "token_direct_purchase_prices".to_string(), + feature_version_bounds.min_version, + feature_version_bounds.max_version, + platform_version.protocol_version, + feature_version, + ), + )); + } + + match version { + RequestVersion::V0(request_v0) => { + let result = self.query_token_direct_purchase_prices_v0( + request_v0, + platform_state, + platform_version, + )?; + Ok( + result.map(|response_v0| GetTokenDirectPurchasePricesResponse { + version: Some(ResponseVersion::V0(response_v0)), + }), + ) + } + } + } +} diff --git a/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/v0/mod.rs b/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/v0/mod.rs new file mode 100644 index 00000000000..74c698fb22d --- /dev/null +++ b/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/v0/mod.rs @@ -0,0 +1,102 @@ +use crate::error::query::QueryError; +use crate::error::Error; +use crate::platform_types::platform::Platform; +use crate::platform_types::platform_state::PlatformState; +use crate::query::QueryValidationResult; +use dapi_grpc::platform::v0::get_token_direct_purchase_prices_request::GetTokenDirectPurchasePricesRequestV0; +use dapi_grpc::platform::v0::get_token_direct_purchase_prices_response::{ + get_token_direct_purchase_prices_response_v0::{ + self, token_direct_purchase_price_entry::Price, PriceForQuantity, PricingSchedule, + TokenDirectPurchasePriceEntry, + }, + GetTokenDirectPurchasePricesResponseV0, +}; +use dpp::check_validation_result_with_data; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use dpp::validation::ValidationResult; +use dpp::version::PlatformVersion; + +impl Platform { + pub(super) fn query_token_direct_purchase_prices_v0( + &self, + GetTokenDirectPurchasePricesRequestV0 { token_ids, prove }: GetTokenDirectPurchasePricesRequestV0, + platform_state: &PlatformState, + platform_version: &PlatformVersion, + ) -> Result, Error> { + if token_ids.is_empty() { + return Ok(QueryValidationResult::new_with_error( + QueryError::InvalidArgument( + "please provide at least one token id in token_ids".to_string(), + ), + )); + } + + let token_ids: Vec<[u8; 32]> = check_validation_result_with_data!(token_ids + .into_iter() + .map(|x| { + x.try_into().map_err(|_| { + QueryError::InvalidArgument( + "token_ids must be a list of valid identifiers (32 bytes long)".to_string(), + ) + }) + }) + .collect::, _>>()); + + let response = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_tokens_direct_purchase_price(&token_ids, None, platform_version,)); + + GetTokenDirectPurchasePricesResponseV0 { + result: Some(get_token_direct_purchase_prices_response_v0::Result::Proof( + self.response_proof_v0(platform_state, proof), + )), + metadata: Some(self.response_metadata_v0(platform_state)), + } + } else { + let token_prices: Vec = self + .drive + .fetch_tokens_direct_purchase_price(&token_ids, None, platform_version)? + .into_iter() + .map(|(token_id, schedule)| match schedule { + Some(TokenPricingSchedule::SinglePrice(price)) => { + TokenDirectPurchasePriceEntry { + token_id: token_id.to_vec(), + price: Some(Price::FixedPrice(price)), + } + } + Some(TokenPricingSchedule::SetPrices(prices)) => { + let price_for_quantity = prices + .into_iter() + .map(|(quantity, price)| PriceForQuantity { price, quantity }) + .collect(); + + TokenDirectPurchasePriceEntry { + token_id: token_id.to_vec(), + price: Some(Price::VariablePrice(PricingSchedule { + price_for_quantity, + })), + } + } + None => TokenDirectPurchasePriceEntry { + token_id: token_id.to_vec(), + price: None, + }, + }) + .collect(); + + GetTokenDirectPurchasePricesResponseV0 { + result: Some( + get_token_direct_purchase_prices_response_v0::Result::TokenDirectPurchasePrices( + get_token_direct_purchase_prices_response_v0::TokenDirectPurchasePrices { + token_direct_purchase_price: token_prices, + }, + ), + ), + metadata: Some(self.response_metadata_v0(platform_state)), + } + }; + + Ok(QueryValidationResult::new_with_data(response)) + } +} diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs new file mode 100644 index 00000000000..ae152c6f606 --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs @@ -0,0 +1,44 @@ +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; +use std::collections::BTreeMap; + +impl Drive { + /// Fetches token statuses from the backing store. + /// + /// # Arguments + /// + /// * `token_ids` - A list of token IDs whose infos are to be fetched. + /// * `transaction` - The current transaction context. + /// * `platform_version` - The version of the platform to use for compatibility checks. + /// + /// # Returns + /// + /// * `Result>, Error>` - A map of token IDs to their corresponding infos, or an error. + /// + /// # Errors + /// + /// * `DriveError::UnknownVersionMismatch` - If the platform version does not support the requested operation. + pub fn fetch_tokens_direct_purchase_price( + &self, + token_ids: &[[u8; 32]], + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result>, Error> { + match platform_version.drive.methods.token.fetch.token_statuses { + 0 => { + self.fetch_tokens_direct_purchase_price_v0(token_ids, transaction, platform_version) + } + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "fetch_token_statuses".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/v0/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/v0/mod.rs new file mode 100644 index 00000000000..0eff0ffeb06 --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/v0/mod.rs @@ -0,0 +1,64 @@ +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use crate::fees::op::LowLevelDriveOperation; +use dpp::serialization::PlatformDeserializable; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; +use dpp::version::PlatformVersion; +use grovedb::Element::Item; +use grovedb::TransactionArg; +use std::collections::BTreeMap; + +impl Drive { + pub(super) fn fetch_tokens_direct_purchase_price_v0( + &self, + token_ids: &[[u8; 32]], + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result>, Error> { + self.fetch_tokens_direct_purchase_price_operations_v0( + token_ids, + transaction, + &mut vec![], + platform_version, + ) + } + + fn fetch_tokens_direct_purchase_price_operations_v0( + &self, + token_ids: &[[u8; 32]], + transaction: TransactionArg, + drive_operations: &mut Vec, + platform_version: &PlatformVersion, + ) -> Result>, Error> { + let path_query = Drive::token_direct_purchase_prices_query(token_ids); + + self.grove_get_raw_path_query_with_optional( + &path_query, + false, + transaction, + drive_operations, + &platform_version.drive, + )? + .into_iter() + .map(|(_, key, element)| { + let token_id: [u8; 32] = key.try_into().map_err(|_| { + Error::Drive(DriveError::CorruptedDriveState( + "token id not 32 bytes".to_string(), + )) + })?; + match element { + Some(Item(value, ..)) => Ok(( + token_id, + Some(TokenPricingSchedule::deserialize_from_bytes(&value)?), + )), + None => Ok((token_id, None)), + _ => Err(Error::Drive(DriveError::CorruptedDriveState( + "token tree for direct purchase information should contain only items" + .to_string(), + ))), + } + }) + .collect() + } +} diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs index 7eb3030d87d..2d90f5bd4e7 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs @@ -1,5 +1,7 @@ #[cfg(feature = "server")] mod fetch_token_direct_purchase_price; +mod fetch_tokens_direct_purchase_price; +mod prove_tokens_direct_purchase_price; mod queries; #[cfg(feature = "server")] mod set_direct_purchase_price; diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/mod.rs new file mode 100644 index 00000000000..d760fdc6869 --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/mod.rs @@ -0,0 +1,42 @@ +mod v0; + +use crate::drive::Drive; +use crate::error::drive::DriveError; +use crate::error::Error; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + /// Proves direct purchase prices for one or more tokens. + /// + /// # Arguments + /// + /// * `token_ids` - A list of token IDs whose prices are to be proved. + /// * `transaction` - The current transaction context. + /// * `platform_version` - The version of the platform to use for compatibility checks. + /// + /// # Returns + /// + /// * `Result, Error>` - A grovedb proof, or an error. + /// + /// # Errors + /// + /// * `DriveError::UnknownVersionMismatch` - If the platform version does not support the requested operation. + pub fn prove_tokens_direct_purchase_price( + &self, + token_ids: &[[u8; 32]], + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + match platform_version.drive.methods.token.prove.token_statuses { + 0 => { + self.prove_tokens_direct_purchase_price_v0(token_ids, transaction, platform_version) + } + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { + method: "prove_tokens_direct_purchase_price".to_string(), + known_versions: vec![0], + received: version, + })), + } + } +} diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/v0/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/v0/mod.rs new file mode 100644 index 00000000000..146e292f1fc --- /dev/null +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/v0/mod.rs @@ -0,0 +1,23 @@ +use crate::drive::Drive; +use crate::error::Error; +use dpp::version::PlatformVersion; +use grovedb::TransactionArg; + +impl Drive { + pub(super) fn prove_tokens_direct_purchase_price_v0( + &self, + token_ids: &[[u8; 32]], + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result, Error> { + let path_query = Self::token_direct_purchase_prices_query(token_ids); + let mut drive_operations = Vec::new(); // actually, we don't need it + + self.grove_get_proved_path_query( + &path_query, + transaction, + &mut drive_operations, + &platform_version.drive, + ) + } +} diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs index 32bbf30423b..bd5cdd54f10 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs @@ -31,6 +31,7 @@ pub struct DriveAbciQueryTokenVersions { pub identity_token_infos: FeatureVersionBounds, pub token_statuses: FeatureVersionBounds, pub token_total_supply: FeatureVersionBounds, + pub token_direct_purchase_prices: FeatureVersionBounds, pub token_pre_programmed_distributions: FeatureVersionBounds, } diff --git a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs index ee268432199..f5b3eb4fd8a 100644 --- a/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v1.rs @@ -100,6 +100,11 @@ pub const DRIVE_ABCI_QUERY_VERSIONS_V1: DriveAbciQueryVersions = DriveAbciQueryV max_version: 0, default_current_version: 0, }, + token_direct_purchase_prices: FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, token_pre_programmed_distributions: FeatureVersionBounds { min_version: 0, max_version: 0, diff --git a/packages/rs-platform-version/src/version/mocks/v2_test.rs b/packages/rs-platform-version/src/version/mocks/v2_test.rs index d5a376858a6..71f04a065eb 100644 --- a/packages/rs-platform-version/src/version/mocks/v2_test.rs +++ b/packages/rs-platform-version/src/version/mocks/v2_test.rs @@ -238,6 +238,11 @@ pub const TEST_PLATFORM_V2: PlatformVersion = PlatformVersion { max_version: 0, default_current_version: 0, }, + token_direct_purchase_prices:FeatureVersionBounds { + min_version: 0, + max_version: 0, + default_current_version: 0, + }, token_pre_programmed_distributions: FeatureVersionBounds { min_version: 0, max_version: 0, From 9cf725c3df48f5a0903d6bc081c4b95eeb66ce2b Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:18:53 +0200 Subject: [PATCH 18/32] test: test fetching and proving multiple --- .../batch/tests/token/direct_selling/mod.rs | 246 +++++++++++++++++- .../src/drive/tokens/direct_purchase/mod.rs | 2 + .../v0/transformer.rs | 1 - 3 files changed, 246 insertions(+), 3 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs index d1ded56c94b..c7405aecced 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs @@ -1,8 +1,19 @@ use super::*; mod token_selling_tests { + use std::collections::BTreeMap; + + use crate::{rpc::core::MockCoreRPCLike, test::helpers::setup::TempPlatform}; + use super::*; - use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; + + use dpp::{ + dashcore::secp256k1::hashes::hex::{Case, DisplayHex}, + prelude::{DataContract, Identity, IdentityPublicKey}, + tokens::token_pricing_schedule::TokenPricingSchedule, + }; + use drive::verify::RootHash; + use simple_signer::signer::SimpleSigner; #[test] fn test_successful_direct_purchase_single_price() { let platform_version = PlatformVersion::latest(); @@ -39,6 +50,7 @@ mod token_selling_tests { ); let platform_state = platform.state.load(); + let single_price = TokenPricingSchedule::SinglePrice(dash_to_credits!(1)); // Seller sets single price let set_price_transition = @@ -47,7 +59,7 @@ mod token_selling_tests { seller.id(), contract.id(), 0, - Some(TokenPricingSchedule::SinglePrice(dash_to_credits!(1))), // Price per token + Some(single_price.clone()), // Price per token None, None, &seller_key, @@ -73,6 +85,40 @@ mod token_selling_tests { [StateTransitionExecutionResult::SuccessfulExecution(..)] ); + let token_id_buffer = token_id.to_buffer(); + // Buyer checks the price; first, without proofs + let prices = platform + .drive + .fetch_tokens_direct_purchase_price(&[token_id_buffer], None, platform_version) + .expect("expected to fetch token price"); + assert_price( + prices, + &token_id_buffer, + &single_price, + "fetched price mismatch", + ); + + // Buyer checks the price with proofs + let price_proof = platform + .drive + .prove_tokens_direct_purchase_price(&[token_id_buffer], None, platform_version) + .expect("expected to prove token price"); + + let (_, price_response): (RootHash, BTreeMap<[u8; 32], Option>) = + drive::drive::Drive::verify_token_direct_selling_prices( + &price_proof, + &[token_id_buffer], + true, + platform_version, + ) + .expect("expected to verify token price proof"); + assert_price( + price_response, + &token_id_buffer, + &single_price, + "price in proof mismatch", + ); + // Buyer purchases tokens let purchase_transition = BatchTransition::new_token_direct_purchase_transition( token_id, @@ -357,4 +403,200 @@ mod token_selling_tests { .expect("expected to fetch token balance"); assert_eq!(token_balance, None); } + + /// Given 3 tokens, each of them with different pricing structure, + /// When I create them and set their prices, + /// Then I should get the correct price for each of them + /// And the price should be the same as the one set by the seller. + #[test] + fn test_successful_direct_purchase_multiple_tokens() { + // Given 3 tokens + let pricing_schedules = vec![ + TokenPricingSchedule::SinglePrice(dash_to_credits!(1)), + TokenPricingSchedule::SetPrices(BTreeMap::from([ + (100, dash_to_credits!(10)), + (500, dash_to_credits!(5)), + ])), + TokenPricingSchedule::SetPrices(BTreeMap::new()), + ]; + + // Setup the test + let platform_version = PlatformVersion::latest(); + let mut platform = TestPlatformBuilder::new() + .with_latest_protocol_version() + .build_with_mock_rpc() + .set_genesis_state(); + + let mut rng = StdRng::seed_from_u64(12345); + + let (seller, seller_signer, seller_key) = + setup_identity(&mut platform, rng.gen(), dash_to_credits!(1.0)); + + let mut identity_contract_nonce = 2; + let tokens = pricing_schedules + .into_iter() + .map(|pricing| { + let (contract, token_id) = create_token( + platform_version, + &mut platform, + seller.clone(), + seller_signer.clone(), + seller_key.clone(), + Some(pricing.clone()), + &mut identity_contract_nonce, + ); + + (token_id.to_buffer(), (pricing, contract)) + }) + .collect::>(); + + // + // When I fetch tokens, with or without proofs + // + let token_ids: Vec<[u8; 32]> = tokens.keys().cloned().collect(); + + // Fetch with proofs + let proof = platform + .drive + .prove_tokens_direct_purchase_price(&token_ids, None, platform_version) + .expect("expected to prove token price"); + + let (_, prices_from_proof): (RootHash, BTreeMap<[u8; 32], Option>) = + drive::drive::Drive::verify_token_direct_selling_prices( + &proof, + &token_ids, + true, + platform_version, + ) + .expect("expected to verify token price proof"); + + //Fetch without proofs + let fetched_prices = platform + .drive + .fetch_tokens_direct_purchase_price(&token_ids, None, platform_version) + .expect("expected to fetch token price"); + + // + // Then I get correct prices + // + assert_eq!(fetched_prices.len(), token_ids.len()); + + for (token_id, (expected_price, _)) in &tokens { + // from proof + assert_price( + prices_from_proof.clone(), + token_id, + expected_price, + format!( + "price in proof mismatch for token {}", + token_id.to_hex_string(Case::Lower) + ) + .as_str(), + ); + + // non-proof + assert_price( + fetched_prices.clone(), + token_id, + expected_price, + format!( + "fetched price mismatch for token {}", + token_id.to_hex_string(Case::Lower) + ) + .as_str(), + ); + } + } + + // Helper functions + // + // /\_/\ + //( o.o ) + // > ^ < + // + + /// Asserts that the price for a given token ID matches the expected price. + /// If the price does not match, it will panic. + fn assert_price( + prices: BTreeMap<[u8; 32], Option>, + token_id: &[u8; 32], + expected_price: &TokenPricingSchedule, + msg: &str, + ) { + let price = prices + .get(token_id) + .unwrap_or_else(|| panic!("{}: token not found", msg)) + .as_ref() + .unwrap_or_else(|| panic!("{}: empty token price", msg)); + assert_eq!(price, expected_price, "{}", msg); + } + + /// Creates a token contract with the given owner identity and configuration. + fn create_token( + platform_version: &dpp::version::PlatformVersion, + platform: &mut TempPlatform, + seller: Identity, + seller_signer: SimpleSigner, + seller_key: IdentityPublicKey, + pricing: Option, + identity_contract_nonce: &mut u64, + ) -> (DataContract, Identifier) { + let (contract, token_id) = create_token_contract_with_owner_identity( + platform, + seller.id(), + Some(|token_configuration: &mut TokenConfiguration| { + token_configuration + .distribution_rules_mut() + .set_change_direct_purchase_pricing_rules(ChangeControlRules::V0( + ChangeControlRulesV0 { + authorized_to_make_change: AuthorizedActionTakers::ContractOwner, + admin_action_takers: AuthorizedActionTakers::NoOne, + changing_authorized_action_takers_to_no_one_allowed: false, + changing_admin_action_takers_to_no_one_allowed: false, + self_changing_admin_action_takers_allowed: false, + }, + )); + }), + None, + None, + platform_version, + ); + + let platform_state = platform.state.load(); + + // Seller sets single price + let set_price_transition = + BatchTransition::new_token_change_direct_purchase_price_transition( + token_id, + seller.id(), + contract.id(), + 0, + pricing, // Price per token + None, + None, + &seller_key, + *identity_contract_nonce, + 0, + &seller_signer, + platform_version, + None, + None, + None, + ) + .unwrap(); + *identity_contract_nonce += 1; + + let processing_result = process_test_state_transition( + platform, + set_price_transition, + &platform_state, + platform_version, + ); + + assert_matches!( + processing_result.execution_results().as_slice(), + [StateTransitionExecutionResult::SuccessfulExecution(..)] + ); + (contract, token_id) + } } diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs index 2d90f5bd4e7..d78e1302250 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/mod.rs @@ -1,6 +1,8 @@ #[cfg(feature = "server")] mod fetch_token_direct_purchase_price; +#[cfg(feature = "server")] mod fetch_tokens_direct_purchase_price; +#[cfg(feature = "server")] mod prove_tokens_direct_purchase_price; mod queries; #[cfg(feature = "server")] diff --git a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs index ff8188c3916..1b7f8e5654e 100644 --- a/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs +++ b/packages/rs-drive/src/state_transition_action/batch/batched_transition/token_transition/token_direct_purchase_transition_action/v0/transformer.rs @@ -119,7 +119,6 @@ impl TokenDirectPurchaseTransitionActionV0 { }; // We need to make sure the amount we want to pay is the amount we are expected to pay - let (pricing_schedule, fetch_token_direct_purchase_fee) = drive .fetch_token_direct_purchase_price_with_costs( base.token_id().to_buffer(), From cb959bd2168178d4e158be89be718c55d1ea94d4 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:29:04 +0200 Subject: [PATCH 19/32] refactor: use create_token_with_pricing() --- .../batch/tests/token/direct_selling/mod.rs | 56 ++++++++----------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs index c7405aecced..c9089a96aad 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/direct_selling/mod.rs @@ -28,30 +28,19 @@ mod token_selling_tests { let (buyer, buyer_signer, buyer_key) = setup_identity(&mut platform, rng.gen(), dash_to_credits!(10.0)); - let (contract, token_id) = create_token_contract_with_owner_identity( - &mut platform, - seller.id(), - Some(|token_configuration: &mut TokenConfiguration| { - token_configuration - .distribution_rules_mut() - .set_change_direct_purchase_pricing_rules(ChangeControlRules::V0( - ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::ContractOwner, - admin_action_takers: AuthorizedActionTakers::NoOne, - changing_authorized_action_takers_to_no_one_allowed: false, - changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - }, - )); - }), - None, - None, + let single_price = TokenPricingSchedule::SinglePrice(dash_to_credits!(1)); + + let mut identity_contract_nonce: u64 = 2; + let (contract, token_id) = create_token_with_pricing( platform_version, + &mut platform, + &seller, + &seller_signer, + &seller_key, + Some(single_price.clone()), + &mut identity_contract_nonce, ); - let platform_state = platform.state.load(); - let single_price = TokenPricingSchedule::SinglePrice(dash_to_credits!(1)); - // Seller sets single price let set_price_transition = BatchTransition::new_token_change_direct_purchase_price_transition( @@ -63,7 +52,7 @@ mod token_selling_tests { None, None, &seller_key, - 2, + identity_contract_nonce, 0, &seller_signer, platform_version, @@ -73,6 +62,7 @@ mod token_selling_tests { ) .unwrap(); + let platform_state = platform.state.load(); let processing_result = process_test_state_transition( &mut platform, set_price_transition, @@ -436,12 +426,12 @@ mod token_selling_tests { let tokens = pricing_schedules .into_iter() .map(|pricing| { - let (contract, token_id) = create_token( + let (contract, token_id) = create_token_with_pricing( platform_version, &mut platform, - seller.clone(), - seller_signer.clone(), - seller_key.clone(), + &seller, + &seller_signer, + &seller_key, Some(pricing.clone()), &mut identity_contract_nonce, ); @@ -531,13 +521,13 @@ mod token_selling_tests { assert_eq!(price, expected_price, "{}", msg); } - /// Creates a token contract with the given owner identity and configuration. - fn create_token( + /// Creates a token contract with the given owner identity and configuration, and sets the price. + fn create_token_with_pricing( platform_version: &dpp::version::PlatformVersion, platform: &mut TempPlatform, - seller: Identity, - seller_signer: SimpleSigner, - seller_key: IdentityPublicKey, + seller: &Identity, + seller_signer: &SimpleSigner, + seller_key: &IdentityPublicKey, pricing: Option, identity_contract_nonce: &mut u64, ) -> (DataContract, Identifier) { @@ -574,10 +564,10 @@ mod token_selling_tests { pricing, // Price per token None, None, - &seller_key, + seller_key, *identity_contract_nonce, 0, - &seller_signer, + seller_signer, platform_version, None, None, From 9185295dcd993dd541b125a451ea2c52188a9ee3 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Tue, 15 Apr 2025 14:26:32 +0200 Subject: [PATCH 20/32] fix(sdk): no process-level CryptoProvider available --- packages/dapi-grpc/Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/dapi-grpc/Cargo.toml b/packages/dapi-grpc/Cargo.toml index 110c3cdd936..f229ba3c746 100644 --- a/packages/dapi-grpc/Cargo.toml +++ b/packages/dapi-grpc/Cargo.toml @@ -46,6 +46,7 @@ futures-core = "0.3.30" tonic = { version = "0.13.0", features = [ "codegen", "prost", + "tls-ring", ], default-features = false } serde = { version = "1.0.219", optional = true, features = ["derive"] } serde_bytes = { version = "0.11.12", optional = true } @@ -64,6 +65,7 @@ tonic = { version = "0.13.0", features = [ "transport", "tls-native-roots", "tls-webpki-roots", + "tls-ring", ], default-features = false } [build-dependencies] From 41f43f864e1532319f0c7d2328b7749e640bb0af Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Tue, 15 Apr 2025 14:39:28 +0200 Subject: [PATCH 21/32] feat(sdk) fetch_many for TokenPricingSchedule --- packages/dapi-grpc/build.rs | 6 +- packages/rs-dapi-client/src/transport/grpc.rs | 9 +++ packages/rs-drive-proof-verifier/src/proof.rs | 1 + .../src/proof/token_direct_purchase.rs | 71 +++++++++++++++++++ packages/rs-drive-proof-verifier/src/types.rs | 4 ++ packages/rs-sdk/README.md | 8 +-- packages/rs-sdk/src/mock/requests.rs | 2 + packages/rs-sdk/src/mock/sdk.rs | 3 + packages/rs-sdk/src/platform/fetch_many.rs | 18 +++-- packages/rs-sdk/src/platform/query.rs | 25 ++++++- packages/rs-sdk/tests/fetch/mod.rs | 1 + .../rs-sdk/tests/fetch/token_direct_prices.rs | 22 ++++++ 12 files changed, 159 insertions(+), 11 deletions(-) create mode 100644 packages/rs-drive-proof-verifier/src/proof/token_direct_purchase.rs create mode 100644 packages/rs-sdk/tests/fetch/token_direct_prices.rs diff --git a/packages/dapi-grpc/build.rs b/packages/dapi-grpc/build.rs index 4018934e93b..dc3e1826a86 100644 --- a/packages/dapi-grpc/build.rs +++ b/packages/dapi-grpc/build.rs @@ -73,7 +73,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { // Derive features for versioned messages // // "GetConsensusParamsRequest" is excluded as this message does not support proofs - const VERSIONED_REQUESTS: [&str; 39] = [ + const VERSIONED_REQUESTS: [&str; 40] = [ "GetDataContractHistoryRequest", "GetDataContractRequest", "GetDataContractsRequest", @@ -107,6 +107,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { "GetIdentitiesTokenBalancesRequest", "GetIdentityTokenInfosRequest", "GetIdentitiesTokenInfosRequest", + "GetTokenDirectPurchasePricesRequest", "GetTokenStatusesRequest", "GetTokenTotalSupplyRequest", "GetGroupInfoRequest", @@ -120,7 +121,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { // - "GetStatusResponse" // // "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests - const VERSIONED_RESPONSES: [&str; 38] = [ + const VERSIONED_RESPONSES: [&str; 39] = [ "GetDataContractHistoryResponse", "GetDataContractResponse", "GetDataContractsResponse", @@ -153,6 +154,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig { "GetIdentitiesTokenBalancesResponse", "GetIdentityTokenInfosResponse", "GetIdentitiesTokenInfosResponse", + "GetTokenDirectPurchasePricesResponse", "GetTokenStatusesResponse", "GetTokenTotalSupplyResponse", "GetGroupInfoResponse", diff --git a/packages/rs-dapi-client/src/transport/grpc.rs b/packages/rs-dapi-client/src/transport/grpc.rs index d1337142bdc..e1e010759ae 100644 --- a/packages/rs-dapi-client/src/transport/grpc.rs +++ b/packages/rs-dapi-client/src/transport/grpc.rs @@ -579,3 +579,12 @@ impl_transport_request_grpc!( RequestSettings::default(), get_group_action_signers ); + +// rpc getTokenDirectPurchasePrices(GetTokenDirectPurchasePricesRequest) returns (GetTokenDirectPurchasePricesResponse); +impl_transport_request_grpc!( + platform_proto::GetTokenDirectPurchasePricesRequest, + platform_proto::GetTokenDirectPurchasePricesResponse, + PlatformGrpcClient, + RequestSettings::default(), + get_token_direct_purchase_prices +); diff --git a/packages/rs-drive-proof-verifier/src/proof.rs b/packages/rs-drive-proof-verifier/src/proof.rs index 7c479affc53..8c958f1f481 100644 --- a/packages/rs-drive-proof-verifier/src/proof.rs +++ b/packages/rs-drive-proof-verifier/src/proof.rs @@ -1,5 +1,6 @@ pub mod groups; pub mod identity_token_balance; +pub mod token_direct_purchase; pub mod token_info; pub mod token_status; pub mod token_total_supply; diff --git a/packages/rs-drive-proof-verifier/src/proof/token_direct_purchase.rs b/packages/rs-drive-proof-verifier/src/proof/token_direct_purchase.rs new file mode 100644 index 00000000000..dc7d899b57b --- /dev/null +++ b/packages/rs-drive-proof-verifier/src/proof/token_direct_purchase.rs @@ -0,0 +1,71 @@ +use dapi_grpc::platform::{ + v0::{ + get_token_direct_purchase_prices_request::Version as RequestVersion, + GetTokenDirectPurchasePricesRequest, GetTokenDirectPurchasePricesResponse, Proof, + ResponseMetadata, + }, + VersionedGrpcResponse, +}; +use dpp::{ + dashcore::{secp256k1::hashes::hex::DisplayHex, Network}, + version::PlatformVersion, +}; +use drive::drive::Drive; + +use crate::{ + error::MapGroveDbError, types::TokenDirectPurchasePrices, verify::verify_tenderdash_proof, + ContextProvider, Error, +}; + +use super::FromProof; + +impl FromProof for TokenDirectPurchasePrices { + type Request = GetTokenDirectPurchasePricesRequest; + type Response = GetTokenDirectPurchasePricesResponse; + + fn maybe_from_proof_with_metadata<'a, I: Into, O: Into>( + request: I, + response: O, + _network: Network, + platform_version: &PlatformVersion, + provider: &'a dyn ContextProvider, + ) -> Result<(Option, ResponseMetadata, Proof), Error> + where + Self: 'a, + { + let request: Self::Request = request.into(); + let response: Self::Response = response.into(); + + // Parse response to read proof and metadata + let proof = response.proof().or(Err(Error::NoProofInResult))?; + + let mtd = response.metadata().or(Err(Error::EmptyResponseMetadata))?; + + let token_ids = match request.version.ok_or(Error::EmptyVersion)? { + RequestVersion::V0(v0) => v0.token_ids, + } + .into_iter() + .map(<[u8; 32]>::try_from) + .collect::, _>>() + .map_err(|e| Error::RequestError { + error: format!("token id {} has invalid length", e.to_lower_hex_string()), + })?; + + // Extract content from proof and verify Drive/GroveDB proofs + let (root_hash, tokens): (_, Self) = Drive::verify_token_direct_selling_prices( + &proof.grovedb_proof, + &token_ids, + false, + platform_version, + ) + .map_drive_error(proof, mtd)?; + + verify_tenderdash_proof(proof, mtd, &root_hash, provider)?; + + if tokens.is_empty() { + return Ok((None, mtd.clone(), proof.clone())); + } + + Ok((Some(tokens), mtd.clone(), proof.clone())) + } +} diff --git a/packages/rs-drive-proof-verifier/src/types.rs b/packages/rs-drive-proof-verifier/src/types.rs index c6edb4405ae..3c7daf6ac7d 100644 --- a/packages/rs-drive-proof-verifier/src/types.rs +++ b/packages/rs-drive-proof-verifier/src/types.rs @@ -22,6 +22,7 @@ use dpp::data_contract::document_type::DocumentType; use dpp::fee::Credits; use dpp::platform_value::Value; use dpp::prelude::{IdentityNonce, TimestampMillis}; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; use dpp::version::PlatformVersion; pub use dpp::version::ProtocolVersionVoteCount; use dpp::voting::contender_structs::{Contender, ContenderWithSerializedDocument}; @@ -628,3 +629,6 @@ pub struct ProposerBlockCountByRange(pub u64); #[derive(Debug)] #[cfg_attr(feature = "mocks", derive(serde::Serialize, serde::Deserialize))] pub struct ProposerBlockCountById(pub u64); + +/// Prices for direct purchase of tokens. Retrieved by [TokenPricingSchedule::fetch_many()]. +pub type TokenDirectPurchasePrices = RetrievedObjects; diff --git a/packages/rs-sdk/README.md b/packages/rs-sdk/README.md index b2a19518942..090f002daea 100644 --- a/packages/rs-sdk/README.md +++ b/packages/rs-sdk/README.md @@ -139,7 +139,7 @@ in `packages/rs-dapi-client/src/transport/grpc.rs`. 9. [ ] Implement `FetchMany\` trait for the `Object` (or type defined in `types.rs`), with inner type Request = `Request`, in `packages/rs-sdk/src/platform/fetch_many.rs`. 10. [ ] Add `mod ...;` clause to `packages/rs-sdk/tests/fetch/main.rs` -12. [ ] Implement unit tests in `packages/rs-sdk/tests/fetch/*object*.rs` -13. [ ] Add name of request type to match clause in `packages/rs-sdk/src/mock/sdk.rs` : `load_expectations()` -14. [ ] Start local devnet with `yarn reset && SDK_TEST_DATA=true yarn start` -15. [ ] Generate test vectors with script `packages/rs-sdk/scripts/generate_test_vectors.sh` +11. [ ] Implement unit tests in `packages/rs-sdk/tests/fetch/*object*.rs` +12. [ ] Add name of request type to match clause in `packages/rs-sdk/src/mock/sdk.rs` : `load_expectations()` +13. [ ] Start local devnet with `yarn reset && SDK_TEST_DATA=true yarn start` +14. [ ] Generate test vectors with script `packages/rs-sdk/scripts/generate_test_vectors.sh` diff --git a/packages/rs-sdk/src/mock/requests.rs b/packages/rs-sdk/src/mock/requests.rs index 7eb75c55494..b2e9c1e4f73 100644 --- a/packages/rs-sdk/src/mock/requests.rs +++ b/packages/rs-sdk/src/mock/requests.rs @@ -5,6 +5,7 @@ use dpp::data_contract::group::Group; use dpp::group::group_action::GroupAction; use dpp::tokens::info::IdentityTokenInfo; use dpp::tokens::status::TokenStatus; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; use dpp::{ bincode, block::extended_epoch_info::ExtendedEpochInfo, @@ -446,3 +447,4 @@ impl_mock_response!(ElementFetchRequestItem); impl_mock_response!(EvoNodeStatus); impl_mock_response!(CurrentQuorumsInfo); impl_mock_response!(Group); +impl_mock_response!(TokenPricingSchedule); diff --git a/packages/rs-sdk/src/mock/sdk.rs b/packages/rs-sdk/src/mock/sdk.rs index 342a9c489ab..1e47f8225e5 100644 --- a/packages/rs-sdk/src/mock/sdk.rs +++ b/packages/rs-sdk/src/mock/sdk.rs @@ -229,6 +229,9 @@ impl MockDashPlatformSdk { load_expectation::(&mut dapi, filename)? } "EvoNode" => load_expectation::(&mut dapi, filename)?, + "GetTokenDirectPurchasePricesRequest" => load_expectation::< + proto::GetTokenDirectPurchasePricesRequest, + >(&mut dapi, filename)?, _ => { return Err(Error::Config(format!( "unknown request type {} in {}, missing match arm in load_expectations?", diff --git a/packages/rs-sdk/src/platform/fetch_many.rs b/packages/rs-sdk/src/platform/fetch_many.rs index 1fcdb1043a8..59767c6acbc 100644 --- a/packages/rs-sdk/src/platform/fetch_many.rs +++ b/packages/rs-sdk/src/platform/fetch_many.rs @@ -19,11 +19,10 @@ use dapi_grpc::platform::v0::{ GetDataContractsRequest, GetEpochsInfoRequest, GetEvonodesProposedEpochBlocksByIdsRequest, GetEvonodesProposedEpochBlocksByRangeRequest, GetIdentitiesBalancesRequest, GetIdentityKeysRequest, GetPathElementsRequest, GetProtocolVersionUpgradeStateRequest, - GetProtocolVersionUpgradeVoteStatusRequest, GetVotePollsByEndDateRequest, Proof, - ResponseMetadata, + GetProtocolVersionUpgradeVoteStatusRequest, GetTokenDirectPurchasePricesRequest, + GetVotePollsByEndDateRequest, Proof, ResponseMetadata, }; use dashcore_rpc::dashcore::ProTxHash; -use dpp::data_contract::DataContract; use dpp::identity::KeyID; use dpp::prelude::{Identifier, IdentityPublicKey}; use dpp::util::deserializer::ProtocolVersion; @@ -32,6 +31,7 @@ use dpp::{block::epoch::EpochIndex, prelude::TimestampMillis, voting::vote_polls use dpp::{ block::extended_epoch_info::ExtendedEpochInfo, voting::votes::resource_vote::ResourceVote, }; +use dpp::{data_contract::DataContract, tokens::token_pricing_schedule::TokenPricingSchedule}; use dpp::{document::Document, voting::contender_structs::ContenderWithSerializedDocument}; use drive::grovedb::query_result_type::Key; use drive::grovedb::Element; @@ -39,7 +39,8 @@ use drive_proof_verifier::types::{ Contenders, ContestedResource, ContestedResources, DataContracts, Elements, ExtendedEpochInfos, IdentityBalances, IdentityPublicKeys, MasternodeProtocolVote, MasternodeProtocolVotes, ProposerBlockCountById, ProposerBlockCountByRange, ProposerBlockCounts, - ProtocolVersionUpgrades, ResourceVotesByIdentity, VotePollsGroupedByTimestamp, Voter, Voters, + ProtocolVersionUpgrades, ResourceVotesByIdentity, TokenDirectPurchasePrices, + VotePollsGroupedByTimestamp, Voter, Voters, }; use drive_proof_verifier::{types::Documents, FromProof}; use rs_dapi_client::{ @@ -540,3 +541,12 @@ impl FetchMany for drive_proof_verifier::types::Id impl FetchMany for Element { type Request = GetPathElementsRequest; } + +/// Fetch multiple prices for token direct purchase. +/// +/// ## Supported query types +/// +/// * [`&\[Identifier\]`](dpp::prelude::Identifier) - list of identifiers of tokens whose prices we want to fetch +impl FetchMany for TokenPricingSchedule { + type Request = GetTokenDirectPurchasePricesRequest; +} diff --git a/packages/rs-sdk/src/platform/query.rs b/packages/rs-sdk/src/platform/query.rs index ed8b1797675..39ecbad265d 100644 --- a/packages/rs-sdk/src/platform/query.rs +++ b/packages/rs-sdk/src/platform/query.rs @@ -25,7 +25,8 @@ use dapi_grpc::platform::v0::{ }; use dapi_grpc::platform::v0::{ get_status_request, GetContestedResourceIdentityVotesRequest, - GetPrefundedSpecializedBalanceRequest, GetStatusRequest, GetVotePollsByEndDateRequest, + GetPrefundedSpecializedBalanceRequest, GetStatusRequest, GetTokenDirectPurchasePricesRequest, + GetVotePollsByEndDateRequest, }; use dashcore_rpc::dashcore::{hashes::Hash, ProTxHash}; use dpp::version::PlatformVersionError; @@ -679,3 +680,25 @@ impl Query for EvoNode { Ok(request) } } + +impl Query for &[Identifier] { + fn query(self, prove: bool) -> Result { + if !prove { + unimplemented!("queries without proofs are not supported yet"); + } + + let request: GetTokenDirectPurchasePricesRequest = GetTokenDirectPurchasePricesRequest { + version: Some(proto::get_token_direct_purchase_prices_request::Version::V0( + proto::get_token_direct_purchase_prices_request::GetTokenDirectPurchasePricesRequestV0 { + token_ids: self + .iter() + .map(|identifier| identifier.to_vec()) + .collect(), + prove, + }, + )), + }; + + Ok(request) + } +} diff --git a/packages/rs-sdk/tests/fetch/mod.rs b/packages/rs-sdk/tests/fetch/mod.rs index eb57ca16159..bb16b2a04fa 100644 --- a/packages/rs-sdk/tests/fetch/mod.rs +++ b/packages/rs-sdk/tests/fetch/mod.rs @@ -27,4 +27,5 @@ mod mock_fetch_many; mod prefunded_specialized_balance; mod protocol_version_vote_count; mod protocol_version_votes; +mod token_direct_prices; mod tokens; diff --git a/packages/rs-sdk/tests/fetch/token_direct_prices.rs b/packages/rs-sdk/tests/fetch/token_direct_prices.rs new file mode 100644 index 00000000000..3e450cf8939 --- /dev/null +++ b/packages/rs-sdk/tests/fetch/token_direct_prices.rs @@ -0,0 +1,22 @@ +use dash_sdk::platform::FetchMany; +use dpp::{prelude::Identifier, tokens::token_pricing_schedule::TokenPricingSchedule}; + +use crate::fetch::config::Config; + +/// Given some dummy data contract ID, when I fetch data contract, I get None because it doesn't exist. +#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +async fn test_direct_prices_token_not_found() { + super::common::setup_logs(); + + pub const DATA_CONTRACT_ID_BYTES: [u8; 32] = [1; 32]; + let id = Identifier::from_bytes(&DATA_CONTRACT_ID_BYTES).expect("parse identity id"); + + let cfg = Config::new(); + let sdk = cfg.setup_api("test_direct_prices_token_not_found").await; + + let result = TokenPricingSchedule::fetch_many(&sdk, &[id][..]) + .await + .expect("query should succeed"); + + assert!(result.is_empty(), "result should be empty"); +} From a4565d10b0b5891ab27fcb23c46de06d3b1b1511 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Tue, 15 Apr 2025 14:51:15 +0200 Subject: [PATCH 22/32] fix: sdk test data typo --- .../platform_events/initialization/create_genesis_state/mod.rs | 2 +- .../initialization/create_genesis_state/test/tokens.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs index 63693e863b4..3745cb4218b 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/mod.rs @@ -7,7 +7,7 @@ use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; mod common; -#[cfg(create_sdk_test_data)] +#[cfg(any(create_sdk_test_data, test))] mod test; pub mod v0; pub mod v1; diff --git a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs index 6343414cf41..2771fa89b5e 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs @@ -198,6 +198,7 @@ impl Platform { new_tokens_destination_identity_rules: ChangeControlRulesV0::default().into(), minting_allow_choosing_destination: true, minting_allow_choosing_destination_rules: ChangeControlRulesV0::default().into(), + change_direct_purchase_pricing_rules: ChangeControlRulesV0::default().into(), } .into(), manual_minting_rules: ChangeControlRulesV0 { From fcb7463c1880d71bf4138646876a2a9de2b04670 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Apr 2025 08:51:52 +0200 Subject: [PATCH 23/32] fix: fetch prices with duplicate token ids --- .../src/proof/token_direct_purchase.rs | 8 ++- .../rs-sdk/tests/fetch/token_direct_prices.rs | 61 +++++++++++++++++-- 2 files changed, 63 insertions(+), 6 deletions(-) diff --git a/packages/rs-drive-proof-verifier/src/proof/token_direct_purchase.rs b/packages/rs-drive-proof-verifier/src/proof/token_direct_purchase.rs index dc7d899b57b..e888a79043f 100644 --- a/packages/rs-drive-proof-verifier/src/proof/token_direct_purchase.rs +++ b/packages/rs-drive-proof-verifier/src/proof/token_direct_purchase.rs @@ -1,3 +1,5 @@ +use std::collections::BTreeSet; + use dapi_grpc::platform::{ v0::{ get_token_direct_purchase_prices_request::Version as RequestVersion, @@ -46,10 +48,12 @@ impl FromProof for TokenDirectPurchasePrice } .into_iter() .map(<[u8; 32]>::try_from) - .collect::, _>>() + .collect::, _>>() // BTreeSet to make it unique .map_err(|e| Error::RequestError { error: format!("token id {} has invalid length", e.to_lower_hex_string()), - })?; + })? + .into_iter() + .collect::>(); // Extract content from proof and verify Drive/GroveDB proofs let (root_hash, tokens): (_, Self) = Drive::verify_token_direct_selling_prices( diff --git a/packages/rs-sdk/tests/fetch/token_direct_prices.rs b/packages/rs-sdk/tests/fetch/token_direct_prices.rs index 3e450cf8939..337e622c02f 100644 --- a/packages/rs-sdk/tests/fetch/token_direct_prices.rs +++ b/packages/rs-sdk/tests/fetch/token_direct_prices.rs @@ -1,15 +1,18 @@ use dash_sdk::platform::FetchMany; use dpp::{prelude::Identifier, tokens::token_pricing_schedule::TokenPricingSchedule}; -use crate::fetch::config::Config; +use crate::fetch::{ + config::Config, + generated_data::{TOKEN_ID_0, TOKEN_ID_1}, +}; /// Given some dummy data contract ID, when I fetch data contract, I get None because it doesn't exist. #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn test_direct_prices_token_not_found() { super::common::setup_logs(); - pub const DATA_CONTRACT_ID_BYTES: [u8; 32] = [1; 32]; - let id = Identifier::from_bytes(&DATA_CONTRACT_ID_BYTES).expect("parse identity id"); + pub const TOKEN_ID_BYTES: [u8; 32] = [1; 32]; + let id = Identifier::from_bytes(&TOKEN_ID_BYTES).expect("parse token id"); let cfg = Config::new(); let sdk = cfg.setup_api("test_direct_prices_token_not_found").await; @@ -18,5 +21,55 @@ async fn test_direct_prices_token_not_found() { .await .expect("query should succeed"); - assert!(result.is_empty(), "result should be empty"); + println!("result: {:?}", result); + assert_eq!(result.len(), 1); + let first = result.first().expect("result should have first"); + assert_eq!(first.0, &id); + assert!(first.1.is_none(), "proof of non-existence expected"); +} + +/// Given some dummy data contract ID, when I fetch data contract, I get None because it doesn't exist. +#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +async fn test_direct_prices_tokens_found_no_prices() { + super::common::setup_logs(); + let cfg = Config::new(); + let sdk = cfg.setup_api("test_direct_prices_token_not_found").await; + + let ids = [*TOKEN_ID_0, *TOKEN_ID_1]; + + let result = TokenPricingSchedule::fetch_many(&sdk, &ids[..]) + .await + .expect("query should succeed"); + + assert_eq!( + result.len(), + ids.len(), + "each queried token should be present" + ); + for id in &ids { + let item = result.get(id).expect("result should contain token"); + assert!(item.is_none(), "proof of non-existence expected"); + } +} + +/// Given some dummy data contract ID, when I fetch data contract, I get None because it doesn't exist. +#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +async fn test_direct_prices_duplicate_token() { + super::common::setup_logs(); + let cfg = Config::new(); + let sdk = cfg.setup_api("test_direct_prices_token_not_found").await; + + let ids = [*TOKEN_ID_0, *TOKEN_ID_0]; + + let result = TokenPricingSchedule::fetch_many(&sdk, &ids[..]) + .await + .expect("query should succeed"); + + assert_eq!( + result + .get(&*TOKEN_ID_0) + .expect("result should contain token"), + &None, + "proof of non-existence expected" + ); } From ddc3507acb85529c64e71b4aa9230b99bca0abb0 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Apr 2025 09:20:30 +0200 Subject: [PATCH 24/32] test(drive-abci): create token direct pricing test data for local network --- .../create_genesis_state/test/mod.rs | 1 + .../create_genesis_state/test/tokens.rs | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/mod.rs index cac997fa91b..c4aec29856b 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/mod.rs @@ -27,6 +27,7 @@ impl Platform { } self.create_data_for_group_token_queries(block_info, transaction, platform_version)?; + self.create_data_for_token_direct_prices(block_info, transaction, platform_version)?; Ok(()) } diff --git a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs index 2771fa89b5e..4faba5c73bf 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs @@ -24,10 +24,12 @@ use dpp::tokens::calculate_token_id; use dpp::tokens::status::v0::TokenStatusV0; use dpp::tokens::status::TokenStatus; use dpp::tokens::token_event::TokenEvent; +use dpp::tokens::token_pricing_schedule::TokenPricingSchedule; use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; use rand::rngs::StdRng; use rand::SeedableRng; +use std::collections::BTreeMap; use std::sync::LazyLock; const IDENTITY_ID_1: Identifier = Identifier::new([1; 32]); @@ -102,6 +104,52 @@ impl Platform { Ok(()) } + /// Create some test data for token direct prices. + /// + /// Define single price pricing for [TOKEN_ID_1], and pricing schedule for [TOKEN_ID_2]. + /// Leave [TOKEN_ID_0] without pricing. + /// + /// Tokens must be already created. + pub(crate) fn create_data_for_token_direct_prices( + &self, + block_info: &BlockInfo, + transaction: TransactionArg, + platform_version: &PlatformVersion, + ) -> Result<(), Error> { + self.drive.token_set_direct_purchase_price( + TOKEN_ID_1.to_buffer(), + Some(TokenPricingSchedule::SinglePrice(25)), + block_info, + true, + transaction, + platform_version, + )?; + + let pricing = TokenPricingSchedule::SetPrices(BTreeMap::from([ + (0, 1000), + (100, 900), + (200, 800), + (300, 700), + (400, 600), + (500, 500), + (600, 400), + (700, 300), + (800, 200), + (900, 100), + ])); + + self.drive.token_set_direct_purchase_price( + TOKEN_ID_2.to_buffer(), + Some(pricing), + block_info, + true, + transaction, + platform_version, + )?; + + Ok(()) + } + fn register_identities( &self, block_info: &BlockInfo, From 7543abbdc8daaef27e21c798b7446d76e3048680 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Apr 2025 09:23:27 +0200 Subject: [PATCH 25/32] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../fetch_tokens_direct_purchase_price/mod.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs index ae152c6f606..b4c44fdd468 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs @@ -9,17 +9,17 @@ use grovedb::TransactionArg; use std::collections::BTreeMap; impl Drive { - /// Fetches token statuses from the backing store. + /// Fetches token direct purchase prices from the backing store. /// /// # Arguments /// - /// * `token_ids` - A list of token IDs whose infos are to be fetched. + /// * `token_ids` - A list of token IDs whose direct purchase prices are to be fetched. /// * `transaction` - The current transaction context. /// * `platform_version` - The version of the platform to use for compatibility checks. /// /// # Returns /// - /// * `Result>, Error>` - A map of token IDs to their corresponding infos, or an error. + /// * `Result>, Error>` - A map of token IDs to their corresponding pricing schedules, or an error. /// /// # Errors /// @@ -35,10 +35,12 @@ impl Drive { self.fetch_tokens_direct_purchase_price_v0(token_ids, transaction, platform_version) } version => Err(Error::Drive(DriveError::UnknownVersionMismatch { - method: "fetch_token_statuses".to_string(), - known_versions: vec![0], - received: version, - })), + version => Err(Error::Drive(DriveError::UnknownVersionMismatch { +- method: "fetch_token_statuses".to_string(), ++ method: "fetch_tokens_direct_purchase_price".to_string(), + known_versions: vec![0], + received: version, + })), } } } From df40d0c4a56dd2ac0bbd3ec64f52ae45b0666010 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Apr 2025 09:28:59 +0200 Subject: [PATCH 26/32] chore: fix merge issue --- .../fetch_tokens_direct_purchase_price/mod.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs index b4c44fdd468..e35139480c4 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs @@ -35,12 +35,10 @@ impl Drive { self.fetch_tokens_direct_purchase_price_v0(token_ids, transaction, platform_version) } version => Err(Error::Drive(DriveError::UnknownVersionMismatch { - version => Err(Error::Drive(DriveError::UnknownVersionMismatch { -- method: "fetch_token_statuses".to_string(), -+ method: "fetch_tokens_direct_purchase_price".to_string(), - known_versions: vec![0], - received: version, - })), + method: "fetch_tokens_direct_purchase_price".to_string(), + known_versions: vec![0], + received: version, + })), } } } From 62cffb4055c96999ed2dbef6f02fb4e303c3cba8 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Apr 2025 11:30:50 +0200 Subject: [PATCH 27/32] test(sdk): test_direct_prices_tokens_ok --- .../create_genesis_state/test/tokens.rs | 19 ++++-------- .../rs-sdk/tests/fetch/token_direct_prices.rs | 29 ++++++++++++++----- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs index 4faba5c73bf..89e3bcc85d9 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs @@ -29,7 +29,6 @@ use dpp::version::PlatformVersion; use drive::grovedb::TransactionArg; use rand::rngs::StdRng; use rand::SeedableRng; -use std::collections::BTreeMap; use std::sync::LazyLock; const IDENTITY_ID_1: Identifier = Identifier::new([1; 32]); @@ -125,18 +124,12 @@ impl Platform { platform_version, )?; - let pricing = TokenPricingSchedule::SetPrices(BTreeMap::from([ - (0, 1000), - (100, 900), - (200, 800), - (300, 700), - (400, 600), - (500, 500), - (600, 400), - (700, 300), - (800, 200), - (900, 100), - ])); + let pricing = TokenPricingSchedule::SetPrices( + (0..=900) + .step_by(100) + .map(|amount| (amount, 1000 - amount)) + .collect(), + ); self.drive.token_set_direct_purchase_price( TOKEN_ID_2.to_buffer(), diff --git a/packages/rs-sdk/tests/fetch/token_direct_prices.rs b/packages/rs-sdk/tests/fetch/token_direct_prices.rs index 337e622c02f..8e561f7abc7 100644 --- a/packages/rs-sdk/tests/fetch/token_direct_prices.rs +++ b/packages/rs-sdk/tests/fetch/token_direct_prices.rs @@ -3,10 +3,10 @@ use dpp::{prelude::Identifier, tokens::token_pricing_schedule::TokenPricingSched use crate::fetch::{ config::Config, - generated_data::{TOKEN_ID_0, TOKEN_ID_1}, + generated_data::{TOKEN_ID_0, TOKEN_ID_1, TOKEN_ID_2}, }; -/// Given some dummy data contract ID, when I fetch data contract, I get None because it doesn't exist. +/// Given some dummy token ID, when I fetch token prices, I get proof of non-existence. #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn test_direct_prices_token_not_found() { super::common::setup_logs(); @@ -28,14 +28,16 @@ async fn test_direct_prices_token_not_found() { assert!(first.1.is_none(), "proof of non-existence expected"); } -/// Given some dummy data contract ID, when I fetch data contract, I get None because it doesn't exist. +/// Given some existing token IDs, when I fetch token prices, I get correct results. +/// +/// See [Platform::create_data_for_token_direct_prices](drive_abci::platform_types::platform::Platform::create_data_for_token_direct_prices) for token definitions. #[tokio::test(flavor = "multi_thread", worker_threads = 1)] -async fn test_direct_prices_tokens_found_no_prices() { +async fn test_direct_prices_tokens_ok() { super::common::setup_logs(); let cfg = Config::new(); let sdk = cfg.setup_api("test_direct_prices_token_not_found").await; - let ids = [*TOKEN_ID_0, *TOKEN_ID_1]; + let ids = [*TOKEN_ID_0, *TOKEN_ID_1, *TOKEN_ID_2]; let result = TokenPricingSchedule::fetch_many(&sdk, &ids[..]) .await @@ -46,9 +48,20 @@ async fn test_direct_prices_tokens_found_no_prices() { ids.len(), "each queried token should be present" ); - for id in &ids { - let item = result.get(id).expect("result should contain token"); - assert!(item.is_none(), "proof of non-existence expected"); + + assert!(matches!(result.get(&*TOKEN_ID_0), Some(None))); + assert!(matches!( + result.get(&*TOKEN_ID_1), + Some(Some(TokenPricingSchedule::SinglePrice(25))) + )); + + let Some(Some(TokenPricingSchedule::SetPrices(schedule))) = result.get(&*TOKEN_ID_2) else { + panic!("expected token pricing schedule"); + }; + + assert_eq!(schedule.len(), 10); + for (amount, price) in schedule { + assert_eq!(*price, 1000 - amount); } } From 2a97c507e52c456106c3c60870f99a8aebf2c362 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Apr 2025 12:52:32 +0200 Subject: [PATCH 28/32] chore: rabbit ai feedback --- .../protos/platform/v0/platform.proto | 29 ++++++++++++++++++- .../token_direct_purchase_prices/mod.rs | 2 +- .../v0/mod.rs | 4 +-- .../rs-sdk/tests/fetch/token_direct_prices.rs | 9 ++++-- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index 0b735b67ea0..8f113a8eaba 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -1336,43 +1336,70 @@ message GetTokenStatusesResponse { oneof version { GetTokenStatusesResponseV0 v0 = 1; } } +// Response to GetTokenDirectPurchasePricesRequest, containing information about +// direct purchase prices defined for requested token IDs. message GetTokenDirectPurchasePricesResponse { message GetTokenDirectPurchasePricesResponseV0 { + // Contains the individual price tier for a specific quantity of tokens. message PriceForQuantity { + // Minimum quantity of tokens to purchase to get this price. uint64 quantity = 1; + // Price for the specified quantity of tokens. uint64 price = 2; } + // Contains list of price tiers for a specific token. message PricingSchedule { repeated PriceForQuantity price_for_quantity = 1; } message TokenDirectPurchasePriceEntry { + // 32-byte token identifier bytes token_id = 1; // Price of the token; optional oneof price { + // Fixed price for the token. uint64 fixed_price = 2; + // Tiered pricing for the token, where the price varies based on the + // quantity purchased. PricingSchedule variable_price = 3; } } - + // For each requested token, contains list of token IDs and their + // corresponding direct purchase prices. message TokenDirectPurchasePrices { repeated TokenDirectPurchasePriceEntry token_direct_purchase_price = 1; } oneof result { + // Contains the list of token IDs and their corresponding direct TokenDirectPurchasePrices token_direct_purchase_prices = 1; + // Requested information in a form of cryptographic proof. + // In Rust, use `FromProof` trait to convert it to the actual data. Proof proof = 2; } + // Metadata about the blockchain state. ResponseMetadata metadata = 3; } oneof version { GetTokenDirectPurchasePricesResponseV0 v0 = 1; } } +// Retrieve direct purchase prices defined for one or more tokens. +// +// Some tokens can have a direct purchase price defined using +// `TokenSetPriceForDirectPurchaseTransition` (see `dpp` crate for details). +// This request retrieves the direct purchase prices for those tokens and +// returns [GetTokenDirectPurchasePricesResponse]. message GetTokenDirectPurchasePricesRequest { message GetTokenDirectPurchasePricesRequestV0 { + // List of token IDs to get prices for. + // + // The list must not be empty. + // Token IDs must have 32 bytes and be unique. + // Results for non-unique token IDs are undefined. repeated bytes token_ids = 1; + // Whether to return proofs for the response, or just direct response. bool prove = 2; } oneof version { GetTokenDirectPurchasePricesRequestV0 v0 = 1; } diff --git a/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/mod.rs b/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/mod.rs index e71568c260f..3af62ccf3d7 100644 --- a/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/mod.rs +++ b/packages/rs-drive-abci/src/query/token_queries/token_direct_purchase_prices/mod.rs @@ -22,7 +22,7 @@ impl Platform { let Some(version) = version else { return Ok(QueryValidationResult::new_with_error( QueryError::DecodingError( - "could not decode token direct pruchase prices query".to_string(), + "could not decode token direct purchase prices query".to_string(), ), )); }; diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/v0/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/v0/mod.rs index 146e292f1fc..98bf6a135f9 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/v0/mod.rs @@ -11,12 +11,10 @@ impl Drive { platform_version: &PlatformVersion, ) -> Result, Error> { let path_query = Self::token_direct_purchase_prices_query(token_ids); - let mut drive_operations = Vec::new(); // actually, we don't need it - self.grove_get_proved_path_query( &path_query, transaction, - &mut drive_operations, + &mut Vec::new(), &platform_version.drive, ) } diff --git a/packages/rs-sdk/tests/fetch/token_direct_prices.rs b/packages/rs-sdk/tests/fetch/token_direct_prices.rs index 8e561f7abc7..377ded74eb6 100644 --- a/packages/rs-sdk/tests/fetch/token_direct_prices.rs +++ b/packages/rs-sdk/tests/fetch/token_direct_prices.rs @@ -65,22 +65,25 @@ async fn test_direct_prices_tokens_ok() { } } -/// Given some dummy data contract ID, when I fetch data contract, I get None because it doesn't exist. +/// Given two identical existing token IDs, +/// when we fetch direct purchase prices, +/// we receive only one in response. #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn test_direct_prices_duplicate_token() { super::common::setup_logs(); let cfg = Config::new(); let sdk = cfg.setup_api("test_direct_prices_token_not_found").await; - let ids = [*TOKEN_ID_0, *TOKEN_ID_0]; + let ids = [*TOKEN_ID_2, *TOKEN_ID_2]; let result = TokenPricingSchedule::fetch_many(&sdk, &ids[..]) .await .expect("query should succeed"); + assert_eq!(result.len(), 1, "only one token should be present"); assert_eq!( result - .get(&*TOKEN_ID_0) + .get(&*TOKEN_ID_2) .expect("result should contain token"), &None, "proof of non-existence expected" From b263b24f98cc00e1936dd13dbd24d7e8e8a79d74 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Apr 2025 12:58:42 +0200 Subject: [PATCH 29/32] test: fix tests --- packages/rs-sdk/tests/fetch/token_direct_prices.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/rs-sdk/tests/fetch/token_direct_prices.rs b/packages/rs-sdk/tests/fetch/token_direct_prices.rs index 377ded74eb6..a0f7d61f201 100644 --- a/packages/rs-sdk/tests/fetch/token_direct_prices.rs +++ b/packages/rs-sdk/tests/fetch/token_direct_prices.rs @@ -35,7 +35,7 @@ async fn test_direct_prices_token_not_found() { async fn test_direct_prices_tokens_ok() { super::common::setup_logs(); let cfg = Config::new(); - let sdk = cfg.setup_api("test_direct_prices_token_not_found").await; + let sdk = cfg.setup_api("test_direct_prices_tokens_ok").await; let ids = [*TOKEN_ID_0, *TOKEN_ID_1, *TOKEN_ID_2]; @@ -72,7 +72,7 @@ async fn test_direct_prices_tokens_ok() { async fn test_direct_prices_duplicate_token() { super::common::setup_logs(); let cfg = Config::new(); - let sdk = cfg.setup_api("test_direct_prices_token_not_found").await; + let sdk = cfg.setup_api("test_direct_prices_duplicate_token").await; let ids = [*TOKEN_ID_2, *TOKEN_ID_2]; @@ -81,11 +81,11 @@ async fn test_direct_prices_duplicate_token() { .expect("query should succeed"); assert_eq!(result.len(), 1, "only one token should be present"); - assert_eq!( + assert!( result .get(&*TOKEN_ID_2) - .expect("result should contain token"), - &None, - "proof of non-existence expected" + .expect("result should contain token") + .is_some(), + "pricing info expected" ); } From 12c358eed73e3986aae650e181df0707a39ed827 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Apr 2025 12:58:55 +0200 Subject: [PATCH 30/32] test(sdk): direct prices test vectors --- .../test_direct_prices_duplicate_token/.gitkeep | 0 ...09eda09b939ada887a7461372b2de1a8ea09f04.json | Bin 0 -> 36603 bytes ...c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json | 1 + .../test_direct_prices_token_not_found/.gitkeep | 0 ...b261e18b4fb75c07eb5a3d9068740c6cc344365.json | Bin 0 -> 34887 bytes ...c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json | 1 + .../test_direct_prices_tokens_ok/.gitkeep | 0 ...77baf567bad67f5d1deb80c70f0ef3a9a9da582.json | Bin 0 -> 37435 bytes ...c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json | 1 + 9 files changed, 3 insertions(+) create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/.gitkeep create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/msg_GetTokenDirectPurchasePricesRequest_91156f16981151657eec7a09309eda09b939ada887a7461372b2de1a8ea09f04.json create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/quorum_pubkey-106-6e35482a0100e4cda834cf0e4c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_token_not_found/.gitkeep create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_token_not_found/msg_GetTokenDirectPurchasePricesRequest_edf9361508e2800e81790c30ab261e18b4fb75c07eb5a3d9068740c6cc344365.json create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_token_not_found/quorum_pubkey-106-6e35482a0100e4cda834cf0e4c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_tokens_ok/.gitkeep create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_tokens_ok/msg_GetTokenDirectPurchasePricesRequest_126bb11190a05480b657dbd7b77baf567bad67f5d1deb80c70f0ef3a9a9da582.json create mode 100644 packages/rs-sdk/tests/vectors/test_direct_prices_tokens_ok/quorum_pubkey-106-6e35482a0100e4cda834cf0e4c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json diff --git a/packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/.gitkeep b/packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/msg_GetTokenDirectPurchasePricesRequest_91156f16981151657eec7a09309eda09b939ada887a7461372b2de1a8ea09f04.json b/packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/msg_GetTokenDirectPurchasePricesRequest_91156f16981151657eec7a09309eda09b939ada887a7461372b2de1a8ea09f04.json new file mode 100644 index 0000000000000000000000000000000000000000..a823a90acb0e54a97bce7ecc9a49dbc016fa057d GIT binary patch literal 36603 zcmeI5&2Ae<5QKBqQwTcqz+I7)=$FU?7)CD9!7yM4w&RPTcTasYBWhQXt@#F$Ap`+v zTPw~_cU5)u?9u?gpPipye7pJl<^89R7jMqL=aOG+Pe14C>!%MlAOCp&=a>BQZ5hCz z`=8Fw=lODTdgJ_jceT8l4%6~--fx$e)7ACza-LV0(|*0w^=>tIS`EIMmv2t%v8x!S z%hlz4d05Vzr&WXxa@((m9+#KX^$Le+UPXUc2ftlyI$f>#R?A+l)|n2gO{NF$ zKFDP?cHXU`-%lqF-`!{RKhF{SJgt!W@9^9hKk*XK{)Zc^x9KmUDG-n`Aq*P0yS)FiQKzxn zW83DiIbP+*ZTV*^R~;+duahtdmoT@aLfD7;-zWgSumMFm@k+N4{$~cB^iJuVKJ5NNEK!|9+iFH01PNgD<-|e-#Pc5rFJwI4f zY%1O*bW+^kuLCTJDFG#{ybhbNnBU~@{d9+3ehyF_08SIp!UCen?k#dI0~!JJNGz@5 z$>a+7|7Heu7Gh1%CwcJ}m&ZG`f$y5m!gGl;qA7D9k;^pie;gjUvkCc=E%HDu3spW= zKx-YYVFbGZ|Bvf$IlcZ&45^3{7p<_7Y2#tZ)PpUKTtAX|Gm6D-h=r}X21oNq>`5Ih z*N+nW*DosWACJt7_WP$$wyB1n2w)L>g)8}{lEfAVIsOV%``0Js5bQh)!n7RlvIbD(po|HE>yQFjp#6p znCc*r%(7CAoYM@T&`8FLb9BTMaqdPQ*6VPO(BWc)`MLuaYoGPJBq$cF&0D$ zhCb>m>noAS)`?<$NZ5OS->lpjE<&8^Xw^lP&J$H$MzS>lpITZU`kr-q7b$P((^Q9aY81Z@?fSv3#Np3Qy`$4Sw`?RFcnq*U{^;{;dpX^ zNW@bNL5vT}<_JwZ$wJ~kK!F2xpua?Qrb0;}6=blY9F)xlSX0r&U!oFp%M@5&wj>)8 ze_T(@Q+ZXR@uT3-2#&~2+?+zY+cB}B5Hg})l?J0NP(CvSU*!#RI=+4Ri2ossHF2}ahF0-l=g%uP?cVG z$x9_J`xom=KMznYq>Pug2Hi%tSh_I;6e|r%xKoAHtdBJrVKCT?2h8*@GbMwoHbmkn zBIB`xQN?OZB6Sy4-Q+G40V~CLvUuSW1x2B3Sw0wai^ua-Ffw>3vky*7Q7G0BUaZMz zqfIfnGbQPmDXmm(U1S&O%=Uhy2Ig`}zfk9{astuSB#%beNZ`uf-H*W;AF0?fx4HMn zV9Ts zrdUzQlNj739VMz{Ar+z%?{7>seu)xU8!muIxpeR}7EOhk@!+5FatgghWgUZ39XTke z_0`}|oN`bsB%Y)owUHE5)@Ui_uYihss6;YedAO};*|=NEhQ3;HD(g1I&_|u-Ww2rw zdDL-kSwyHxl{!_1?6aoj8DK$4o>c3U{!;me z7t^`eMK$*zoLx**gk%`Ox^osXQwXU9*6&m`ahH1%G0m63#@QMd_S~DYGK_;&%E}7f zo|dyk80oek>!p=(w?&bi(Gl-54K7PZ?C1A`2XAH7u}&w80vcgEw0k(c)~?+`8pNRDstj z%8YMVnNyZCsOp?nRPs>WfHEzZDPyNHMS8Z7=1E|-pyX3}M5VGAphJofKQ}<7C{*tY zs_53(2-P}ZZUbhOU95CtK4uDVNk$m2;K~+;L3AG7TB)0+&lVxkZV_P3`LnvZ%AF}; z&<2(VQ^u&9fQ?QXDR!6SV${_FGrJI&Or-zh!-Fyvzf{P8)Ri{CQ|g?Qjr>?&K_u_{ zTB)inN=T}au}ij4)g4UK=#Z{qML5ux6Oz%1r5p1xK;efbYk&<<23V%}T|mkBo2EPR2v$ai z=-hDU;vh!3p>Z{};}pm6)NJlwVmExP(l>YD3j8 z{$RW@!P|ILzOXExvJQl#AR?q!hSF<;2nt>vBE{OT2}x=DwXyaJg-uAWto(n0uw6Iz z9ptq&L0FbqQ2Vl#tJ4c1sRO?`8fEb(zp~`md4rjcS0=t_C13PXzVwD`zVs#EGE={B zhVPUq-=(zp_8##CE5X^`mE_>9ZpY+f3JTC1nTWstLny-|JtZ&oOr{(`IWqN!6e;HR zQ|%(}eZVvK^-A!GN*xr#vUw=V!+f(o1)K4P>jC=MrJi`Z>8rc+(>)+>rkI=h5v)Ro zm4~crxC^{K5!BmF2fN5eSTJa+uV$gt&XmAw)XS8Vxvi1(S;J%9;#s>DZHYg0t1w=Nj7R*7ggu|qGi0nmhrMtGbR1UNS#u(QAJng^w)rrQ=re3X8p>ZWbDmjEILsctSTK!y;)x;9<|$=k{zVd zp#noBvY?QnDv%@|i?fW_ZkzE^iga6JSrkYPq6)4sXvz?v2F|(zy0TMBlX}(%W_c=B zKHA}foNbt~k%#H2wGm=Q76E2$hvzrv-=F1DrNirE>2i7LAo>SOVG zi@>WGNtxJ2BK?%a3-A4hEmBbDMgMtFws1g|4%%yqrARYx&bp})B)REf4 za+jhou3NSAtX=TO|H)xGY^HfiYn#)|79SshNF4U39}P}3t&djv;PuEGt6#N?{PXVi EAD<5IfdBvi literal 0 HcmV?d00001 diff --git a/packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/quorum_pubkey-106-6e35482a0100e4cda834cf0e4c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json b/packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/quorum_pubkey-106-6e35482a0100e4cda834cf0e4c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json new file mode 100644 index 00000000000..0420cd9b6bc --- /dev/null +++ b/packages/rs-sdk/tests/vectors/test_direct_prices_duplicate_token/quorum_pubkey-106-6e35482a0100e4cda834cf0e4c5e8de47d162a958d61ac778e6a1cc4ab9a8936.json @@ -0,0 +1 @@ +96762a9ce541e2f3a8435ab5cbedcb8d90f897dfab2db2cb941aed99c28c9f406ce51124ea44eb2c92fe51336009a66f \ No newline at end of file diff --git a/packages/rs-sdk/tests/vectors/test_direct_prices_token_not_found/.gitkeep b/packages/rs-sdk/tests/vectors/test_direct_prices_token_not_found/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/rs-sdk/tests/vectors/test_direct_prices_token_not_found/msg_GetTokenDirectPurchasePricesRequest_edf9361508e2800e81790c30ab261e18b4fb75c07eb5a3d9068740c6cc344365.json b/packages/rs-sdk/tests/vectors/test_direct_prices_token_not_found/msg_GetTokenDirectPurchasePricesRequest_edf9361508e2800e81790c30ab261e18b4fb75c07eb5a3d9068740c6cc344365.json new file mode 100644 index 0000000000000000000000000000000000000000..25c672c93c94eae1e9ccd0bd6debe3f4bc422f05 GIT binary patch literal 34887 zcmeI5%Z^k>7Dao^S0KhYs4S|$<)7#euuxB$fn~|Gu-g;Fzk98Spem~kRIJ-Z^1xCW zGOOamdF*}miF?!Het7o$`HSD)zW?RNcR#=Q{`m(!`h%_eD_YnWH2V%V=9f^e_v)9uaa=FT79xcpPLbCb(I zZ%%i_HPW5?-rbI$uk_PW9az9cu z1K6S1?dzwL8^!-4GNN-qR)W5#m%sAk-6ytL-^XwcoJX9HX4rm)F6ZmpFNbIDIx&B< zl^(L?f|Z|ZpvOFXTt;g*%Kzp5yELEgje(B1$6__MG+j7cBK1Em?)?0j%$HDHc#|x; z+FA_frPz}^y4)Wo?(aWXyuV(W5AN@q*tT@TR|s$s{45vw(n-O^tGNEPRo&m;lmX(& z7Q0A96TDR5hHSLJUVhs|ZeN~wwUB`CNv*!9m8x0RTU+2OJl6!0Al2Kgp$Xj)P1Y#b z_F{LZ)_{i~Qo6%Lu&PwVs(7(G3L+vt0^3LA2OKkAoGAxRBm-{s^mBqhm?s5lR9wYP#}>ydX(!#PRPvM zN$_D(B*+vBeD)XnCz8a`DPwy`%KQG@oY)mC0Ip56siKMJM8&J{_6W~$QOavb@tCnh z_`pCfAnJwng^HSREa`zIYUw3axHibn-HeM9vhj=?Gy7R+0`8?jtSVN8@H4O!)&Anv zN0H%b@+eV=X9z-A56a~TZ9HTV>wf@(R@ejc1=f`gH3d4T)XH{9GD~4gM;rf$D!?66 zaQ`@xYDlgp@pAl7GLtSq|hR|I8L^inH~iyT!P7BvO2E8S=7Mfj{zJ);&` zv#N!GIi8ZQSKmdN42Hfglh^t~)W}s`6rfjNQ3eINdcj38IWYAErBrz49>g5kEJs;2 z6O+mlS}*kxN?ZGaYq8XNB$C$Cs->GG1`SfOaDPlvRB`GV6?e>1R8jfayrnQ0l{End zrq;s?uatP4U+y3EoIJ(j2A&FtA?vRbL^8>Eo3mP?3#DirFG5@CJP@Y>OFaIcgLe6!8XP@#awbDyG z>NK?+BuuSppC&=>Sv&GdVXaa;sZNvqQ-SMaQ?$)XNeL!xo)#yOv@B@LH;bp$9BnLR ztelzsTa(pGJ&er(nvNOu-U92(DO8~8%4$;2x^s+HFDOjv&9OesL_v?BEVVDtTV!x4 zlS?mYxKm-gl&B1;Afj}07Ahu&Gy>aKs+oApokYs;b#YO)g+)F0(pCj=YeidC!q?L> zE3kd|ZS#@xe(($H(yf{>r%F{di4Cr_78G<5WpGB-%8QFaT9s{z+cuqyit<)QmG!Gu z<&@O~YARxTrL1D}JbEt`%7EVqh_m{gaP3%2NE1AqS|QxM4jb&rP||&;3)0;&tC@)#PG? zlm?kzaFMzjSu3*=7tXRGQ`VLaN+uf+ObbT2~&ZBrzU5wg3 z(i=~is_suz3GSLT^n-gfsskp>uToy4f*~b$%LNHbE_NS1Ub=62*#nRH4@qQVM^7@O`iK{-t2$Fq6Ji>nByLDtdsdU-D8L=tSwSv>zp^N`)r5{N zCKf7+jBrE*&Aq@eK_{I62QJbH>hIf+7yo+3AO8);`+sIIp&$dJ3~Cau&~;HrYg3F# zw@)Xd`U~EEBr5tS^~Df`)P3$haBSs@N+ReL#G;>S2w9Yq{6U_OND()qDoQo6NG?ny z-oBeA`-rF(>|cc4#ei5OH0_^B9-AT`BV+y3<+hcKUsqLu)kSO{*GEby zu*J(FYUwybI*<#26^0yf!I8csqT2AP(s3XW5-&J9SS#B}B%0WO6%l%*cv)1bUI4Mo zKB-bGhHMrWw#lIV{wy;pKqIrBtNh$?xRfwkO=3MDKk?30fMxZ5lUw=vH? z(0~UjjE773*@r9eG>7?M2cO+Ao>_A7l#K8ogUOl1w0KrT?L}w%eyn4wte5uNn?l)t>gs=N{L)d+a|&jRcUikPS;Hgsj|OSVtv8-0DOAsbE;v{>1{`p zW5bbJ#Z#FsVqc3LRy~naUcJ=on%Ltri^O(K4jh#aTsFo#9?WIf^`}lN$CCd!weFvA zH3yh7eSUZdQyNqGL_pINK@y^Rfi+}xfB2X}(O|);?Lt$QNwV6dD6v&aSpY;@9~(u% z#znc!pb6{aFi}@hp}Lm^M=Do5DNmm7lh*a6wyuwZS`+3^p}HijQBl=$&RvCyCUyAe zg*Goedw}qIK^YRSj#-v^)pmHUb#gkGl)32u| z5~)!YwhKpDf2=!HhSKSJ;Z+gjKvEjS+#zuBVpLHWb4c*8kV<`vDM-RH4lLAxi7-Ii z?{u>sj`mHCtUoZPy0**qLdA^WP?G&ZP2Q$Xx3+Xg5r>rW+P@4jhKE5CFM%?`)+W)_=ifr`?3B^jN zPt7VOOXCU`F_G~_d^L$;>i&2+P_Zc423AOH_eLlWq(94*RNKQ`Ef+msOpFRI1$wV5 zstd}S5TQ-#Ac=Zv;sf{n!Yk3*$+Jn#xex+&)S! zDt0tQQQgUjD-%KfAjt=fm#ljk~+cdHrhHABUG^S-(77*00Jkti2BJ9S6f>S--jL$9-;m9)|cz z83G(!mh-UD=%t*;h;G(CtRpI;%jL9w^D+j%jB8J0L}Ty|Llv$=KuZ~dFQ*}*vDBlF z%kc@npPmCe+*yae(x zCUFz=80IqOP#y;EEz9uohKl7fpmoFBk>WRNZ%Q@1Tt-eTWuVVZZbNOBGLWlW2D+DJ zKyRelvL8569)^&H_m<$^U%+ z-?#P6kNNrW&Br(Ydh_A_-@o1e@MB4#;w>!Xaom-tN=Z}D$fca}JbwzWv*@@xU0637 ztxb=4|7)wB*6y#}&3Siy$kToOD_Wgb6FWTblQ0RFF!!WF*yrah*lXEEWK*>~KeGHW z+qTL2=W!QxYw5Oquc!K(>{_Fw7Ks#JDO1YA^2lQgp}+G&L_7PT~N$#^7B+4tC!~~)I1+) zIUGvS2w;X{nPx90SBw8CGN7{}Yl42F7jNt@jTT=l8EHo?j2mEBEJ3XxntdR|v2QzLhKarjvw=vt0i`Rp<97 z(sDBwj3VRW@8;hu2NyblBzLLJE8@YW1pCsHRy@Z3Ca-IVK@VqW!KCEHDY~ra`D`tPJ5> zU@EHl#jcMe!_nkgA`wp&1hGCSnanDn)oywpELm0ZPz0lEh!We}jPm$)z{8>SwhmF*PFJqF$jT<8IG?CHRjZsBvOd`#T>TYtEiBKzrc(Qoq69rA7WLe%Abel)>RWLGm zAhS14Yf~uHAYP=&aHE@;+%ZWy#-z8Z?TdJk%51MkT3{}h%nNnyswWWLP4Z}jjHF!o zIeise#cTgm4>4>Z?18@knmL>6+qVj|0n ziM{H{dNcSoz=4T82KPj4w?=uaNh)j_mcXJs#)RDSFhUI*%`9MXg65 zyftD)Ndts5VfxF&F|nkQCo!-~I*L@uLNY`rK0laR{IW`9ZLpw3N~KdzBhhrISx^15 zUYam#RMrtFHIY*#wZB>%h|>-Vg~XE-BsY?R${H?3{8gc%9x9QnR~l|RS`O}>vVpI4 zoXWbJ82ISZJWQ?dB9A&wEh`CCtJ0@RkbTySJX2VzBu}c%Wd2mZdf60ib5qg;qc&HI zl}J*SXv?d`<7yslG-b4$Y5i-H#fv?RwE?P*8TQ^n)|*o(K&LCMi9PGKF>1X;VN`F{ z^=c*px&)=Gy@8%02NyHB@S=u$DjY8+Dnc@dAl*3&852UPfz2ybOWft2M9lDIu~D{; zg+2GCtqkJSDs5#6Z%@l{5k#gX$ZBar+_|V!SG7{~a9HO`*3`!xv2vm|lyH$KN+%MN zrW2Oz9HCGnJ7qV*lHlnS*^-b`iK-+6C6$Tyt~a%6Ev9nUwUtEeS(w_kEF2usE;Hcb z0yq@U!>i$HX*DR|Ldsx^%9S@R z3~5oeCT`PoBC3?vGRmy)wKAtHCs0i}Eve+8x);ifU`)21$`t5vA;puxY(vSr^pHwr zu>lTALiF4eDovqgU#bdkjf~K(8^mpcSjCH_Zp6o!P%eoG>s7hp!XOCG!&^&rGxTv0 z5Uq<8)|@|^s;k^F34%7T+?X;#-3e@X(m}Cal8a$i56pNWFqz2w$%h+dDt^h34OCa$ zpq`TFq-^NN{;EXsy05pYa#2H4gA6Zmp}IS=W@cqvFw2ZgQQLHoGBF`pdQ+v)L$)VY zl2H`OG_}=C)|-*UJd!8X&Zy}lJ@J^S%KnK;!ELh+{lYyP)drKyFH>Hk3PViplq)1O zxzK&-anpU>%QWaJ9<>;5*vLZ#WWg)F^2h!6Z&d zx%RXs)sZ+j$#xFhO7MFYrnZ=*qm2oLG93{Yz#$PNcLPTQ9beNrg9~+n`v2|6)xVzc z>A%7F^v?_`6kuS0F!aDgUZLZ{kd~&XlWv|)MDNrZ-lu{-tx*_<$S+h{T>~@M5unB z4d1DgFY#&L=fhX_)UT>qeL0f&{+iU;UX|ojuP(>rZ3-ID$SmuqhQn9EP)B@mbr^{5o#6O}qB24!_!pO5^^{!}UJ4c1^M;loQz41CSYJOek- z8xwO;zok}z!_q_cHQ1%RK9N*-zPxymx3IR5B;_(}Cvka~43o6E?UBq`gJW~?O{W!O zi9bxOr!O{a0}Poi&)>bL#uVp7Qw*BMLbU02={z?{!GdGkB~582NpBZbSb47$AXL_} zQE1<|P)CxO_)jX(6;&wjrNg1hCHn$hv3+4`%l@g78Pu5A{{ko^v{9w1=GI^@lr*u! z2QQI%)3X~0kC!Ne;?*|x8r;!CIoqj~F@aa6XH%$Ft9e!L2wI^|BIcNhm#Cb{rSrs; zi}da3Ngh&&%CMcp&HA3T6bF>SbUI%0un0zYO@oko2yDC%mCfCT6doE<(X%oINN5{s z!$hbc&UZRl2N63x?fMOK%4<7pH@IsAtCFbNhPSHIdv_RdP$~EQ&CtXoq>>?FVo4Gg zQm@EeA)e`MqS|o4XyuwG3F{+1N=%Z4)WZ#M5SY~~dy+{ahKgOROsyImioIyNO+0Kj zi4c{XAPo)`7$lJm1r=3;B=Ja`MZ`|qte1!|ZH;8nAUTMtas@%th7@YUS$6}ktVtbG z-}HtVAMxd_D63hI_PS; z+X2g%G Date: Wed, 16 Apr 2025 13:49:44 +0200 Subject: [PATCH 31/32] chore: regen protoc js --- .../clients/core/v0/nodejs/core_pbjs.js | 7111 ++ .../clients/drive/v0/nodejs/drive_pbjs.js | 71114 ++++++++++++++++ .../platform/v0/nodejs/platform_pbjs.js | 70606 +++++++++++++++ .../platform/v0/objective-c/Platform.pbobjc.h | 44 + 4 files changed, 148875 insertions(+) diff --git a/packages/dapi-grpc/clients/core/v0/nodejs/core_pbjs.js b/packages/dapi-grpc/clients/core/v0/nodejs/core_pbjs.js index 9e69e8f9579..20266d4be7c 100644 --- a/packages/dapi-grpc/clients/core/v0/nodejs/core_pbjs.js +++ b/packages/dapi-grpc/clients/core/v0/nodejs/core_pbjs.js @@ -9,4 +9,7115 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut // Exported root namespace var $root = $protobuf.roots.core_root || ($protobuf.roots.core_root = {}); +$root.org = (function() { + + /** + * Namespace org. + * @exports org + * @namespace + */ + var org = {}; + + org.dash = (function() { + + /** + * Namespace dash. + * @memberof org + * @namespace + */ + var dash = {}; + + dash.platform = (function() { + + /** + * Namespace platform. + * @memberof org.dash + * @namespace + */ + var platform = {}; + + platform.dapi = (function() { + + /** + * Namespace dapi. + * @memberof org.dash.platform + * @namespace + */ + var dapi = {}; + + dapi.v0 = (function() { + + /** + * Namespace v0. + * @memberof org.dash.platform.dapi + * @namespace + */ + var v0 = {}; + + v0.Core = (function() { + + /** + * Constructs a new Core service. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a Core + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Core(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Core.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Core; + + /** + * Creates new Core service using the specified rpc implementation. + * @function create + * @memberof org.dash.platform.dapi.v0.Core + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Core} RPC service. Useful where requests and/or responses are streamed. + */ + Core.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#getBlockchainStatus}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef getBlockchainStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} [response] GetBlockchainStatusResponse + */ + + /** + * Calls getBlockchainStatus. + * @function getBlockchainStatus + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest} request GetBlockchainStatusRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.getBlockchainStatusCallback} callback Node-style callback called with the error, if any, and GetBlockchainStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.getBlockchainStatus = function getBlockchainStatus(request, callback) { + return this.rpcCall(getBlockchainStatus, $root.org.dash.platform.dapi.v0.GetBlockchainStatusRequest, $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse, request, callback); + }, "name", { value: "getBlockchainStatus" }); + + /** + * Calls getBlockchainStatus. + * @function getBlockchainStatus + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest} request GetBlockchainStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#getMasternodeStatus}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef getMasternodeStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} [response] GetMasternodeStatusResponse + */ + + /** + * Calls getMasternodeStatus. + * @function getMasternodeStatus + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest} request GetMasternodeStatusRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.getMasternodeStatusCallback} callback Node-style callback called with the error, if any, and GetMasternodeStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.getMasternodeStatus = function getMasternodeStatus(request, callback) { + return this.rpcCall(getMasternodeStatus, $root.org.dash.platform.dapi.v0.GetMasternodeStatusRequest, $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse, request, callback); + }, "name", { value: "getMasternodeStatus" }); + + /** + * Calls getMasternodeStatus. + * @function getMasternodeStatus + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest} request GetMasternodeStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#getBlock}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef getBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetBlockResponse} [response] GetBlockResponse + */ + + /** + * Calls getBlock. + * @function getBlock + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetBlockRequest} request GetBlockRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.getBlockCallback} callback Node-style callback called with the error, if any, and GetBlockResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.getBlock = function getBlock(request, callback) { + return this.rpcCall(getBlock, $root.org.dash.platform.dapi.v0.GetBlockRequest, $root.org.dash.platform.dapi.v0.GetBlockResponse, request, callback); + }, "name", { value: "getBlock" }); + + /** + * Calls getBlock. + * @function getBlock + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetBlockRequest} request GetBlockRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#getBestBlockHeight}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef getBestBlockHeightCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} [response] GetBestBlockHeightResponse + */ + + /** + * Calls getBestBlockHeight. + * @function getBestBlockHeight + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest} request GetBestBlockHeightRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.getBestBlockHeightCallback} callback Node-style callback called with the error, if any, and GetBestBlockHeightResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.getBestBlockHeight = function getBestBlockHeight(request, callback) { + return this.rpcCall(getBestBlockHeight, $root.org.dash.platform.dapi.v0.GetBestBlockHeightRequest, $root.org.dash.platform.dapi.v0.GetBestBlockHeightResponse, request, callback); + }, "name", { value: "getBestBlockHeight" }); + + /** + * Calls getBestBlockHeight. + * @function getBestBlockHeight + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest} request GetBestBlockHeightRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#broadcastTransaction}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef broadcastTransactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.BroadcastTransactionResponse} [response] BroadcastTransactionResponse + */ + + /** + * Calls broadcastTransaction. + * @function broadcastTransaction + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest} request BroadcastTransactionRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.broadcastTransactionCallback} callback Node-style callback called with the error, if any, and BroadcastTransactionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.broadcastTransaction = function broadcastTransaction(request, callback) { + return this.rpcCall(broadcastTransaction, $root.org.dash.platform.dapi.v0.BroadcastTransactionRequest, $root.org.dash.platform.dapi.v0.BroadcastTransactionResponse, request, callback); + }, "name", { value: "broadcastTransaction" }); + + /** + * Calls broadcastTransaction. + * @function broadcastTransaction + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest} request BroadcastTransactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#getTransaction}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef getTransactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTransactionResponse} [response] GetTransactionResponse + */ + + /** + * Calls getTransaction. + * @function getTransaction + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetTransactionRequest} request GetTransactionRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.getTransactionCallback} callback Node-style callback called with the error, if any, and GetTransactionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.getTransaction = function getTransaction(request, callback) { + return this.rpcCall(getTransaction, $root.org.dash.platform.dapi.v0.GetTransactionRequest, $root.org.dash.platform.dapi.v0.GetTransactionResponse, request, callback); + }, "name", { value: "getTransaction" }); + + /** + * Calls getTransaction. + * @function getTransaction + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetTransactionRequest} request GetTransactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#getEstimatedTransactionFee}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef getEstimatedTransactionFeeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} [response] GetEstimatedTransactionFeeResponse + */ + + /** + * Calls getEstimatedTransactionFee. + * @function getEstimatedTransactionFee + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest} request GetEstimatedTransactionFeeRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.getEstimatedTransactionFeeCallback} callback Node-style callback called with the error, if any, and GetEstimatedTransactionFeeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.getEstimatedTransactionFee = function getEstimatedTransactionFee(request, callback) { + return this.rpcCall(getEstimatedTransactionFee, $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest, $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse, request, callback); + }, "name", { value: "getEstimatedTransactionFee" }); + + /** + * Calls getEstimatedTransactionFee. + * @function getEstimatedTransactionFee + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest} request GetEstimatedTransactionFeeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#subscribeToBlockHeadersWithChainLocks}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef subscribeToBlockHeadersWithChainLocksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} [response] BlockHeadersWithChainLocksResponse + */ + + /** + * Calls subscribeToBlockHeadersWithChainLocks. + * @function subscribeToBlockHeadersWithChainLocks + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest} request BlockHeadersWithChainLocksRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.subscribeToBlockHeadersWithChainLocksCallback} callback Node-style callback called with the error, if any, and BlockHeadersWithChainLocksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.subscribeToBlockHeadersWithChainLocks = function subscribeToBlockHeadersWithChainLocks(request, callback) { + return this.rpcCall(subscribeToBlockHeadersWithChainLocks, $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest, $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse, request, callback); + }, "name", { value: "subscribeToBlockHeadersWithChainLocks" }); + + /** + * Calls subscribeToBlockHeadersWithChainLocks. + * @function subscribeToBlockHeadersWithChainLocks + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest} request BlockHeadersWithChainLocksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#subscribeToTransactionsWithProofs}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef subscribeToTransactionsWithProofsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} [response] TransactionsWithProofsResponse + */ + + /** + * Calls subscribeToTransactionsWithProofs. + * @function subscribeToTransactionsWithProofs + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest} request TransactionsWithProofsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.subscribeToTransactionsWithProofsCallback} callback Node-style callback called with the error, if any, and TransactionsWithProofsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.subscribeToTransactionsWithProofs = function subscribeToTransactionsWithProofs(request, callback) { + return this.rpcCall(subscribeToTransactionsWithProofs, $root.org.dash.platform.dapi.v0.TransactionsWithProofsRequest, $root.org.dash.platform.dapi.v0.TransactionsWithProofsResponse, request, callback); + }, "name", { value: "subscribeToTransactionsWithProofs" }); + + /** + * Calls subscribeToTransactionsWithProofs. + * @function subscribeToTransactionsWithProofs + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest} request TransactionsWithProofsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Core#subscribeToMasternodeList}. + * @memberof org.dash.platform.dapi.v0.Core + * @typedef subscribeToMasternodeListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.MasternodeListResponse} [response] MasternodeListResponse + */ + + /** + * Calls subscribeToMasternodeList. + * @function subscribeToMasternodeList + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IMasternodeListRequest} request MasternodeListRequest message or plain object + * @param {org.dash.platform.dapi.v0.Core.subscribeToMasternodeListCallback} callback Node-style callback called with the error, if any, and MasternodeListResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Core.prototype.subscribeToMasternodeList = function subscribeToMasternodeList(request, callback) { + return this.rpcCall(subscribeToMasternodeList, $root.org.dash.platform.dapi.v0.MasternodeListRequest, $root.org.dash.platform.dapi.v0.MasternodeListResponse, request, callback); + }, "name", { value: "subscribeToMasternodeList" }); + + /** + * Calls subscribeToMasternodeList. + * @function subscribeToMasternodeList + * @memberof org.dash.platform.dapi.v0.Core + * @instance + * @param {org.dash.platform.dapi.v0.IMasternodeListRequest} request MasternodeListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Core; + })(); + + v0.GetBlockchainStatusRequest = (function() { + + /** + * Properties of a GetBlockchainStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetBlockchainStatusRequest + */ + + /** + * Constructs a new GetBlockchainStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetBlockchainStatusRequest. + * @implements IGetBlockchainStatusRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest=} [properties] Properties to set + */ + function GetBlockchainStatusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetBlockchainStatusRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} GetBlockchainStatusRequest instance + */ + GetBlockchainStatusRequest.create = function create(properties) { + return new GetBlockchainStatusRequest(properties); + }; + + /** + * Encodes the specified GetBlockchainStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest} message GetBlockchainStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockchainStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetBlockchainStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusRequest} message GetBlockchainStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockchainStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBlockchainStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} GetBlockchainStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockchainStatusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBlockchainStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} GetBlockchainStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockchainStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBlockchainStatusRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBlockchainStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetBlockchainStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} GetBlockchainStatusRequest + */ + GetBlockchainStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusRequest) + return object; + return new $root.org.dash.platform.dapi.v0.GetBlockchainStatusRequest(); + }; + + /** + * Creates a plain object from a GetBlockchainStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusRequest} message GetBlockchainStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBlockchainStatusRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetBlockchainStatusRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusRequest + * @instance + * @returns {Object.} JSON object + */ + GetBlockchainStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBlockchainStatusRequest; + })(); + + v0.GetBlockchainStatusResponse = (function() { + + /** + * Properties of a GetBlockchainStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetBlockchainStatusResponse + * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion|null} [version] GetBlockchainStatusResponse version + * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime|null} [time] GetBlockchainStatusResponse time + * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Status|null} [status] GetBlockchainStatusResponse status + * @property {number|null} [syncProgress] GetBlockchainStatusResponse syncProgress + * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain|null} [chain] GetBlockchainStatusResponse chain + * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork|null} [network] GetBlockchainStatusResponse network + */ + + /** + * Constructs a new GetBlockchainStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetBlockchainStatusResponse. + * @implements IGetBlockchainStatusResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusResponse=} [properties] Properties to set + */ + function GetBlockchainStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBlockchainStatusResponse version. + * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion|null|undefined} version + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @instance + */ + GetBlockchainStatusResponse.prototype.version = null; + + /** + * GetBlockchainStatusResponse time. + * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime|null|undefined} time + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @instance + */ + GetBlockchainStatusResponse.prototype.time = null; + + /** + * GetBlockchainStatusResponse status. + * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Status} status + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @instance + */ + GetBlockchainStatusResponse.prototype.status = 0; + + /** + * GetBlockchainStatusResponse syncProgress. + * @member {number} syncProgress + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @instance + */ + GetBlockchainStatusResponse.prototype.syncProgress = 0; + + /** + * GetBlockchainStatusResponse chain. + * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain|null|undefined} chain + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @instance + */ + GetBlockchainStatusResponse.prototype.chain = null; + + /** + * GetBlockchainStatusResponse network. + * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork|null|undefined} network + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @instance + */ + GetBlockchainStatusResponse.prototype.network = null; + + /** + * Creates a new GetBlockchainStatusResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} GetBlockchainStatusResponse instance + */ + GetBlockchainStatusResponse.create = function create(properties) { + return new GetBlockchainStatusResponse(properties); + }; + + /** + * Encodes the specified GetBlockchainStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusResponse} message GetBlockchainStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockchainStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.syncProgress != null && Object.hasOwnProperty.call(message, "syncProgress")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.syncProgress); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.encode(message.chain, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetBlockchainStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockchainStatusResponse} message GetBlockchainStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockchainStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBlockchainStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} GetBlockchainStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockchainStatusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.decode(reader, reader.uint32()); + break; + case 2: + message.time = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.decode(reader, reader.uint32()); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.syncProgress = reader.double(); + break; + case 5: + message.chain = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.decode(reader, reader.uint32()); + break; + case 7: + message.network = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBlockchainStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} GetBlockchainStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockchainStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBlockchainStatusResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBlockchainStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.verify(message.version); + if (error) + return "version." + error; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.verify(message.time); + if (error) + return "time." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) + if (typeof message.syncProgress !== "number") + return "syncProgress: number expected"; + if (message.chain != null && message.hasOwnProperty("chain")) { + var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.verify(message.chain); + if (error) + return "chain." + error; + } + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.verify(message.network); + if (error) + return "network." + error; + } + return null; + }; + + /** + * Creates a GetBlockchainStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} GetBlockchainStatusResponse + */ + GetBlockchainStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.version: object expected"); + message.version = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.fromObject(object.version); + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.time: object expected"); + message.time = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.fromObject(object.time); + } + switch (object.status) { + case "NOT_STARTED": + case 0: + message.status = 0; + break; + case "SYNCING": + case 1: + message.status = 1; + break; + case "READY": + case 2: + message.status = 2; + break; + case "ERROR": + case 3: + message.status = 3; + break; + } + if (object.syncProgress != null) + message.syncProgress = Number(object.syncProgress); + if (object.chain != null) { + if (typeof object.chain !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.chain: object expected"); + message.chain = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.fromObject(object.chain); + } + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.network: object expected"); + message.network = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.fromObject(object.network); + } + return message; + }; + + /** + * Creates a plain object from a GetBlockchainStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse} message GetBlockchainStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBlockchainStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.time = null; + object.status = options.enums === String ? "NOT_STARTED" : 0; + object.syncProgress = 0; + object.chain = null; + object.network = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.toObject(message.version, options); + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.toObject(message.time, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Status[message.status] : message.status; + if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) + object.syncProgress = options.json && !isFinite(message.syncProgress) ? String(message.syncProgress) : message.syncProgress; + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.toObject(message.chain, options); + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.toObject(message.network, options); + return object; + }; + + /** + * Converts this GetBlockchainStatusResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @instance + * @returns {Object.} JSON object + */ + GetBlockchainStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetBlockchainStatusResponse.Version = (function() { + + /** + * Properties of a Version. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @interface IVersion + * @property {number|null} [protocol] Version protocol + * @property {number|null} [software] Version software + * @property {string|null} [agent] Version agent + */ + + /** + * Constructs a new Version. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion=} [properties] Properties to set + */ + function Version(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version protocol. + * @member {number} protocol + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @instance + */ + Version.prototype.protocol = 0; + + /** + * Version software. + * @member {number} software + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @instance + */ + Version.prototype.software = 0; + + /** + * Version agent. + * @member {string} agent + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @instance + */ + Version.prototype.agent = ""; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.protocol); + if (message.software != null && Object.hasOwnProperty.call(message, "software")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.software); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agent); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint32(); + break; + case 2: + message.software = reader.uint32(); + break; + case 3: + message.agent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protocol != null && message.hasOwnProperty("protocol")) + if (!$util.isInteger(message.protocol)) + return "protocol: integer expected"; + if (message.software != null && message.hasOwnProperty("software")) + if (!$util.isInteger(message.software)) + return "software: integer expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version(); + if (object.protocol != null) + message.protocol = object.protocol >>> 0; + if (object.software != null) + message.software = object.software >>> 0; + if (object.agent != null) + message.agent = String(object.agent); + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.protocol = 0; + object.software = 0; + object.agent = ""; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = message.protocol; + if (message.software != null && message.hasOwnProperty("software")) + object.software = message.software; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Version; + })(); + + GetBlockchainStatusResponse.Time = (function() { + + /** + * Properties of a Time. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @interface ITime + * @property {number|null} [now] Time now + * @property {number|null} [offset] Time offset + * @property {number|null} [median] Time median + */ + + /** + * Constructs a new Time. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @classdesc Represents a Time. + * @implements ITime + * @constructor + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime=} [properties] Properties to set + */ + function Time(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Time now. + * @member {number} now + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @instance + */ + Time.prototype.now = 0; + + /** + * Time offset. + * @member {number} offset + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @instance + */ + Time.prototype.offset = 0; + + /** + * Time median. + * @member {number} median + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @instance + */ + Time.prototype.median = 0; + + /** + * Creates a new Time instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} Time instance + */ + Time.create = function create(properties) { + return new Time(properties); + }; + + /** + * Encodes the specified Time message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime} message Time message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Time.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.now != null && Object.hasOwnProperty.call(message, "now")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.now); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.offset); + if (message.median != null && Object.hasOwnProperty.call(message, "median")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.median); + return writer; + }; + + /** + * Encodes the specified Time message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.ITime} message Time message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Time.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Time message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} Time + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Time.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.now = reader.uint32(); + break; + case 2: + message.offset = reader.int32(); + break; + case 3: + message.median = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Time message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} Time + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Time.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Time message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Time.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.now != null && message.hasOwnProperty("now")) + if (!$util.isInteger(message.now)) + return "now: integer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.median != null && message.hasOwnProperty("median")) + if (!$util.isInteger(message.median)) + return "median: integer expected"; + return null; + }; + + /** + * Creates a Time message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} Time + */ + Time.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time(); + if (object.now != null) + message.now = object.now >>> 0; + if (object.offset != null) + message.offset = object.offset | 0; + if (object.median != null) + message.median = object.median >>> 0; + return message; + }; + + /** + * Creates a plain object from a Time message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time} message Time + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Time.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.now = 0; + object.offset = 0; + object.median = 0; + } + if (message.now != null && message.hasOwnProperty("now")) + object.now = message.now; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.median != null && message.hasOwnProperty("median")) + object.median = message.median; + return object; + }; + + /** + * Converts this Time to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Time + * @instance + * @returns {Object.} JSON object + */ + Time.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Time; + })(); + + /** + * Status enum. + * @name org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Status + * @enum {number} + * @property {number} NOT_STARTED=0 NOT_STARTED value + * @property {number} SYNCING=1 SYNCING value + * @property {number} READY=2 READY value + * @property {number} ERROR=3 ERROR value + */ + GetBlockchainStatusResponse.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NOT_STARTED"] = 0; + values[valuesById[1] = "SYNCING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + GetBlockchainStatusResponse.Chain = (function() { + + /** + * Properties of a Chain. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @interface IChain + * @property {string|null} [name] Chain name + * @property {number|null} [headersCount] Chain headersCount + * @property {number|null} [blocksCount] Chain blocksCount + * @property {Uint8Array|null} [bestBlockHash] Chain bestBlockHash + * @property {number|null} [difficulty] Chain difficulty + * @property {Uint8Array|null} [chainWork] Chain chainWork + * @property {boolean|null} [isSynced] Chain isSynced + * @property {number|null} [syncProgress] Chain syncProgress + */ + + /** + * Constructs a new Chain. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @classdesc Represents a Chain. + * @implements IChain + * @constructor + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain=} [properties] Properties to set + */ + function Chain(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chain name. + * @member {string} name + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + */ + Chain.prototype.name = ""; + + /** + * Chain headersCount. + * @member {number} headersCount + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + */ + Chain.prototype.headersCount = 0; + + /** + * Chain blocksCount. + * @member {number} blocksCount + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + */ + Chain.prototype.blocksCount = 0; + + /** + * Chain bestBlockHash. + * @member {Uint8Array} bestBlockHash + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + */ + Chain.prototype.bestBlockHash = $util.newBuffer([]); + + /** + * Chain difficulty. + * @member {number} difficulty + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + */ + Chain.prototype.difficulty = 0; + + /** + * Chain chainWork. + * @member {Uint8Array} chainWork + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + */ + Chain.prototype.chainWork = $util.newBuffer([]); + + /** + * Chain isSynced. + * @member {boolean} isSynced + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + */ + Chain.prototype.isSynced = false; + + /** + * Chain syncProgress. + * @member {number} syncProgress + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + */ + Chain.prototype.syncProgress = 0; + + /** + * Creates a new Chain instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} Chain instance + */ + Chain.create = function create(properties) { + return new Chain(properties); + }; + + /** + * Encodes the specified Chain message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.headersCount != null && Object.hasOwnProperty.call(message, "headersCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.headersCount); + if (message.blocksCount != null && Object.hasOwnProperty.call(message, "blocksCount")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.blocksCount); + if (message.bestBlockHash != null && Object.hasOwnProperty.call(message, "bestBlockHash")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.bestBlockHash); + if (message.difficulty != null && Object.hasOwnProperty.call(message, "difficulty")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.difficulty); + if (message.chainWork != null && Object.hasOwnProperty.call(message, "chainWork")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.chainWork); + if (message.isSynced != null && Object.hasOwnProperty.call(message, "isSynced")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isSynced); + if (message.syncProgress != null && Object.hasOwnProperty.call(message, "syncProgress")) + writer.uint32(/* id 8, wireType 1 =*/65).double(message.syncProgress); + return writer; + }; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.headersCount = reader.uint32(); + break; + case 3: + message.blocksCount = reader.uint32(); + break; + case 4: + message.bestBlockHash = reader.bytes(); + break; + case 5: + message.difficulty = reader.double(); + break; + case 6: + message.chainWork = reader.bytes(); + break; + case 7: + message.isSynced = reader.bool(); + break; + case 8: + message.syncProgress = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chain message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.headersCount != null && message.hasOwnProperty("headersCount")) + if (!$util.isInteger(message.headersCount)) + return "headersCount: integer expected"; + if (message.blocksCount != null && message.hasOwnProperty("blocksCount")) + if (!$util.isInteger(message.blocksCount)) + return "blocksCount: integer expected"; + if (message.bestBlockHash != null && message.hasOwnProperty("bestBlockHash")) + if (!(message.bestBlockHash && typeof message.bestBlockHash.length === "number" || $util.isString(message.bestBlockHash))) + return "bestBlockHash: buffer expected"; + if (message.difficulty != null && message.hasOwnProperty("difficulty")) + if (typeof message.difficulty !== "number") + return "difficulty: number expected"; + if (message.chainWork != null && message.hasOwnProperty("chainWork")) + if (!(message.chainWork && typeof message.chainWork.length === "number" || $util.isString(message.chainWork))) + return "chainWork: buffer expected"; + if (message.isSynced != null && message.hasOwnProperty("isSynced")) + if (typeof message.isSynced !== "boolean") + return "isSynced: boolean expected"; + if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) + if (typeof message.syncProgress !== "number") + return "syncProgress: number expected"; + return null; + }; + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} Chain + */ + Chain.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain(); + if (object.name != null) + message.name = String(object.name); + if (object.headersCount != null) + message.headersCount = object.headersCount >>> 0; + if (object.blocksCount != null) + message.blocksCount = object.blocksCount >>> 0; + if (object.bestBlockHash != null) + if (typeof object.bestBlockHash === "string") + $util.base64.decode(object.bestBlockHash, message.bestBlockHash = $util.newBuffer($util.base64.length(object.bestBlockHash)), 0); + else if (object.bestBlockHash.length >= 0) + message.bestBlockHash = object.bestBlockHash; + if (object.difficulty != null) + message.difficulty = Number(object.difficulty); + if (object.chainWork != null) + if (typeof object.chainWork === "string") + $util.base64.decode(object.chainWork, message.chainWork = $util.newBuffer($util.base64.length(object.chainWork)), 0); + else if (object.chainWork.length >= 0) + message.chainWork = object.chainWork; + if (object.isSynced != null) + message.isSynced = Boolean(object.isSynced); + if (object.syncProgress != null) + message.syncProgress = Number(object.syncProgress); + return message; + }; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain} message Chain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.headersCount = 0; + object.blocksCount = 0; + if (options.bytes === String) + object.bestBlockHash = ""; + else { + object.bestBlockHash = []; + if (options.bytes !== Array) + object.bestBlockHash = $util.newBuffer(object.bestBlockHash); + } + object.difficulty = 0; + if (options.bytes === String) + object.chainWork = ""; + else { + object.chainWork = []; + if (options.bytes !== Array) + object.chainWork = $util.newBuffer(object.chainWork); + } + object.isSynced = false; + object.syncProgress = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.headersCount != null && message.hasOwnProperty("headersCount")) + object.headersCount = message.headersCount; + if (message.blocksCount != null && message.hasOwnProperty("blocksCount")) + object.blocksCount = message.blocksCount; + if (message.bestBlockHash != null && message.hasOwnProperty("bestBlockHash")) + object.bestBlockHash = options.bytes === String ? $util.base64.encode(message.bestBlockHash, 0, message.bestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.bestBlockHash) : message.bestBlockHash; + if (message.difficulty != null && message.hasOwnProperty("difficulty")) + object.difficulty = options.json && !isFinite(message.difficulty) ? String(message.difficulty) : message.difficulty; + if (message.chainWork != null && message.hasOwnProperty("chainWork")) + object.chainWork = options.bytes === String ? $util.base64.encode(message.chainWork, 0, message.chainWork.length) : options.bytes === Array ? Array.prototype.slice.call(message.chainWork) : message.chainWork; + if (message.isSynced != null && message.hasOwnProperty("isSynced")) + object.isSynced = message.isSynced; + if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) + object.syncProgress = options.json && !isFinite(message.syncProgress) ? String(message.syncProgress) : message.syncProgress; + return object; + }; + + /** + * Converts this Chain to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Chain + * @instance + * @returns {Object.} JSON object + */ + Chain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Chain; + })(); + + GetBlockchainStatusResponse.NetworkFee = (function() { + + /** + * Properties of a NetworkFee. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @interface INetworkFee + * @property {number|null} [relay] NetworkFee relay + * @property {number|null} [incremental] NetworkFee incremental + */ + + /** + * Constructs a new NetworkFee. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @classdesc Represents a NetworkFee. + * @implements INetworkFee + * @constructor + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee=} [properties] Properties to set + */ + function NetworkFee(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkFee relay. + * @member {number} relay + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @instance + */ + NetworkFee.prototype.relay = 0; + + /** + * NetworkFee incremental. + * @member {number} incremental + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @instance + */ + NetworkFee.prototype.incremental = 0; + + /** + * Creates a new NetworkFee instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} NetworkFee instance + */ + NetworkFee.create = function create(properties) { + return new NetworkFee(properties); + }; + + /** + * Encodes the specified NetworkFee message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee} message NetworkFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkFee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relay != null && Object.hasOwnProperty.call(message, "relay")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.relay); + if (message.incremental != null && Object.hasOwnProperty.call(message, "incremental")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.incremental); + return writer; + }; + + /** + * Encodes the specified NetworkFee message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee} message NetworkFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkFee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkFee message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} NetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkFee.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relay = reader.double(); + break; + case 2: + message.incremental = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkFee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} NetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkFee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkFee message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkFee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relay != null && message.hasOwnProperty("relay")) + if (typeof message.relay !== "number") + return "relay: number expected"; + if (message.incremental != null && message.hasOwnProperty("incremental")) + if (typeof message.incremental !== "number") + return "incremental: number expected"; + return null; + }; + + /** + * Creates a NetworkFee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} NetworkFee + */ + NetworkFee.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee(); + if (object.relay != null) + message.relay = Number(object.relay); + if (object.incremental != null) + message.incremental = Number(object.incremental); + return message; + }; + + /** + * Creates a plain object from a NetworkFee message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee} message NetworkFee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkFee.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.relay = 0; + object.incremental = 0; + } + if (message.relay != null && message.hasOwnProperty("relay")) + object.relay = options.json && !isFinite(message.relay) ? String(message.relay) : message.relay; + if (message.incremental != null && message.hasOwnProperty("incremental")) + object.incremental = options.json && !isFinite(message.incremental) ? String(message.incremental) : message.incremental; + return object; + }; + + /** + * Converts this NetworkFee to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee + * @instance + * @returns {Object.} JSON object + */ + NetworkFee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkFee; + })(); + + GetBlockchainStatusResponse.Network = (function() { + + /** + * Properties of a Network. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @interface INetwork + * @property {number|null} [peersCount] Network peersCount + * @property {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee|null} [fee] Network fee + */ + + /** + * Constructs a new Network. + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse + * @classdesc Represents a Network. + * @implements INetwork + * @constructor + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork=} [properties] Properties to set + */ + function Network(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Network peersCount. + * @member {number} peersCount + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @instance + */ + Network.prototype.peersCount = 0; + + /** + * Network fee. + * @member {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetworkFee|null|undefined} fee + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @instance + */ + Network.prototype.fee = null; + + /** + * Creates a new Network instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} Network instance + */ + Network.create = function create(properties) { + return new Network(properties); + }; + + /** + * Encodes the specified Network message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.peersCount != null && Object.hasOwnProperty.call(message, "peersCount")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.peersCount); + if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) + $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.encode(message.fee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Network message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.peersCount = reader.uint32(); + break; + case 2: + message.fee = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Network message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Network.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.peersCount != null && message.hasOwnProperty("peersCount")) + if (!$util.isInteger(message.peersCount)) + return "peersCount: integer expected"; + if (message.fee != null && message.hasOwnProperty("fee")) { + var error = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.verify(message.fee); + if (error) + return "fee." + error; + } + return null; + }; + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} Network + */ + Network.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network(); + if (object.peersCount != null) + message.peersCount = object.peersCount >>> 0; + if (object.fee != null) { + if (typeof object.fee !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network.fee: object expected"); + message.fee = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.fromObject(object.fee); + } + return message; + }; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @static + * @param {org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network} message Network + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Network.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.peersCount = 0; + object.fee = null; + } + if (message.peersCount != null && message.hasOwnProperty("peersCount")) + object.peersCount = message.peersCount; + if (message.fee != null && message.hasOwnProperty("fee")) + object.fee = $root.org.dash.platform.dapi.v0.GetBlockchainStatusResponse.NetworkFee.toObject(message.fee, options); + return object; + }; + + /** + * Converts this Network to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockchainStatusResponse.Network + * @instance + * @returns {Object.} JSON object + */ + Network.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Network; + })(); + + return GetBlockchainStatusResponse; + })(); + + v0.GetMasternodeStatusRequest = (function() { + + /** + * Properties of a GetMasternodeStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetMasternodeStatusRequest + */ + + /** + * Constructs a new GetMasternodeStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetMasternodeStatusRequest. + * @implements IGetMasternodeStatusRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest=} [properties] Properties to set + */ + function GetMasternodeStatusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetMasternodeStatusRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} GetMasternodeStatusRequest instance + */ + GetMasternodeStatusRequest.create = function create(properties) { + return new GetMasternodeStatusRequest(properties); + }; + + /** + * Encodes the specified GetMasternodeStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetMasternodeStatusRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest} message GetMasternodeStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMasternodeStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetMasternodeStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetMasternodeStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusRequest} message GetMasternodeStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMasternodeStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMasternodeStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} GetMasternodeStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMasternodeStatusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetMasternodeStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMasternodeStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} GetMasternodeStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMasternodeStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMasternodeStatusRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMasternodeStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetMasternodeStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} GetMasternodeStatusRequest + */ + GetMasternodeStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetMasternodeStatusRequest) + return object; + return new $root.org.dash.platform.dapi.v0.GetMasternodeStatusRequest(); + }; + + /** + * Creates a plain object from a GetMasternodeStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.GetMasternodeStatusRequest} message GetMasternodeStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMasternodeStatusRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetMasternodeStatusRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusRequest + * @instance + * @returns {Object.} JSON object + */ + GetMasternodeStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetMasternodeStatusRequest; + })(); + + v0.GetMasternodeStatusResponse = (function() { + + /** + * Properties of a GetMasternodeStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetMasternodeStatusResponse + * @property {org.dash.platform.dapi.v0.GetMasternodeStatusResponse.Status|null} [status] GetMasternodeStatusResponse status + * @property {Uint8Array|null} [proTxHash] GetMasternodeStatusResponse proTxHash + * @property {number|null} [posePenalty] GetMasternodeStatusResponse posePenalty + * @property {boolean|null} [isSynced] GetMasternodeStatusResponse isSynced + * @property {number|null} [syncProgress] GetMasternodeStatusResponse syncProgress + */ + + /** + * Constructs a new GetMasternodeStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetMasternodeStatusResponse. + * @implements IGetMasternodeStatusResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusResponse=} [properties] Properties to set + */ + function GetMasternodeStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMasternodeStatusResponse status. + * @member {org.dash.platform.dapi.v0.GetMasternodeStatusResponse.Status} status + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @instance + */ + GetMasternodeStatusResponse.prototype.status = 0; + + /** + * GetMasternodeStatusResponse proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @instance + */ + GetMasternodeStatusResponse.prototype.proTxHash = $util.newBuffer([]); + + /** + * GetMasternodeStatusResponse posePenalty. + * @member {number} posePenalty + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @instance + */ + GetMasternodeStatusResponse.prototype.posePenalty = 0; + + /** + * GetMasternodeStatusResponse isSynced. + * @member {boolean} isSynced + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @instance + */ + GetMasternodeStatusResponse.prototype.isSynced = false; + + /** + * GetMasternodeStatusResponse syncProgress. + * @member {number} syncProgress + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @instance + */ + GetMasternodeStatusResponse.prototype.syncProgress = 0; + + /** + * Creates a new GetMasternodeStatusResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} GetMasternodeStatusResponse instance + */ + GetMasternodeStatusResponse.create = function create(properties) { + return new GetMasternodeStatusResponse(properties); + }; + + /** + * Encodes the specified GetMasternodeStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetMasternodeStatusResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusResponse} message GetMasternodeStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMasternodeStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proTxHash); + if (message.posePenalty != null && Object.hasOwnProperty.call(message, "posePenalty")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.posePenalty); + if (message.isSynced != null && Object.hasOwnProperty.call(message, "isSynced")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isSynced); + if (message.syncProgress != null && Object.hasOwnProperty.call(message, "syncProgress")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.syncProgress); + return writer; + }; + + /** + * Encodes the specified GetMasternodeStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetMasternodeStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetMasternodeStatusResponse} message GetMasternodeStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMasternodeStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMasternodeStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} GetMasternodeStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMasternodeStatusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.int32(); + break; + case 2: + message.proTxHash = reader.bytes(); + break; + case 3: + message.posePenalty = reader.uint32(); + break; + case 4: + message.isSynced = reader.bool(); + break; + case 5: + message.syncProgress = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMasternodeStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} GetMasternodeStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMasternodeStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMasternodeStatusResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMasternodeStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.posePenalty != null && message.hasOwnProperty("posePenalty")) + if (!$util.isInteger(message.posePenalty)) + return "posePenalty: integer expected"; + if (message.isSynced != null && message.hasOwnProperty("isSynced")) + if (typeof message.isSynced !== "boolean") + return "isSynced: boolean expected"; + if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) + if (typeof message.syncProgress !== "number") + return "syncProgress: number expected"; + return null; + }; + + /** + * Creates a GetMasternodeStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} GetMasternodeStatusResponse + */ + GetMasternodeStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse(); + switch (object.status) { + case "UNKNOWN": + case 0: + message.status = 0; + break; + case "WAITING_FOR_PROTX": + case 1: + message.status = 1; + break; + case "POSE_BANNED": + case 2: + message.status = 2; + break; + case "REMOVED": + case 3: + message.status = 3; + break; + case "OPERATOR_KEY_CHANGED": + case 4: + message.status = 4; + break; + case "PROTX_IP_CHANGED": + case 5: + message.status = 5; + break; + case "READY": + case 6: + message.status = 6; + break; + case "ERROR": + case 7: + message.status = 7; + break; + } + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.posePenalty != null) + message.posePenalty = object.posePenalty >>> 0; + if (object.isSynced != null) + message.isSynced = Boolean(object.isSynced); + if (object.syncProgress != null) + message.syncProgress = Number(object.syncProgress); + return message; + }; + + /** + * Creates a plain object from a GetMasternodeStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.GetMasternodeStatusResponse} message GetMasternodeStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMasternodeStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = options.enums === String ? "UNKNOWN" : 0; + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + object.posePenalty = 0; + object.isSynced = false; + object.syncProgress = 0; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetMasternodeStatusResponse.Status[message.status] : message.status; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.posePenalty != null && message.hasOwnProperty("posePenalty")) + object.posePenalty = message.posePenalty; + if (message.isSynced != null && message.hasOwnProperty("isSynced")) + object.isSynced = message.isSynced; + if (message.syncProgress != null && message.hasOwnProperty("syncProgress")) + object.syncProgress = options.json && !isFinite(message.syncProgress) ? String(message.syncProgress) : message.syncProgress; + return object; + }; + + /** + * Converts this GetMasternodeStatusResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetMasternodeStatusResponse + * @instance + * @returns {Object.} JSON object + */ + GetMasternodeStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name org.dash.platform.dapi.v0.GetMasternodeStatusResponse.Status + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} WAITING_FOR_PROTX=1 WAITING_FOR_PROTX value + * @property {number} POSE_BANNED=2 POSE_BANNED value + * @property {number} REMOVED=3 REMOVED value + * @property {number} OPERATOR_KEY_CHANGED=4 OPERATOR_KEY_CHANGED value + * @property {number} PROTX_IP_CHANGED=5 PROTX_IP_CHANGED value + * @property {number} READY=6 READY value + * @property {number} ERROR=7 ERROR value + */ + GetMasternodeStatusResponse.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "WAITING_FOR_PROTX"] = 1; + values[valuesById[2] = "POSE_BANNED"] = 2; + values[valuesById[3] = "REMOVED"] = 3; + values[valuesById[4] = "OPERATOR_KEY_CHANGED"] = 4; + values[valuesById[5] = "PROTX_IP_CHANGED"] = 5; + values[valuesById[6] = "READY"] = 6; + values[valuesById[7] = "ERROR"] = 7; + return values; + })(); + + return GetMasternodeStatusResponse; + })(); + + v0.GetBlockRequest = (function() { + + /** + * Properties of a GetBlockRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetBlockRequest + * @property {number|null} [height] GetBlockRequest height + * @property {string|null} [hash] GetBlockRequest hash + */ + + /** + * Constructs a new GetBlockRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetBlockRequest. + * @implements IGetBlockRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetBlockRequest=} [properties] Properties to set + */ + function GetBlockRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBlockRequest height. + * @member {number} height + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @instance + */ + GetBlockRequest.prototype.height = 0; + + /** + * GetBlockRequest hash. + * @member {string} hash + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @instance + */ + GetBlockRequest.prototype.hash = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetBlockRequest block. + * @member {"height"|"hash"|undefined} block + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @instance + */ + Object.defineProperty(GetBlockRequest.prototype, "block", { + get: $util.oneOfGetter($oneOfFields = ["height", "hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetBlockRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockRequest} GetBlockRequest instance + */ + GetBlockRequest.create = function create(properties) { + return new GetBlockRequest(properties); + }; + + /** + * Encodes the specified GetBlockRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockRequest} message GetBlockRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.height); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hash); + return writer; + }; + + /** + * Encodes the specified GetBlockRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockRequest} message GetBlockRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBlockRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockRequest} GetBlockRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint32(); + break; + case 2: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBlockRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockRequest} GetBlockRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBlockRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBlockRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.height != null && message.hasOwnProperty("height")) { + properties.block = 1; + if (!$util.isInteger(message.height)) + return "height: integer expected"; + } + if (message.hash != null && message.hasOwnProperty("hash")) { + if (properties.block === 1) + return "block: multiple values"; + properties.block = 1; + if (!$util.isString(message.hash)) + return "hash: string expected"; + } + return null; + }; + + /** + * Creates a GetBlockRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockRequest} GetBlockRequest + */ + GetBlockRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBlockRequest(); + if (object.height != null) + message.height = object.height >>> 0; + if (object.hash != null) + message.hash = String(object.hash); + return message; + }; + + /** + * Creates a plain object from a GetBlockRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @static + * @param {org.dash.platform.dapi.v0.GetBlockRequest} message GetBlockRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBlockRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.height != null && message.hasOwnProperty("height")) { + object.height = message.height; + if (options.oneofs) + object.block = "height"; + } + if (message.hash != null && message.hasOwnProperty("hash")) { + object.hash = message.hash; + if (options.oneofs) + object.block = "hash"; + } + return object; + }; + + /** + * Converts this GetBlockRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockRequest + * @instance + * @returns {Object.} JSON object + */ + GetBlockRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBlockRequest; + })(); + + v0.GetBlockResponse = (function() { + + /** + * Properties of a GetBlockResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetBlockResponse + * @property {Uint8Array|null} [block] GetBlockResponse block + */ + + /** + * Constructs a new GetBlockResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetBlockResponse. + * @implements IGetBlockResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetBlockResponse=} [properties] Properties to set + */ + function GetBlockResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBlockResponse block. + * @member {Uint8Array} block + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @instance + */ + GetBlockResponse.prototype.block = $util.newBuffer([]); + + /** + * Creates a new GetBlockResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBlockResponse} GetBlockResponse instance + */ + GetBlockResponse.create = function create(properties) { + return new GetBlockResponse(properties); + }; + + /** + * Encodes the specified GetBlockResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockResponse} message GetBlockResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.block); + return writer; + }; + + /** + * Encodes the specified GetBlockResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBlockResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBlockResponse} message GetBlockResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBlockResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBlockResponse} GetBlockResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBlockResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBlockResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBlockResponse} GetBlockResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBlockResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBlockResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!(message.block && typeof message.block.length === "number" || $util.isString(message.block))) + return "block: buffer expected"; + return null; + }; + + /** + * Creates a GetBlockResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBlockResponse} GetBlockResponse + */ + GetBlockResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBlockResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBlockResponse(); + if (object.block != null) + if (typeof object.block === "string") + $util.base64.decode(object.block, message.block = $util.newBuffer($util.base64.length(object.block)), 0); + else if (object.block.length >= 0) + message.block = object.block; + return message; + }; + + /** + * Creates a plain object from a GetBlockResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @static + * @param {org.dash.platform.dapi.v0.GetBlockResponse} message GetBlockResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBlockResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.block = ""; + else { + object.block = []; + if (options.bytes !== Array) + object.block = $util.newBuffer(object.block); + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = options.bytes === String ? $util.base64.encode(message.block, 0, message.block.length) : options.bytes === Array ? Array.prototype.slice.call(message.block) : message.block; + return object; + }; + + /** + * Converts this GetBlockResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBlockResponse + * @instance + * @returns {Object.} JSON object + */ + GetBlockResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBlockResponse; + })(); + + v0.GetBestBlockHeightRequest = (function() { + + /** + * Properties of a GetBestBlockHeightRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetBestBlockHeightRequest + */ + + /** + * Constructs a new GetBestBlockHeightRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetBestBlockHeightRequest. + * @implements IGetBestBlockHeightRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest=} [properties] Properties to set + */ + function GetBestBlockHeightRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetBestBlockHeightRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} GetBestBlockHeightRequest instance + */ + GetBestBlockHeightRequest.create = function create(properties) { + return new GetBestBlockHeightRequest(properties); + }; + + /** + * Encodes the specified GetBestBlockHeightRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBestBlockHeightRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest} message GetBestBlockHeightRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBestBlockHeightRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetBestBlockHeightRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBestBlockHeightRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightRequest} message GetBestBlockHeightRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBestBlockHeightRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBestBlockHeightRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} GetBestBlockHeightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBestBlockHeightRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBestBlockHeightRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBestBlockHeightRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} GetBestBlockHeightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBestBlockHeightRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBestBlockHeightRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBestBlockHeightRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetBestBlockHeightRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} GetBestBlockHeightRequest + */ + GetBestBlockHeightRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBestBlockHeightRequest) + return object; + return new $root.org.dash.platform.dapi.v0.GetBestBlockHeightRequest(); + }; + + /** + * Creates a plain object from a GetBestBlockHeightRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @static + * @param {org.dash.platform.dapi.v0.GetBestBlockHeightRequest} message GetBestBlockHeightRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBestBlockHeightRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetBestBlockHeightRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightRequest + * @instance + * @returns {Object.} JSON object + */ + GetBestBlockHeightRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBestBlockHeightRequest; + })(); + + v0.GetBestBlockHeightResponse = (function() { + + /** + * Properties of a GetBestBlockHeightResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetBestBlockHeightResponse + * @property {number|null} [height] GetBestBlockHeightResponse height + */ + + /** + * Constructs a new GetBestBlockHeightResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetBestBlockHeightResponse. + * @implements IGetBestBlockHeightResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightResponse=} [properties] Properties to set + */ + function GetBestBlockHeightResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBestBlockHeightResponse height. + * @member {number} height + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @instance + */ + GetBestBlockHeightResponse.prototype.height = 0; + + /** + * Creates a new GetBestBlockHeightResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} GetBestBlockHeightResponse instance + */ + GetBestBlockHeightResponse.create = function create(properties) { + return new GetBestBlockHeightResponse(properties); + }; + + /** + * Encodes the specified GetBestBlockHeightResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetBestBlockHeightResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightResponse} message GetBestBlockHeightResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBestBlockHeightResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.height); + return writer; + }; + + /** + * Encodes the specified GetBestBlockHeightResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetBestBlockHeightResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetBestBlockHeightResponse} message GetBestBlockHeightResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBestBlockHeightResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBestBlockHeightResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} GetBestBlockHeightResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBestBlockHeightResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetBestBlockHeightResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBestBlockHeightResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} GetBestBlockHeightResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBestBlockHeightResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBestBlockHeightResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBestBlockHeightResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + return null; + }; + + /** + * Creates a GetBestBlockHeightResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} GetBestBlockHeightResponse + */ + GetBestBlockHeightResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetBestBlockHeightResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetBestBlockHeightResponse(); + if (object.height != null) + message.height = object.height >>> 0; + return message; + }; + + /** + * Creates a plain object from a GetBestBlockHeightResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @static + * @param {org.dash.platform.dapi.v0.GetBestBlockHeightResponse} message GetBestBlockHeightResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBestBlockHeightResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.height = 0; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + return object; + }; + + /** + * Converts this GetBestBlockHeightResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetBestBlockHeightResponse + * @instance + * @returns {Object.} JSON object + */ + GetBestBlockHeightResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBestBlockHeightResponse; + })(); + + v0.BroadcastTransactionRequest = (function() { + + /** + * Properties of a BroadcastTransactionRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IBroadcastTransactionRequest + * @property {Uint8Array|null} [transaction] BroadcastTransactionRequest transaction + * @property {boolean|null} [allowHighFees] BroadcastTransactionRequest allowHighFees + * @property {boolean|null} [bypassLimits] BroadcastTransactionRequest bypassLimits + */ + + /** + * Constructs a new BroadcastTransactionRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BroadcastTransactionRequest. + * @implements IBroadcastTransactionRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest=} [properties] Properties to set + */ + function BroadcastTransactionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BroadcastTransactionRequest transaction. + * @member {Uint8Array} transaction + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @instance + */ + BroadcastTransactionRequest.prototype.transaction = $util.newBuffer([]); + + /** + * BroadcastTransactionRequest allowHighFees. + * @member {boolean} allowHighFees + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @instance + */ + BroadcastTransactionRequest.prototype.allowHighFees = false; + + /** + * BroadcastTransactionRequest bypassLimits. + * @member {boolean} bypassLimits + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @instance + */ + BroadcastTransactionRequest.prototype.bypassLimits = false; + + /** + * Creates a new BroadcastTransactionRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BroadcastTransactionRequest} BroadcastTransactionRequest instance + */ + BroadcastTransactionRequest.create = function create(properties) { + return new BroadcastTransactionRequest(properties); + }; + + /** + * Encodes the specified BroadcastTransactionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastTransactionRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest} message BroadcastTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastTransactionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + if (message.allowHighFees != null && Object.hasOwnProperty.call(message, "allowHighFees")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowHighFees); + if (message.bypassLimits != null && Object.hasOwnProperty.call(message, "bypassLimits")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.bypassLimits); + return writer; + }; + + /** + * Encodes the specified BroadcastTransactionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastTransactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionRequest} message BroadcastTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastTransactionRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BroadcastTransactionRequest} BroadcastTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastTransactionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastTransactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transaction = reader.bytes(); + break; + case 2: + message.allowHighFees = reader.bool(); + break; + case 3: + message.bypassLimits = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastTransactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BroadcastTransactionRequest} BroadcastTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastTransactionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastTransactionRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastTransactionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + if (message.allowHighFees != null && message.hasOwnProperty("allowHighFees")) + if (typeof message.allowHighFees !== "boolean") + return "allowHighFees: boolean expected"; + if (message.bypassLimits != null && message.hasOwnProperty("bypassLimits")) + if (typeof message.bypassLimits !== "boolean") + return "bypassLimits: boolean expected"; + return null; + }; + + /** + * Creates a BroadcastTransactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BroadcastTransactionRequest} BroadcastTransactionRequest + */ + BroadcastTransactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastTransactionRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.BroadcastTransactionRequest(); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length >= 0) + message.transaction = object.transaction; + if (object.allowHighFees != null) + message.allowHighFees = Boolean(object.allowHighFees); + if (object.bypassLimits != null) + message.bypassLimits = Boolean(object.bypassLimits); + return message; + }; + + /** + * Creates a plain object from a BroadcastTransactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @static + * @param {org.dash.platform.dapi.v0.BroadcastTransactionRequest} message BroadcastTransactionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastTransactionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.transaction = ""; + else { + object.transaction = []; + if (options.bytes !== Array) + object.transaction = $util.newBuffer(object.transaction); + } + object.allowHighFees = false; + object.bypassLimits = false; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (message.allowHighFees != null && message.hasOwnProperty("allowHighFees")) + object.allowHighFees = message.allowHighFees; + if (message.bypassLimits != null && message.hasOwnProperty("bypassLimits")) + object.bypassLimits = message.bypassLimits; + return object; + }; + + /** + * Converts this BroadcastTransactionRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionRequest + * @instance + * @returns {Object.} JSON object + */ + BroadcastTransactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastTransactionRequest; + })(); + + v0.BroadcastTransactionResponse = (function() { + + /** + * Properties of a BroadcastTransactionResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IBroadcastTransactionResponse + * @property {string|null} [transactionId] BroadcastTransactionResponse transactionId + */ + + /** + * Constructs a new BroadcastTransactionResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BroadcastTransactionResponse. + * @implements IBroadcastTransactionResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionResponse=} [properties] Properties to set + */ + function BroadcastTransactionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BroadcastTransactionResponse transactionId. + * @member {string} transactionId + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @instance + */ + BroadcastTransactionResponse.prototype.transactionId = ""; + + /** + * Creates a new BroadcastTransactionResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BroadcastTransactionResponse} BroadcastTransactionResponse instance + */ + BroadcastTransactionResponse.create = function create(properties) { + return new BroadcastTransactionResponse(properties); + }; + + /** + * Encodes the specified BroadcastTransactionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastTransactionResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionResponse} message BroadcastTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastTransactionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transactionId); + return writer; + }; + + /** + * Encodes the specified BroadcastTransactionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastTransactionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastTransactionResponse} message BroadcastTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastTransactionResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BroadcastTransactionResponse} BroadcastTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastTransactionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastTransactionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transactionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastTransactionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BroadcastTransactionResponse} BroadcastTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastTransactionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastTransactionResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastTransactionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (!$util.isString(message.transactionId)) + return "transactionId: string expected"; + return null; + }; + + /** + * Creates a BroadcastTransactionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BroadcastTransactionResponse} BroadcastTransactionResponse + */ + BroadcastTransactionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastTransactionResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.BroadcastTransactionResponse(); + if (object.transactionId != null) + message.transactionId = String(object.transactionId); + return message; + }; + + /** + * Creates a plain object from a BroadcastTransactionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @static + * @param {org.dash.platform.dapi.v0.BroadcastTransactionResponse} message BroadcastTransactionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastTransactionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.transactionId = ""; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + object.transactionId = message.transactionId; + return object; + }; + + /** + * Converts this BroadcastTransactionResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BroadcastTransactionResponse + * @instance + * @returns {Object.} JSON object + */ + BroadcastTransactionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastTransactionResponse; + })(); + + v0.GetTransactionRequest = (function() { + + /** + * Properties of a GetTransactionRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTransactionRequest + * @property {string|null} [id] GetTransactionRequest id + */ + + /** + * Constructs a new GetTransactionRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTransactionRequest. + * @implements IGetTransactionRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTransactionRequest=} [properties] Properties to set + */ + function GetTransactionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTransactionRequest id. + * @member {string} id + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @instance + */ + GetTransactionRequest.prototype.id = ""; + + /** + * Creates a new GetTransactionRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTransactionRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTransactionRequest} GetTransactionRequest instance + */ + GetTransactionRequest.create = function create(properties) { + return new GetTransactionRequest(properties); + }; + + /** + * Encodes the specified GetTransactionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTransactionRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTransactionRequest} message GetTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransactionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + return writer; + }; + + /** + * Encodes the specified GetTransactionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTransactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTransactionRequest} message GetTransactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransactionRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTransactionRequest} GetTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransactionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTransactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTransactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTransactionRequest} GetTransactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransactionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransactionRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransactionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a GetTransactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTransactionRequest} GetTransactionRequest + */ + GetTransactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTransactionRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTransactionRequest(); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a GetTransactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTransactionRequest} message GetTransactionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransactionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this GetTransactionRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTransactionRequest + * @instance + * @returns {Object.} JSON object + */ + GetTransactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTransactionRequest; + })(); + + v0.GetTransactionResponse = (function() { + + /** + * Properties of a GetTransactionResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTransactionResponse + * @property {Uint8Array|null} [transaction] GetTransactionResponse transaction + * @property {Uint8Array|null} [blockHash] GetTransactionResponse blockHash + * @property {number|null} [height] GetTransactionResponse height + * @property {number|null} [confirmations] GetTransactionResponse confirmations + * @property {boolean|null} [isInstantLocked] GetTransactionResponse isInstantLocked + * @property {boolean|null} [isChainLocked] GetTransactionResponse isChainLocked + */ + + /** + * Constructs a new GetTransactionResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTransactionResponse. + * @implements IGetTransactionResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTransactionResponse=} [properties] Properties to set + */ + function GetTransactionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTransactionResponse transaction. + * @member {Uint8Array} transaction + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @instance + */ + GetTransactionResponse.prototype.transaction = $util.newBuffer([]); + + /** + * GetTransactionResponse blockHash. + * @member {Uint8Array} blockHash + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @instance + */ + GetTransactionResponse.prototype.blockHash = $util.newBuffer([]); + + /** + * GetTransactionResponse height. + * @member {number} height + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @instance + */ + GetTransactionResponse.prototype.height = 0; + + /** + * GetTransactionResponse confirmations. + * @member {number} confirmations + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @instance + */ + GetTransactionResponse.prototype.confirmations = 0; + + /** + * GetTransactionResponse isInstantLocked. + * @member {boolean} isInstantLocked + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @instance + */ + GetTransactionResponse.prototype.isInstantLocked = false; + + /** + * GetTransactionResponse isChainLocked. + * @member {boolean} isChainLocked + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @instance + */ + GetTransactionResponse.prototype.isChainLocked = false; + + /** + * Creates a new GetTransactionResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTransactionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTransactionResponse} GetTransactionResponse instance + */ + GetTransactionResponse.create = function create(properties) { + return new GetTransactionResponse(properties); + }; + + /** + * Encodes the specified GetTransactionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTransactionResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTransactionResponse} message GetTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransactionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + if (message.blockHash != null && Object.hasOwnProperty.call(message, "blockHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.blockHash); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.height); + if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.confirmations); + if (message.isInstantLocked != null && Object.hasOwnProperty.call(message, "isInstantLocked")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isInstantLocked); + if (message.isChainLocked != null && Object.hasOwnProperty.call(message, "isChainLocked")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isChainLocked); + return writer; + }; + + /** + * Encodes the specified GetTransactionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTransactionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTransactionResponse} message GetTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransactionResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTransactionResponse} GetTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransactionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTransactionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transaction = reader.bytes(); + break; + case 2: + message.blockHash = reader.bytes(); + break; + case 3: + message.height = reader.uint32(); + break; + case 4: + message.confirmations = reader.uint32(); + break; + case 5: + message.isInstantLocked = reader.bool(); + break; + case 6: + message.isChainLocked = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTransactionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTransactionResponse} GetTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransactionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransactionResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransactionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + if (message.blockHash != null && message.hasOwnProperty("blockHash")) + if (!(message.blockHash && typeof message.blockHash.length === "number" || $util.isString(message.blockHash))) + return "blockHash: buffer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.confirmations != null && message.hasOwnProperty("confirmations")) + if (!$util.isInteger(message.confirmations)) + return "confirmations: integer expected"; + if (message.isInstantLocked != null && message.hasOwnProperty("isInstantLocked")) + if (typeof message.isInstantLocked !== "boolean") + return "isInstantLocked: boolean expected"; + if (message.isChainLocked != null && message.hasOwnProperty("isChainLocked")) + if (typeof message.isChainLocked !== "boolean") + return "isChainLocked: boolean expected"; + return null; + }; + + /** + * Creates a GetTransactionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTransactionResponse} GetTransactionResponse + */ + GetTransactionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTransactionResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTransactionResponse(); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length >= 0) + message.transaction = object.transaction; + if (object.blockHash != null) + if (typeof object.blockHash === "string") + $util.base64.decode(object.blockHash, message.blockHash = $util.newBuffer($util.base64.length(object.blockHash)), 0); + else if (object.blockHash.length >= 0) + message.blockHash = object.blockHash; + if (object.height != null) + message.height = object.height >>> 0; + if (object.confirmations != null) + message.confirmations = object.confirmations >>> 0; + if (object.isInstantLocked != null) + message.isInstantLocked = Boolean(object.isInstantLocked); + if (object.isChainLocked != null) + message.isChainLocked = Boolean(object.isChainLocked); + return message; + }; + + /** + * Creates a plain object from a GetTransactionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTransactionResponse} message GetTransactionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransactionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.transaction = ""; + else { + object.transaction = []; + if (options.bytes !== Array) + object.transaction = $util.newBuffer(object.transaction); + } + if (options.bytes === String) + object.blockHash = ""; + else { + object.blockHash = []; + if (options.bytes !== Array) + object.blockHash = $util.newBuffer(object.blockHash); + } + object.height = 0; + object.confirmations = 0; + object.isInstantLocked = false; + object.isChainLocked = false; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (message.blockHash != null && message.hasOwnProperty("blockHash")) + object.blockHash = options.bytes === String ? $util.base64.encode(message.blockHash, 0, message.blockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.blockHash) : message.blockHash; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.confirmations != null && message.hasOwnProperty("confirmations")) + object.confirmations = message.confirmations; + if (message.isInstantLocked != null && message.hasOwnProperty("isInstantLocked")) + object.isInstantLocked = message.isInstantLocked; + if (message.isChainLocked != null && message.hasOwnProperty("isChainLocked")) + object.isChainLocked = message.isChainLocked; + return object; + }; + + /** + * Converts this GetTransactionResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTransactionResponse + * @instance + * @returns {Object.} JSON object + */ + GetTransactionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTransactionResponse; + })(); + + v0.BlockHeadersWithChainLocksRequest = (function() { + + /** + * Properties of a BlockHeadersWithChainLocksRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IBlockHeadersWithChainLocksRequest + * @property {Uint8Array|null} [fromBlockHash] BlockHeadersWithChainLocksRequest fromBlockHash + * @property {number|null} [fromBlockHeight] BlockHeadersWithChainLocksRequest fromBlockHeight + * @property {number|null} [count] BlockHeadersWithChainLocksRequest count + */ + + /** + * Constructs a new BlockHeadersWithChainLocksRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BlockHeadersWithChainLocksRequest. + * @implements IBlockHeadersWithChainLocksRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest=} [properties] Properties to set + */ + function BlockHeadersWithChainLocksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockHeadersWithChainLocksRequest fromBlockHash. + * @member {Uint8Array} fromBlockHash + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @instance + */ + BlockHeadersWithChainLocksRequest.prototype.fromBlockHash = $util.newBuffer([]); + + /** + * BlockHeadersWithChainLocksRequest fromBlockHeight. + * @member {number} fromBlockHeight + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @instance + */ + BlockHeadersWithChainLocksRequest.prototype.fromBlockHeight = 0; + + /** + * BlockHeadersWithChainLocksRequest count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @instance + */ + BlockHeadersWithChainLocksRequest.prototype.count = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BlockHeadersWithChainLocksRequest fromBlock. + * @member {"fromBlockHash"|"fromBlockHeight"|undefined} fromBlock + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @instance + */ + Object.defineProperty(BlockHeadersWithChainLocksRequest.prototype, "fromBlock", { + get: $util.oneOfGetter($oneOfFields = ["fromBlockHash", "fromBlockHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BlockHeadersWithChainLocksRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} BlockHeadersWithChainLocksRequest instance + */ + BlockHeadersWithChainLocksRequest.create = function create(properties) { + return new BlockHeadersWithChainLocksRequest(properties); + }; + + /** + * Encodes the specified BlockHeadersWithChainLocksRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest} message BlockHeadersWithChainLocksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockHeadersWithChainLocksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromBlockHash != null && Object.hasOwnProperty.call(message, "fromBlockHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.fromBlockHash); + if (message.fromBlockHeight != null && Object.hasOwnProperty.call(message, "fromBlockHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.fromBlockHeight); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.count); + return writer; + }; + + /** + * Encodes the specified BlockHeadersWithChainLocksRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksRequest} message BlockHeadersWithChainLocksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockHeadersWithChainLocksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockHeadersWithChainLocksRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} BlockHeadersWithChainLocksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockHeadersWithChainLocksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromBlockHash = reader.bytes(); + break; + case 2: + message.fromBlockHeight = reader.uint32(); + break; + case 3: + message.count = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockHeadersWithChainLocksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} BlockHeadersWithChainLocksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockHeadersWithChainLocksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockHeadersWithChainLocksRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockHeadersWithChainLocksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fromBlockHash != null && message.hasOwnProperty("fromBlockHash")) { + properties.fromBlock = 1; + if (!(message.fromBlockHash && typeof message.fromBlockHash.length === "number" || $util.isString(message.fromBlockHash))) + return "fromBlockHash: buffer expected"; + } + if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) { + if (properties.fromBlock === 1) + return "fromBlock: multiple values"; + properties.fromBlock = 1; + if (!$util.isInteger(message.fromBlockHeight)) + return "fromBlockHeight: integer expected"; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a BlockHeadersWithChainLocksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} BlockHeadersWithChainLocksRequest + */ + BlockHeadersWithChainLocksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest(); + if (object.fromBlockHash != null) + if (typeof object.fromBlockHash === "string") + $util.base64.decode(object.fromBlockHash, message.fromBlockHash = $util.newBuffer($util.base64.length(object.fromBlockHash)), 0); + else if (object.fromBlockHash.length >= 0) + message.fromBlockHash = object.fromBlockHash; + if (object.fromBlockHeight != null) + message.fromBlockHeight = object.fromBlockHeight >>> 0; + if (object.count != null) + message.count = object.count >>> 0; + return message; + }; + + /** + * Creates a plain object from a BlockHeadersWithChainLocksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @static + * @param {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} message BlockHeadersWithChainLocksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockHeadersWithChainLocksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.count = 0; + if (message.fromBlockHash != null && message.hasOwnProperty("fromBlockHash")) { + object.fromBlockHash = options.bytes === String ? $util.base64.encode(message.fromBlockHash, 0, message.fromBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.fromBlockHash) : message.fromBlockHash; + if (options.oneofs) + object.fromBlock = "fromBlockHash"; + } + if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) { + object.fromBlockHeight = message.fromBlockHeight; + if (options.oneofs) + object.fromBlock = "fromBlockHeight"; + } + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this BlockHeadersWithChainLocksRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest + * @instance + * @returns {Object.} JSON object + */ + BlockHeadersWithChainLocksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockHeadersWithChainLocksRequest; + })(); + + v0.BlockHeadersWithChainLocksResponse = (function() { + + /** + * Properties of a BlockHeadersWithChainLocksResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IBlockHeadersWithChainLocksResponse + * @property {org.dash.platform.dapi.v0.IBlockHeaders|null} [blockHeaders] BlockHeadersWithChainLocksResponse blockHeaders + * @property {Uint8Array|null} [chainLock] BlockHeadersWithChainLocksResponse chainLock + */ + + /** + * Constructs a new BlockHeadersWithChainLocksResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BlockHeadersWithChainLocksResponse. + * @implements IBlockHeadersWithChainLocksResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksResponse=} [properties] Properties to set + */ + function BlockHeadersWithChainLocksResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockHeadersWithChainLocksResponse blockHeaders. + * @member {org.dash.platform.dapi.v0.IBlockHeaders|null|undefined} blockHeaders + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @instance + */ + BlockHeadersWithChainLocksResponse.prototype.blockHeaders = null; + + /** + * BlockHeadersWithChainLocksResponse chainLock. + * @member {Uint8Array} chainLock + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @instance + */ + BlockHeadersWithChainLocksResponse.prototype.chainLock = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BlockHeadersWithChainLocksResponse responses. + * @member {"blockHeaders"|"chainLock"|undefined} responses + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @instance + */ + Object.defineProperty(BlockHeadersWithChainLocksResponse.prototype, "responses", { + get: $util.oneOfGetter($oneOfFields = ["blockHeaders", "chainLock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BlockHeadersWithChainLocksResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} BlockHeadersWithChainLocksResponse instance + */ + BlockHeadersWithChainLocksResponse.create = function create(properties) { + return new BlockHeadersWithChainLocksResponse(properties); + }; + + /** + * Encodes the specified BlockHeadersWithChainLocksResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksResponse} message BlockHeadersWithChainLocksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockHeadersWithChainLocksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockHeaders != null && Object.hasOwnProperty.call(message, "blockHeaders")) + $root.org.dash.platform.dapi.v0.BlockHeaders.encode(message.blockHeaders, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.chainLock != null && Object.hasOwnProperty.call(message, "chainLock")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chainLock); + return writer; + }; + + /** + * Encodes the specified BlockHeadersWithChainLocksResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeadersWithChainLocksResponse} message BlockHeadersWithChainLocksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockHeadersWithChainLocksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockHeadersWithChainLocksResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} BlockHeadersWithChainLocksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockHeadersWithChainLocksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeaders = $root.org.dash.platform.dapi.v0.BlockHeaders.decode(reader, reader.uint32()); + break; + case 2: + message.chainLock = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockHeadersWithChainLocksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} BlockHeadersWithChainLocksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockHeadersWithChainLocksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockHeadersWithChainLocksResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockHeadersWithChainLocksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.blockHeaders != null && message.hasOwnProperty("blockHeaders")) { + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.BlockHeaders.verify(message.blockHeaders); + if (error) + return "blockHeaders." + error; + } + } + if (message.chainLock != null && message.hasOwnProperty("chainLock")) { + if (properties.responses === 1) + return "responses: multiple values"; + properties.responses = 1; + if (!(message.chainLock && typeof message.chainLock.length === "number" || $util.isString(message.chainLock))) + return "chainLock: buffer expected"; + } + return null; + }; + + /** + * Creates a BlockHeadersWithChainLocksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} BlockHeadersWithChainLocksResponse + */ + BlockHeadersWithChainLocksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse(); + if (object.blockHeaders != null) { + if (typeof object.blockHeaders !== "object") + throw TypeError(".org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse.blockHeaders: object expected"); + message.blockHeaders = $root.org.dash.platform.dapi.v0.BlockHeaders.fromObject(object.blockHeaders); + } + if (object.chainLock != null) + if (typeof object.chainLock === "string") + $util.base64.decode(object.chainLock, message.chainLock = $util.newBuffer($util.base64.length(object.chainLock)), 0); + else if (object.chainLock.length >= 0) + message.chainLock = object.chainLock; + return message; + }; + + /** + * Creates a plain object from a BlockHeadersWithChainLocksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @static + * @param {org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse} message BlockHeadersWithChainLocksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockHeadersWithChainLocksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.blockHeaders != null && message.hasOwnProperty("blockHeaders")) { + object.blockHeaders = $root.org.dash.platform.dapi.v0.BlockHeaders.toObject(message.blockHeaders, options); + if (options.oneofs) + object.responses = "blockHeaders"; + } + if (message.chainLock != null && message.hasOwnProperty("chainLock")) { + object.chainLock = options.bytes === String ? $util.base64.encode(message.chainLock, 0, message.chainLock.length) : options.bytes === Array ? Array.prototype.slice.call(message.chainLock) : message.chainLock; + if (options.oneofs) + object.responses = "chainLock"; + } + return object; + }; + + /** + * Converts this BlockHeadersWithChainLocksResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse + * @instance + * @returns {Object.} JSON object + */ + BlockHeadersWithChainLocksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockHeadersWithChainLocksResponse; + })(); + + v0.BlockHeaders = (function() { + + /** + * Properties of a BlockHeaders. + * @memberof org.dash.platform.dapi.v0 + * @interface IBlockHeaders + * @property {Array.|null} [headers] BlockHeaders headers + */ + + /** + * Constructs a new BlockHeaders. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BlockHeaders. + * @implements IBlockHeaders + * @constructor + * @param {org.dash.platform.dapi.v0.IBlockHeaders=} [properties] Properties to set + */ + function BlockHeaders(properties) { + this.headers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlockHeaders headers. + * @member {Array.} headers + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @instance + */ + BlockHeaders.prototype.headers = $util.emptyArray; + + /** + * Creates a new BlockHeaders instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeaders=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BlockHeaders} BlockHeaders instance + */ + BlockHeaders.create = function create(properties) { + return new BlockHeaders(properties); + }; + + /** + * Encodes the specified BlockHeaders message. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeaders.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeaders} message BlockHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockHeaders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.headers[i]); + return writer; + }; + + /** + * Encodes the specified BlockHeaders message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BlockHeaders.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @static + * @param {org.dash.platform.dapi.v0.IBlockHeaders} message BlockHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlockHeaders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlockHeaders message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BlockHeaders} BlockHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockHeaders.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BlockHeaders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlockHeaders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BlockHeaders} BlockHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlockHeaders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlockHeaders message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlockHeaders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) + if (!(message.headers[i] && typeof message.headers[i].length === "number" || $util.isString(message.headers[i]))) + return "headers: buffer[] expected"; + } + return null; + }; + + /** + * Creates a BlockHeaders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BlockHeaders} BlockHeaders + */ + BlockHeaders.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BlockHeaders) + return object; + var message = new $root.org.dash.platform.dapi.v0.BlockHeaders(); + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".org.dash.platform.dapi.v0.BlockHeaders.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) + if (typeof object.headers[i] === "string") + $util.base64.decode(object.headers[i], message.headers[i] = $util.newBuffer($util.base64.length(object.headers[i])), 0); + else if (object.headers[i].length >= 0) + message.headers[i] = object.headers[i]; + } + return message; + }; + + /** + * Creates a plain object from a BlockHeaders message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @static + * @param {org.dash.platform.dapi.v0.BlockHeaders} message BlockHeaders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlockHeaders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.headers = []; + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = options.bytes === String ? $util.base64.encode(message.headers[j], 0, message.headers[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.headers[j]) : message.headers[j]; + } + return object; + }; + + /** + * Converts this BlockHeaders to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BlockHeaders + * @instance + * @returns {Object.} JSON object + */ + BlockHeaders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BlockHeaders; + })(); + + v0.GetEstimatedTransactionFeeRequest = (function() { + + /** + * Properties of a GetEstimatedTransactionFeeRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEstimatedTransactionFeeRequest + * @property {number|null} [blocks] GetEstimatedTransactionFeeRequest blocks + */ + + /** + * Constructs a new GetEstimatedTransactionFeeRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEstimatedTransactionFeeRequest. + * @implements IGetEstimatedTransactionFeeRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest=} [properties] Properties to set + */ + function GetEstimatedTransactionFeeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEstimatedTransactionFeeRequest blocks. + * @member {number} blocks + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @instance + */ + GetEstimatedTransactionFeeRequest.prototype.blocks = 0; + + /** + * Creates a new GetEstimatedTransactionFeeRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} GetEstimatedTransactionFeeRequest instance + */ + GetEstimatedTransactionFeeRequest.create = function create(properties) { + return new GetEstimatedTransactionFeeRequest(properties); + }; + + /** + * Encodes the specified GetEstimatedTransactionFeeRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest} message GetEstimatedTransactionFeeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEstimatedTransactionFeeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blocks != null && Object.hasOwnProperty.call(message, "blocks")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.blocks); + return writer; + }; + + /** + * Encodes the specified GetEstimatedTransactionFeeRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeRequest} message GetEstimatedTransactionFeeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEstimatedTransactionFeeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEstimatedTransactionFeeRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} GetEstimatedTransactionFeeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEstimatedTransactionFeeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blocks = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEstimatedTransactionFeeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} GetEstimatedTransactionFeeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEstimatedTransactionFeeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEstimatedTransactionFeeRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEstimatedTransactionFeeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) + if (!$util.isInteger(message.blocks)) + return "blocks: integer expected"; + return null; + }; + + /** + * Creates a GetEstimatedTransactionFeeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} GetEstimatedTransactionFeeRequest + */ + GetEstimatedTransactionFeeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest(); + if (object.blocks != null) + message.blocks = object.blocks >>> 0; + return message; + }; + + /** + * Creates a plain object from a GetEstimatedTransactionFeeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} message GetEstimatedTransactionFeeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEstimatedTransactionFeeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.blocks = 0; + if (message.blocks != null && message.hasOwnProperty("blocks")) + object.blocks = message.blocks; + return object; + }; + + /** + * Converts this GetEstimatedTransactionFeeRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest + * @instance + * @returns {Object.} JSON object + */ + GetEstimatedTransactionFeeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEstimatedTransactionFeeRequest; + })(); + + v0.GetEstimatedTransactionFeeResponse = (function() { + + /** + * Properties of a GetEstimatedTransactionFeeResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEstimatedTransactionFeeResponse + * @property {number|null} [fee] GetEstimatedTransactionFeeResponse fee + */ + + /** + * Constructs a new GetEstimatedTransactionFeeResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEstimatedTransactionFeeResponse. + * @implements IGetEstimatedTransactionFeeResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeResponse=} [properties] Properties to set + */ + function GetEstimatedTransactionFeeResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEstimatedTransactionFeeResponse fee. + * @member {number} fee + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @instance + */ + GetEstimatedTransactionFeeResponse.prototype.fee = 0; + + /** + * Creates a new GetEstimatedTransactionFeeResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} GetEstimatedTransactionFeeResponse instance + */ + GetEstimatedTransactionFeeResponse.create = function create(properties) { + return new GetEstimatedTransactionFeeResponse(properties); + }; + + /** + * Encodes the specified GetEstimatedTransactionFeeResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeResponse} message GetEstimatedTransactionFeeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEstimatedTransactionFeeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.fee); + return writer; + }; + + /** + * Encodes the specified GetEstimatedTransactionFeeResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEstimatedTransactionFeeResponse} message GetEstimatedTransactionFeeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEstimatedTransactionFeeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEstimatedTransactionFeeResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} GetEstimatedTransactionFeeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEstimatedTransactionFeeResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fee = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEstimatedTransactionFeeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} GetEstimatedTransactionFeeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEstimatedTransactionFeeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEstimatedTransactionFeeResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEstimatedTransactionFeeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fee != null && message.hasOwnProperty("fee")) + if (typeof message.fee !== "number") + return "fee: number expected"; + return null; + }; + + /** + * Creates a GetEstimatedTransactionFeeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} GetEstimatedTransactionFeeResponse + */ + GetEstimatedTransactionFeeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse(); + if (object.fee != null) + message.fee = Number(object.fee); + return message; + }; + + /** + * Creates a plain object from a GetEstimatedTransactionFeeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @static + * @param {org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse} message GetEstimatedTransactionFeeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEstimatedTransactionFeeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fee = 0; + if (message.fee != null && message.hasOwnProperty("fee")) + object.fee = options.json && !isFinite(message.fee) ? String(message.fee) : message.fee; + return object; + }; + + /** + * Converts this GetEstimatedTransactionFeeResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse + * @instance + * @returns {Object.} JSON object + */ + GetEstimatedTransactionFeeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEstimatedTransactionFeeResponse; + })(); + + v0.TransactionsWithProofsRequest = (function() { + + /** + * Properties of a TransactionsWithProofsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface ITransactionsWithProofsRequest + * @property {org.dash.platform.dapi.v0.IBloomFilter|null} [bloomFilter] TransactionsWithProofsRequest bloomFilter + * @property {Uint8Array|null} [fromBlockHash] TransactionsWithProofsRequest fromBlockHash + * @property {number|null} [fromBlockHeight] TransactionsWithProofsRequest fromBlockHeight + * @property {number|null} [count] TransactionsWithProofsRequest count + * @property {boolean|null} [sendTransactionHashes] TransactionsWithProofsRequest sendTransactionHashes + */ + + /** + * Constructs a new TransactionsWithProofsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a TransactionsWithProofsRequest. + * @implements ITransactionsWithProofsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest=} [properties] Properties to set + */ + function TransactionsWithProofsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionsWithProofsRequest bloomFilter. + * @member {org.dash.platform.dapi.v0.IBloomFilter|null|undefined} bloomFilter + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @instance + */ + TransactionsWithProofsRequest.prototype.bloomFilter = null; + + /** + * TransactionsWithProofsRequest fromBlockHash. + * @member {Uint8Array} fromBlockHash + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @instance + */ + TransactionsWithProofsRequest.prototype.fromBlockHash = $util.newBuffer([]); + + /** + * TransactionsWithProofsRequest fromBlockHeight. + * @member {number} fromBlockHeight + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @instance + */ + TransactionsWithProofsRequest.prototype.fromBlockHeight = 0; + + /** + * TransactionsWithProofsRequest count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @instance + */ + TransactionsWithProofsRequest.prototype.count = 0; + + /** + * TransactionsWithProofsRequest sendTransactionHashes. + * @member {boolean} sendTransactionHashes + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @instance + */ + TransactionsWithProofsRequest.prototype.sendTransactionHashes = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionsWithProofsRequest fromBlock. + * @member {"fromBlockHash"|"fromBlockHeight"|undefined} fromBlock + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @instance + */ + Object.defineProperty(TransactionsWithProofsRequest.prototype, "fromBlock", { + get: $util.oneOfGetter($oneOfFields = ["fromBlockHash", "fromBlockHeight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionsWithProofsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @static + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} TransactionsWithProofsRequest instance + */ + TransactionsWithProofsRequest.create = function create(properties) { + return new TransactionsWithProofsRequest(properties); + }; + + /** + * Encodes the specified TransactionsWithProofsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.TransactionsWithProofsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @static + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest} message TransactionsWithProofsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionsWithProofsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bloomFilter != null && Object.hasOwnProperty.call(message, "bloomFilter")) + $root.org.dash.platform.dapi.v0.BloomFilter.encode(message.bloomFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fromBlockHash != null && Object.hasOwnProperty.call(message, "fromBlockHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.fromBlockHash); + if (message.fromBlockHeight != null && Object.hasOwnProperty.call(message, "fromBlockHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.fromBlockHeight); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.count); + if (message.sendTransactionHashes != null && Object.hasOwnProperty.call(message, "sendTransactionHashes")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.sendTransactionHashes); + return writer; + }; + + /** + * Encodes the specified TransactionsWithProofsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.TransactionsWithProofsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @static + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsRequest} message TransactionsWithProofsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionsWithProofsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionsWithProofsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} TransactionsWithProofsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionsWithProofsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.TransactionsWithProofsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bloomFilter = $root.org.dash.platform.dapi.v0.BloomFilter.decode(reader, reader.uint32()); + break; + case 2: + message.fromBlockHash = reader.bytes(); + break; + case 3: + message.fromBlockHeight = reader.uint32(); + break; + case 4: + message.count = reader.uint32(); + break; + case 5: + message.sendTransactionHashes = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionsWithProofsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} TransactionsWithProofsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionsWithProofsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionsWithProofsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionsWithProofsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bloomFilter != null && message.hasOwnProperty("bloomFilter")) { + var error = $root.org.dash.platform.dapi.v0.BloomFilter.verify(message.bloomFilter); + if (error) + return "bloomFilter." + error; + } + if (message.fromBlockHash != null && message.hasOwnProperty("fromBlockHash")) { + properties.fromBlock = 1; + if (!(message.fromBlockHash && typeof message.fromBlockHash.length === "number" || $util.isString(message.fromBlockHash))) + return "fromBlockHash: buffer expected"; + } + if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) { + if (properties.fromBlock === 1) + return "fromBlock: multiple values"; + properties.fromBlock = 1; + if (!$util.isInteger(message.fromBlockHeight)) + return "fromBlockHeight: integer expected"; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.sendTransactionHashes != null && message.hasOwnProperty("sendTransactionHashes")) + if (typeof message.sendTransactionHashes !== "boolean") + return "sendTransactionHashes: boolean expected"; + return null; + }; + + /** + * Creates a TransactionsWithProofsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} TransactionsWithProofsRequest + */ + TransactionsWithProofsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.TransactionsWithProofsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.TransactionsWithProofsRequest(); + if (object.bloomFilter != null) { + if (typeof object.bloomFilter !== "object") + throw TypeError(".org.dash.platform.dapi.v0.TransactionsWithProofsRequest.bloomFilter: object expected"); + message.bloomFilter = $root.org.dash.platform.dapi.v0.BloomFilter.fromObject(object.bloomFilter); + } + if (object.fromBlockHash != null) + if (typeof object.fromBlockHash === "string") + $util.base64.decode(object.fromBlockHash, message.fromBlockHash = $util.newBuffer($util.base64.length(object.fromBlockHash)), 0); + else if (object.fromBlockHash.length >= 0) + message.fromBlockHash = object.fromBlockHash; + if (object.fromBlockHeight != null) + message.fromBlockHeight = object.fromBlockHeight >>> 0; + if (object.count != null) + message.count = object.count >>> 0; + if (object.sendTransactionHashes != null) + message.sendTransactionHashes = Boolean(object.sendTransactionHashes); + return message; + }; + + /** + * Creates a plain object from a TransactionsWithProofsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @static + * @param {org.dash.platform.dapi.v0.TransactionsWithProofsRequest} message TransactionsWithProofsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionsWithProofsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bloomFilter = null; + object.count = 0; + object.sendTransactionHashes = false; + } + if (message.bloomFilter != null && message.hasOwnProperty("bloomFilter")) + object.bloomFilter = $root.org.dash.platform.dapi.v0.BloomFilter.toObject(message.bloomFilter, options); + if (message.fromBlockHash != null && message.hasOwnProperty("fromBlockHash")) { + object.fromBlockHash = options.bytes === String ? $util.base64.encode(message.fromBlockHash, 0, message.fromBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.fromBlockHash) : message.fromBlockHash; + if (options.oneofs) + object.fromBlock = "fromBlockHash"; + } + if (message.fromBlockHeight != null && message.hasOwnProperty("fromBlockHeight")) { + object.fromBlockHeight = message.fromBlockHeight; + if (options.oneofs) + object.fromBlock = "fromBlockHeight"; + } + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.sendTransactionHashes != null && message.hasOwnProperty("sendTransactionHashes")) + object.sendTransactionHashes = message.sendTransactionHashes; + return object; + }; + + /** + * Converts this TransactionsWithProofsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsRequest + * @instance + * @returns {Object.} JSON object + */ + TransactionsWithProofsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TransactionsWithProofsRequest; + })(); + + v0.BloomFilter = (function() { + + /** + * Properties of a BloomFilter. + * @memberof org.dash.platform.dapi.v0 + * @interface IBloomFilter + * @property {Uint8Array|null} [vData] BloomFilter vData + * @property {number|null} [nHashFuncs] BloomFilter nHashFuncs + * @property {number|null} [nTweak] BloomFilter nTweak + * @property {number|null} [nFlags] BloomFilter nFlags + */ + + /** + * Constructs a new BloomFilter. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BloomFilter. + * @implements IBloomFilter + * @constructor + * @param {org.dash.platform.dapi.v0.IBloomFilter=} [properties] Properties to set + */ + function BloomFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BloomFilter vData. + * @member {Uint8Array} vData + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @instance + */ + BloomFilter.prototype.vData = $util.newBuffer([]); + + /** + * BloomFilter nHashFuncs. + * @member {number} nHashFuncs + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @instance + */ + BloomFilter.prototype.nHashFuncs = 0; + + /** + * BloomFilter nTweak. + * @member {number} nTweak + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @instance + */ + BloomFilter.prototype.nTweak = 0; + + /** + * BloomFilter nFlags. + * @member {number} nFlags + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @instance + */ + BloomFilter.prototype.nFlags = 0; + + /** + * Creates a new BloomFilter instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @static + * @param {org.dash.platform.dapi.v0.IBloomFilter=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BloomFilter} BloomFilter instance + */ + BloomFilter.create = function create(properties) { + return new BloomFilter(properties); + }; + + /** + * Encodes the specified BloomFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.BloomFilter.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @static + * @param {org.dash.platform.dapi.v0.IBloomFilter} message BloomFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BloomFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vData != null && Object.hasOwnProperty.call(message, "vData")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.vData); + if (message.nHashFuncs != null && Object.hasOwnProperty.call(message, "nHashFuncs")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.nHashFuncs); + if (message.nTweak != null && Object.hasOwnProperty.call(message, "nTweak")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.nTweak); + if (message.nFlags != null && Object.hasOwnProperty.call(message, "nFlags")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.nFlags); + return writer; + }; + + /** + * Encodes the specified BloomFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BloomFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @static + * @param {org.dash.platform.dapi.v0.IBloomFilter} message BloomFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BloomFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BloomFilter message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BloomFilter} BloomFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BloomFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BloomFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vData = reader.bytes(); + break; + case 2: + message.nHashFuncs = reader.uint32(); + break; + case 3: + message.nTweak = reader.uint32(); + break; + case 4: + message.nFlags = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BloomFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BloomFilter} BloomFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BloomFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BloomFilter message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BloomFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vData != null && message.hasOwnProperty("vData")) + if (!(message.vData && typeof message.vData.length === "number" || $util.isString(message.vData))) + return "vData: buffer expected"; + if (message.nHashFuncs != null && message.hasOwnProperty("nHashFuncs")) + if (!$util.isInteger(message.nHashFuncs)) + return "nHashFuncs: integer expected"; + if (message.nTweak != null && message.hasOwnProperty("nTweak")) + if (!$util.isInteger(message.nTweak)) + return "nTweak: integer expected"; + if (message.nFlags != null && message.hasOwnProperty("nFlags")) + if (!$util.isInteger(message.nFlags)) + return "nFlags: integer expected"; + return null; + }; + + /** + * Creates a BloomFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BloomFilter} BloomFilter + */ + BloomFilter.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BloomFilter) + return object; + var message = new $root.org.dash.platform.dapi.v0.BloomFilter(); + if (object.vData != null) + if (typeof object.vData === "string") + $util.base64.decode(object.vData, message.vData = $util.newBuffer($util.base64.length(object.vData)), 0); + else if (object.vData.length >= 0) + message.vData = object.vData; + if (object.nHashFuncs != null) + message.nHashFuncs = object.nHashFuncs >>> 0; + if (object.nTweak != null) + message.nTweak = object.nTweak >>> 0; + if (object.nFlags != null) + message.nFlags = object.nFlags >>> 0; + return message; + }; + + /** + * Creates a plain object from a BloomFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @static + * @param {org.dash.platform.dapi.v0.BloomFilter} message BloomFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BloomFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.vData = ""; + else { + object.vData = []; + if (options.bytes !== Array) + object.vData = $util.newBuffer(object.vData); + } + object.nHashFuncs = 0; + object.nTweak = 0; + object.nFlags = 0; + } + if (message.vData != null && message.hasOwnProperty("vData")) + object.vData = options.bytes === String ? $util.base64.encode(message.vData, 0, message.vData.length) : options.bytes === Array ? Array.prototype.slice.call(message.vData) : message.vData; + if (message.nHashFuncs != null && message.hasOwnProperty("nHashFuncs")) + object.nHashFuncs = message.nHashFuncs; + if (message.nTweak != null && message.hasOwnProperty("nTweak")) + object.nTweak = message.nTweak; + if (message.nFlags != null && message.hasOwnProperty("nFlags")) + object.nFlags = message.nFlags; + return object; + }; + + /** + * Converts this BloomFilter to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BloomFilter + * @instance + * @returns {Object.} JSON object + */ + BloomFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BloomFilter; + })(); + + v0.TransactionsWithProofsResponse = (function() { + + /** + * Properties of a TransactionsWithProofsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface ITransactionsWithProofsResponse + * @property {org.dash.platform.dapi.v0.IRawTransactions|null} [rawTransactions] TransactionsWithProofsResponse rawTransactions + * @property {org.dash.platform.dapi.v0.IInstantSendLockMessages|null} [instantSendLockMessages] TransactionsWithProofsResponse instantSendLockMessages + * @property {Uint8Array|null} [rawMerkleBlock] TransactionsWithProofsResponse rawMerkleBlock + */ + + /** + * Constructs a new TransactionsWithProofsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a TransactionsWithProofsResponse. + * @implements ITransactionsWithProofsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsResponse=} [properties] Properties to set + */ + function TransactionsWithProofsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionsWithProofsResponse rawTransactions. + * @member {org.dash.platform.dapi.v0.IRawTransactions|null|undefined} rawTransactions + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @instance + */ + TransactionsWithProofsResponse.prototype.rawTransactions = null; + + /** + * TransactionsWithProofsResponse instantSendLockMessages. + * @member {org.dash.platform.dapi.v0.IInstantSendLockMessages|null|undefined} instantSendLockMessages + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @instance + */ + TransactionsWithProofsResponse.prototype.instantSendLockMessages = null; + + /** + * TransactionsWithProofsResponse rawMerkleBlock. + * @member {Uint8Array} rawMerkleBlock + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @instance + */ + TransactionsWithProofsResponse.prototype.rawMerkleBlock = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionsWithProofsResponse responses. + * @member {"rawTransactions"|"instantSendLockMessages"|"rawMerkleBlock"|undefined} responses + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @instance + */ + Object.defineProperty(TransactionsWithProofsResponse.prototype, "responses", { + get: $util.oneOfGetter($oneOfFields = ["rawTransactions", "instantSendLockMessages", "rawMerkleBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionsWithProofsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @static + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} TransactionsWithProofsResponse instance + */ + TransactionsWithProofsResponse.create = function create(properties) { + return new TransactionsWithProofsResponse(properties); + }; + + /** + * Encodes the specified TransactionsWithProofsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.TransactionsWithProofsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @static + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsResponse} message TransactionsWithProofsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionsWithProofsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rawTransactions != null && Object.hasOwnProperty.call(message, "rawTransactions")) + $root.org.dash.platform.dapi.v0.RawTransactions.encode(message.rawTransactions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instantSendLockMessages != null && Object.hasOwnProperty.call(message, "instantSendLockMessages")) + $root.org.dash.platform.dapi.v0.InstantSendLockMessages.encode(message.instantSendLockMessages, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rawMerkleBlock != null && Object.hasOwnProperty.call(message, "rawMerkleBlock")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.rawMerkleBlock); + return writer; + }; + + /** + * Encodes the specified TransactionsWithProofsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.TransactionsWithProofsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @static + * @param {org.dash.platform.dapi.v0.ITransactionsWithProofsResponse} message TransactionsWithProofsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionsWithProofsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionsWithProofsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} TransactionsWithProofsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionsWithProofsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.TransactionsWithProofsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rawTransactions = $root.org.dash.platform.dapi.v0.RawTransactions.decode(reader, reader.uint32()); + break; + case 2: + message.instantSendLockMessages = $root.org.dash.platform.dapi.v0.InstantSendLockMessages.decode(reader, reader.uint32()); + break; + case 3: + message.rawMerkleBlock = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionsWithProofsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} TransactionsWithProofsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionsWithProofsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionsWithProofsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionsWithProofsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rawTransactions != null && message.hasOwnProperty("rawTransactions")) { + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.RawTransactions.verify(message.rawTransactions); + if (error) + return "rawTransactions." + error; + } + } + if (message.instantSendLockMessages != null && message.hasOwnProperty("instantSendLockMessages")) { + if (properties.responses === 1) + return "responses: multiple values"; + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.InstantSendLockMessages.verify(message.instantSendLockMessages); + if (error) + return "instantSendLockMessages." + error; + } + } + if (message.rawMerkleBlock != null && message.hasOwnProperty("rawMerkleBlock")) { + if (properties.responses === 1) + return "responses: multiple values"; + properties.responses = 1; + if (!(message.rawMerkleBlock && typeof message.rawMerkleBlock.length === "number" || $util.isString(message.rawMerkleBlock))) + return "rawMerkleBlock: buffer expected"; + } + return null; + }; + + /** + * Creates a TransactionsWithProofsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} TransactionsWithProofsResponse + */ + TransactionsWithProofsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.TransactionsWithProofsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.TransactionsWithProofsResponse(); + if (object.rawTransactions != null) { + if (typeof object.rawTransactions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.TransactionsWithProofsResponse.rawTransactions: object expected"); + message.rawTransactions = $root.org.dash.platform.dapi.v0.RawTransactions.fromObject(object.rawTransactions); + } + if (object.instantSendLockMessages != null) { + if (typeof object.instantSendLockMessages !== "object") + throw TypeError(".org.dash.platform.dapi.v0.TransactionsWithProofsResponse.instantSendLockMessages: object expected"); + message.instantSendLockMessages = $root.org.dash.platform.dapi.v0.InstantSendLockMessages.fromObject(object.instantSendLockMessages); + } + if (object.rawMerkleBlock != null) + if (typeof object.rawMerkleBlock === "string") + $util.base64.decode(object.rawMerkleBlock, message.rawMerkleBlock = $util.newBuffer($util.base64.length(object.rawMerkleBlock)), 0); + else if (object.rawMerkleBlock.length >= 0) + message.rawMerkleBlock = object.rawMerkleBlock; + return message; + }; + + /** + * Creates a plain object from a TransactionsWithProofsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @static + * @param {org.dash.platform.dapi.v0.TransactionsWithProofsResponse} message TransactionsWithProofsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionsWithProofsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rawTransactions != null && message.hasOwnProperty("rawTransactions")) { + object.rawTransactions = $root.org.dash.platform.dapi.v0.RawTransactions.toObject(message.rawTransactions, options); + if (options.oneofs) + object.responses = "rawTransactions"; + } + if (message.instantSendLockMessages != null && message.hasOwnProperty("instantSendLockMessages")) { + object.instantSendLockMessages = $root.org.dash.platform.dapi.v0.InstantSendLockMessages.toObject(message.instantSendLockMessages, options); + if (options.oneofs) + object.responses = "instantSendLockMessages"; + } + if (message.rawMerkleBlock != null && message.hasOwnProperty("rawMerkleBlock")) { + object.rawMerkleBlock = options.bytes === String ? $util.base64.encode(message.rawMerkleBlock, 0, message.rawMerkleBlock.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawMerkleBlock) : message.rawMerkleBlock; + if (options.oneofs) + object.responses = "rawMerkleBlock"; + } + return object; + }; + + /** + * Converts this TransactionsWithProofsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.TransactionsWithProofsResponse + * @instance + * @returns {Object.} JSON object + */ + TransactionsWithProofsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TransactionsWithProofsResponse; + })(); + + v0.RawTransactions = (function() { + + /** + * Properties of a RawTransactions. + * @memberof org.dash.platform.dapi.v0 + * @interface IRawTransactions + * @property {Array.|null} [transactions] RawTransactions transactions + */ + + /** + * Constructs a new RawTransactions. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a RawTransactions. + * @implements IRawTransactions + * @constructor + * @param {org.dash.platform.dapi.v0.IRawTransactions=} [properties] Properties to set + */ + function RawTransactions(properties) { + this.transactions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RawTransactions transactions. + * @member {Array.} transactions + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @instance + */ + RawTransactions.prototype.transactions = $util.emptyArray; + + /** + * Creates a new RawTransactions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @static + * @param {org.dash.platform.dapi.v0.IRawTransactions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.RawTransactions} RawTransactions instance + */ + RawTransactions.create = function create(properties) { + return new RawTransactions(properties); + }; + + /** + * Encodes the specified RawTransactions message. Does not implicitly {@link org.dash.platform.dapi.v0.RawTransactions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @static + * @param {org.dash.platform.dapi.v0.IRawTransactions} message RawTransactions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawTransactions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transactions != null && message.transactions.length) + for (var i = 0; i < message.transactions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transactions[i]); + return writer; + }; + + /** + * Encodes the specified RawTransactions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.RawTransactions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @static + * @param {org.dash.platform.dapi.v0.IRawTransactions} message RawTransactions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawTransactions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawTransactions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.RawTransactions} RawTransactions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawTransactions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.RawTransactions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.transactions && message.transactions.length)) + message.transactions = []; + message.transactions.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawTransactions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.RawTransactions} RawTransactions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawTransactions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawTransactions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawTransactions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transactions != null && message.hasOwnProperty("transactions")) { + if (!Array.isArray(message.transactions)) + return "transactions: array expected"; + for (var i = 0; i < message.transactions.length; ++i) + if (!(message.transactions[i] && typeof message.transactions[i].length === "number" || $util.isString(message.transactions[i]))) + return "transactions: buffer[] expected"; + } + return null; + }; + + /** + * Creates a RawTransactions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.RawTransactions} RawTransactions + */ + RawTransactions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.RawTransactions) + return object; + var message = new $root.org.dash.platform.dapi.v0.RawTransactions(); + if (object.transactions) { + if (!Array.isArray(object.transactions)) + throw TypeError(".org.dash.platform.dapi.v0.RawTransactions.transactions: array expected"); + message.transactions = []; + for (var i = 0; i < object.transactions.length; ++i) + if (typeof object.transactions[i] === "string") + $util.base64.decode(object.transactions[i], message.transactions[i] = $util.newBuffer($util.base64.length(object.transactions[i])), 0); + else if (object.transactions[i].length >= 0) + message.transactions[i] = object.transactions[i]; + } + return message; + }; + + /** + * Creates a plain object from a RawTransactions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @static + * @param {org.dash.platform.dapi.v0.RawTransactions} message RawTransactions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawTransactions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transactions = []; + if (message.transactions && message.transactions.length) { + object.transactions = []; + for (var j = 0; j < message.transactions.length; ++j) + object.transactions[j] = options.bytes === String ? $util.base64.encode(message.transactions[j], 0, message.transactions[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.transactions[j]) : message.transactions[j]; + } + return object; + }; + + /** + * Converts this RawTransactions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.RawTransactions + * @instance + * @returns {Object.} JSON object + */ + RawTransactions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RawTransactions; + })(); + + v0.InstantSendLockMessages = (function() { + + /** + * Properties of an InstantSendLockMessages. + * @memberof org.dash.platform.dapi.v0 + * @interface IInstantSendLockMessages + * @property {Array.|null} [messages] InstantSendLockMessages messages + */ + + /** + * Constructs a new InstantSendLockMessages. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents an InstantSendLockMessages. + * @implements IInstantSendLockMessages + * @constructor + * @param {org.dash.platform.dapi.v0.IInstantSendLockMessages=} [properties] Properties to set + */ + function InstantSendLockMessages(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstantSendLockMessages messages. + * @member {Array.} messages + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @instance + */ + InstantSendLockMessages.prototype.messages = $util.emptyArray; + + /** + * Creates a new InstantSendLockMessages instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @static + * @param {org.dash.platform.dapi.v0.IInstantSendLockMessages=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.InstantSendLockMessages} InstantSendLockMessages instance + */ + InstantSendLockMessages.create = function create(properties) { + return new InstantSendLockMessages(properties); + }; + + /** + * Encodes the specified InstantSendLockMessages message. Does not implicitly {@link org.dash.platform.dapi.v0.InstantSendLockMessages.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @static + * @param {org.dash.platform.dapi.v0.IInstantSendLockMessages} message InstantSendLockMessages message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstantSendLockMessages.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.messages[i]); + return writer; + }; + + /** + * Encodes the specified InstantSendLockMessages message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.InstantSendLockMessages.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @static + * @param {org.dash.platform.dapi.v0.IInstantSendLockMessages} message InstantSendLockMessages message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstantSendLockMessages.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstantSendLockMessages message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.InstantSendLockMessages} InstantSendLockMessages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstantSendLockMessages.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.InstantSendLockMessages(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstantSendLockMessages message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.InstantSendLockMessages} InstantSendLockMessages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstantSendLockMessages.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstantSendLockMessages message. + * @function verify + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstantSendLockMessages.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) + if (!(message.messages[i] && typeof message.messages[i].length === "number" || $util.isString(message.messages[i]))) + return "messages: buffer[] expected"; + } + return null; + }; + + /** + * Creates an InstantSendLockMessages message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.InstantSendLockMessages} InstantSendLockMessages + */ + InstantSendLockMessages.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.InstantSendLockMessages) + return object; + var message = new $root.org.dash.platform.dapi.v0.InstantSendLockMessages(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".org.dash.platform.dapi.v0.InstantSendLockMessages.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) + if (typeof object.messages[i] === "string") + $util.base64.decode(object.messages[i], message.messages[i] = $util.newBuffer($util.base64.length(object.messages[i])), 0); + else if (object.messages[i].length >= 0) + message.messages[i] = object.messages[i]; + } + return message; + }; + + /** + * Creates a plain object from an InstantSendLockMessages message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @static + * @param {org.dash.platform.dapi.v0.InstantSendLockMessages} message InstantSendLockMessages + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstantSendLockMessages.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = options.bytes === String ? $util.base64.encode(message.messages[j], 0, message.messages[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.messages[j]) : message.messages[j]; + } + return object; + }; + + /** + * Converts this InstantSendLockMessages to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.InstantSendLockMessages + * @instance + * @returns {Object.} JSON object + */ + InstantSendLockMessages.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstantSendLockMessages; + })(); + + v0.MasternodeListRequest = (function() { + + /** + * Properties of a MasternodeListRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IMasternodeListRequest + */ + + /** + * Constructs a new MasternodeListRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a MasternodeListRequest. + * @implements IMasternodeListRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IMasternodeListRequest=} [properties] Properties to set + */ + function MasternodeListRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new MasternodeListRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @static + * @param {org.dash.platform.dapi.v0.IMasternodeListRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.MasternodeListRequest} MasternodeListRequest instance + */ + MasternodeListRequest.create = function create(properties) { + return new MasternodeListRequest(properties); + }; + + /** + * Encodes the specified MasternodeListRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.MasternodeListRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @static + * @param {org.dash.platform.dapi.v0.IMasternodeListRequest} message MasternodeListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MasternodeListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MasternodeListRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.MasternodeListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @static + * @param {org.dash.platform.dapi.v0.IMasternodeListRequest} message MasternodeListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MasternodeListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MasternodeListRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.MasternodeListRequest} MasternodeListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MasternodeListRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.MasternodeListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MasternodeListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.MasternodeListRequest} MasternodeListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MasternodeListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MasternodeListRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MasternodeListRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MasternodeListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.MasternodeListRequest} MasternodeListRequest + */ + MasternodeListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.MasternodeListRequest) + return object; + return new $root.org.dash.platform.dapi.v0.MasternodeListRequest(); + }; + + /** + * Creates a plain object from a MasternodeListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @static + * @param {org.dash.platform.dapi.v0.MasternodeListRequest} message MasternodeListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MasternodeListRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MasternodeListRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.MasternodeListRequest + * @instance + * @returns {Object.} JSON object + */ + MasternodeListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MasternodeListRequest; + })(); + + v0.MasternodeListResponse = (function() { + + /** + * Properties of a MasternodeListResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IMasternodeListResponse + * @property {Uint8Array|null} [masternodeListDiff] MasternodeListResponse masternodeListDiff + */ + + /** + * Constructs a new MasternodeListResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a MasternodeListResponse. + * @implements IMasternodeListResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IMasternodeListResponse=} [properties] Properties to set + */ + function MasternodeListResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MasternodeListResponse masternodeListDiff. + * @member {Uint8Array} masternodeListDiff + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @instance + */ + MasternodeListResponse.prototype.masternodeListDiff = $util.newBuffer([]); + + /** + * Creates a new MasternodeListResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @static + * @param {org.dash.platform.dapi.v0.IMasternodeListResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.MasternodeListResponse} MasternodeListResponse instance + */ + MasternodeListResponse.create = function create(properties) { + return new MasternodeListResponse(properties); + }; + + /** + * Encodes the specified MasternodeListResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.MasternodeListResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @static + * @param {org.dash.platform.dapi.v0.IMasternodeListResponse} message MasternodeListResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MasternodeListResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.masternodeListDiff != null && Object.hasOwnProperty.call(message, "masternodeListDiff")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.masternodeListDiff); + return writer; + }; + + /** + * Encodes the specified MasternodeListResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.MasternodeListResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @static + * @param {org.dash.platform.dapi.v0.IMasternodeListResponse} message MasternodeListResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MasternodeListResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MasternodeListResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.MasternodeListResponse} MasternodeListResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MasternodeListResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.MasternodeListResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.masternodeListDiff = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MasternodeListResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.MasternodeListResponse} MasternodeListResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MasternodeListResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MasternodeListResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MasternodeListResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.masternodeListDiff != null && message.hasOwnProperty("masternodeListDiff")) + if (!(message.masternodeListDiff && typeof message.masternodeListDiff.length === "number" || $util.isString(message.masternodeListDiff))) + return "masternodeListDiff: buffer expected"; + return null; + }; + + /** + * Creates a MasternodeListResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.MasternodeListResponse} MasternodeListResponse + */ + MasternodeListResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.MasternodeListResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.MasternodeListResponse(); + if (object.masternodeListDiff != null) + if (typeof object.masternodeListDiff === "string") + $util.base64.decode(object.masternodeListDiff, message.masternodeListDiff = $util.newBuffer($util.base64.length(object.masternodeListDiff)), 0); + else if (object.masternodeListDiff.length >= 0) + message.masternodeListDiff = object.masternodeListDiff; + return message; + }; + + /** + * Creates a plain object from a MasternodeListResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @static + * @param {org.dash.platform.dapi.v0.MasternodeListResponse} message MasternodeListResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MasternodeListResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.masternodeListDiff = ""; + else { + object.masternodeListDiff = []; + if (options.bytes !== Array) + object.masternodeListDiff = $util.newBuffer(object.masternodeListDiff); + } + if (message.masternodeListDiff != null && message.hasOwnProperty("masternodeListDiff")) + object.masternodeListDiff = options.bytes === String ? $util.base64.encode(message.masternodeListDiff, 0, message.masternodeListDiff.length) : options.bytes === Array ? Array.prototype.slice.call(message.masternodeListDiff) : message.masternodeListDiff; + return object; + }; + + /** + * Converts this MasternodeListResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.MasternodeListResponse + * @instance + * @returns {Object.} JSON object + */ + MasternodeListResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MasternodeListResponse; + })(); + + return v0; + })(); + + return dapi; + })(); + + return platform; + })(); + + return dash; + })(); + + return org; +})(); + module.exports = $root; diff --git a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js index dfbcb436b02..c49cd692e34 100644 --- a/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js +++ b/packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js @@ -9,4 +9,71118 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut // Exported root namespace var $root = $protobuf.roots.platform_root || ($protobuf.roots.platform_root = {}); +$root.org = (function() { + + /** + * Namespace org. + * @exports org + * @namespace + */ + var org = {}; + + org.dash = (function() { + + /** + * Namespace dash. + * @memberof org + * @namespace + */ + var dash = {}; + + dash.platform = (function() { + + /** + * Namespace platform. + * @memberof org.dash + * @namespace + */ + var platform = {}; + + platform.drive = (function() { + + /** + * Namespace drive. + * @memberof org.dash.platform + * @namespace + */ + var drive = {}; + + drive.v0 = (function() { + + /** + * Namespace v0. + * @memberof org.dash.platform.drive + * @namespace + */ + var v0 = {}; + + v0.DriveInternal = (function() { + + /** + * Constructs a new DriveInternal service. + * @memberof org.dash.platform.drive.v0 + * @classdesc Represents a DriveInternal + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function DriveInternal(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DriveInternal.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DriveInternal; + + /** + * Creates new DriveInternal service using the specified rpc implementation. + * @function create + * @memberof org.dash.platform.drive.v0.DriveInternal + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {DriveInternal} RPC service. Useful where requests and/or responses are streamed. + */ + DriveInternal.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link org.dash.platform.drive.v0.DriveInternal#getProofs}. + * @memberof org.dash.platform.drive.v0.DriveInternal + * @typedef getProofsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.drive.v0.GetProofsResponse} [response] GetProofsResponse + */ + + /** + * Calls getProofs. + * @function getProofs + * @memberof org.dash.platform.drive.v0.DriveInternal + * @instance + * @param {org.dash.platform.drive.v0.IGetProofsRequest} request GetProofsRequest message or plain object + * @param {org.dash.platform.drive.v0.DriveInternal.getProofsCallback} callback Node-style callback called with the error, if any, and GetProofsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DriveInternal.prototype.getProofs = function getProofs(request, callback) { + return this.rpcCall(getProofs, $root.org.dash.platform.drive.v0.GetProofsRequest, $root.org.dash.platform.drive.v0.GetProofsResponse, request, callback); + }, "name", { value: "getProofs" }); + + /** + * Calls getProofs. + * @function getProofs + * @memberof org.dash.platform.drive.v0.DriveInternal + * @instance + * @param {org.dash.platform.drive.v0.IGetProofsRequest} request GetProofsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DriveInternal; + })(); + + v0.GetProofsRequest = (function() { + + /** + * Properties of a GetProofsRequest. + * @memberof org.dash.platform.drive.v0 + * @interface IGetProofsRequest + * @property {Uint8Array|null} [stateTransition] GetProofsRequest stateTransition + */ + + /** + * Constructs a new GetProofsRequest. + * @memberof org.dash.platform.drive.v0 + * @classdesc Represents a GetProofsRequest. + * @implements IGetProofsRequest + * @constructor + * @param {org.dash.platform.drive.v0.IGetProofsRequest=} [properties] Properties to set + */ + function GetProofsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProofsRequest stateTransition. + * @member {Uint8Array} stateTransition + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @instance + */ + GetProofsRequest.prototype.stateTransition = $util.newBuffer([]); + + /** + * Creates a new GetProofsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {org.dash.platform.drive.v0.IGetProofsRequest=} [properties] Properties to set + * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest instance + */ + GetProofsRequest.create = function create(properties) { + return new GetProofsRequest(properties); + }; + + /** + * Encodes the specified GetProofsRequest message. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {org.dash.platform.drive.v0.IGetProofsRequest} message GetProofsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProofsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransition); + return writer; + }; + + /** + * Encodes the specified GetProofsRequest message, length delimited. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {org.dash.platform.drive.v0.IGetProofsRequest} message GetProofsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProofsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProofsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProofsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.drive.v0.GetProofsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransition = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProofsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProofsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProofsRequest message. + * @function verify + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProofsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) + return "stateTransition: buffer expected"; + return null; + }; + + /** + * Creates a GetProofsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.drive.v0.GetProofsRequest} GetProofsRequest + */ + GetProofsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.drive.v0.GetProofsRequest) + return object; + var message = new $root.org.dash.platform.drive.v0.GetProofsRequest(); + if (object.stateTransition != null) + if (typeof object.stateTransition === "string") + $util.base64.decode(object.stateTransition, message.stateTransition = $util.newBuffer($util.base64.length(object.stateTransition)), 0); + else if (object.stateTransition.length >= 0) + message.stateTransition = object.stateTransition; + return message; + }; + + /** + * Creates a plain object from a GetProofsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @static + * @param {org.dash.platform.drive.v0.GetProofsRequest} message GetProofsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProofsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.stateTransition = ""; + else { + object.stateTransition = []; + if (options.bytes !== Array) + object.stateTransition = $util.newBuffer(object.stateTransition); + } + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + object.stateTransition = options.bytes === String ? $util.base64.encode(message.stateTransition, 0, message.stateTransition.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransition) : message.stateTransition; + return object; + }; + + /** + * Converts this GetProofsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.drive.v0.GetProofsRequest + * @instance + * @returns {Object.} JSON object + */ + GetProofsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProofsRequest; + })(); + + v0.GetProofsResponse = (function() { + + /** + * Properties of a GetProofsResponse. + * @memberof org.dash.platform.drive.v0 + * @interface IGetProofsResponse + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProofsResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProofsResponse metadata + */ + + /** + * Constructs a new GetProofsResponse. + * @memberof org.dash.platform.drive.v0 + * @classdesc Represents a GetProofsResponse. + * @implements IGetProofsResponse + * @constructor + * @param {org.dash.platform.drive.v0.IGetProofsResponse=} [properties] Properties to set + */ + function GetProofsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProofsResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @instance + */ + GetProofsResponse.prototype.proof = null; + + /** + * GetProofsResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @instance + */ + GetProofsResponse.prototype.metadata = null; + + /** + * Creates a new GetProofsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {org.dash.platform.drive.v0.IGetProofsResponse=} [properties] Properties to set + * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse instance + */ + GetProofsResponse.create = function create(properties) { + return new GetProofsResponse(properties); + }; + + /** + * Encodes the specified GetProofsResponse message. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {org.dash.platform.drive.v0.IGetProofsResponse} message GetProofsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProofsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProofsResponse message, length delimited. Does not implicitly {@link org.dash.platform.drive.v0.GetProofsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {org.dash.platform.drive.v0.IGetProofsResponse} message GetProofsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProofsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProofsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProofsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.drive.v0.GetProofsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 2: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProofsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProofsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProofsResponse message. + * @function verify + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProofsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetProofsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.drive.v0.GetProofsResponse} GetProofsResponse + */ + GetProofsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.drive.v0.GetProofsResponse) + return object; + var message = new $root.org.dash.platform.drive.v0.GetProofsResponse(); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.drive.v0.GetProofsResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.drive.v0.GetProofsResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetProofsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @static + * @param {org.dash.platform.drive.v0.GetProofsResponse} message GetProofsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProofsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.proof = null; + object.metadata = null; + } + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetProofsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.drive.v0.GetProofsResponse + * @instance + * @returns {Object.} JSON object + */ + GetProofsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProofsResponse; + })(); + + return v0; + })(); + + return drive; + })(); + + platform.dapi = (function() { + + /** + * Namespace dapi. + * @memberof org.dash.platform + * @namespace + */ + var dapi = {}; + + dapi.v0 = (function() { + + /** + * Namespace v0. + * @memberof org.dash.platform.dapi + * @namespace + */ + var v0 = {}; + + v0.Platform = (function() { + + /** + * Constructs a new Platform service. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a Platform + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Platform(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Platform.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Platform; + + /** + * Creates new Platform service using the specified rpc implementation. + * @function create + * @memberof org.dash.platform.dapi.v0.Platform + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Platform} RPC service. Useful where requests and/or responses are streamed. + */ + Platform.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#broadcastStateTransition}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef broadcastStateTransitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} [response] BroadcastStateTransitionResponse + */ + + /** + * Calls broadcastStateTransition. + * @function broadcastStateTransition + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.broadcastStateTransitionCallback} callback Node-style callback called with the error, if any, and BroadcastStateTransitionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.broadcastStateTransition = function broadcastStateTransition(request, callback) { + return this.rpcCall(broadcastStateTransition, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse, request, callback); + }, "name", { value: "broadcastStateTransition" }); + + /** + * Calls broadcastStateTransition. + * @function broadcastStateTransition + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentity}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityResponse} [response] GetIdentityResponse + */ + + /** + * Calls getIdentity. + * @function getIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityCallback} callback Node-style callback called with the error, if any, and GetIdentityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentity = function getIdentity(request, callback) { + return this.rpcCall(getIdentity, $root.org.dash.platform.dapi.v0.GetIdentityRequest, $root.org.dash.platform.dapi.v0.GetIdentityResponse, request, callback); + }, "name", { value: "getIdentity" }); + + /** + * Calls getIdentity. + * @function getIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityKeys}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} [response] GetIdentityKeysResponse + */ + + /** + * Calls getIdentityKeys. + * @function getIdentityKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityKeysCallback} callback Node-style callback called with the error, if any, and GetIdentityKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityKeys = function getIdentityKeys(request, callback) { + return this.rpcCall(getIdentityKeys, $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse, request, callback); + }, "name", { value: "getIdentityKeys" }); + + /** + * Calls getIdentityKeys. + * @function getIdentityKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesContractKeys}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesContractKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} [response] GetIdentitiesContractKeysResponse + */ + + /** + * Calls getIdentitiesContractKeys. + * @function getIdentitiesContractKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesContractKeysCallback} callback Node-style callback called with the error, if any, and GetIdentitiesContractKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesContractKeys = function getIdentitiesContractKeys(request, callback) { + return this.rpcCall(getIdentitiesContractKeys, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse, request, callback); + }, "name", { value: "getIdentitiesContractKeys" }); + + /** + * Calls getIdentitiesContractKeys. + * @function getIdentitiesContractKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityNonce}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityNonceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} [response] GetIdentityNonceResponse + */ + + /** + * Calls getIdentityNonce. + * @function getIdentityNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityNonceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityNonce = function getIdentityNonce(request, callback) { + return this.rpcCall(getIdentityNonce, $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse, request, callback); + }, "name", { value: "getIdentityNonce" }); + + /** + * Calls getIdentityNonce. + * @function getIdentityNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityContractNonce}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityContractNonceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} [response] GetIdentityContractNonceResponse + */ + + /** + * Calls getIdentityContractNonce. + * @function getIdentityContractNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityContractNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityContractNonceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityContractNonce = function getIdentityContractNonce(request, callback) { + return this.rpcCall(getIdentityContractNonce, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse, request, callback); + }, "name", { value: "getIdentityContractNonce" }); + + /** + * Calls getIdentityContractNonce. + * @function getIdentityContractNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalance}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityBalanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} [response] GetIdentityBalanceResponse + */ + + /** + * Calls getIdentityBalance. + * @function getIdentityBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityBalance = function getIdentityBalance(request, callback) { + return this.rpcCall(getIdentityBalance, $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse, request, callback); + }, "name", { value: "getIdentityBalance" }); + + /** + * Calls getIdentityBalance. + * @function getIdentityBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} [response] GetIdentitiesBalancesResponse + */ + + /** + * Calls getIdentitiesBalances. + * @function getIdentitiesBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesBalances = function getIdentitiesBalances(request, callback) { + return this.rpcCall(getIdentitiesBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse, request, callback); + }, "name", { value: "getIdentitiesBalances" }); + + /** + * Calls getIdentitiesBalances. + * @function getIdentitiesBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalanceAndRevision}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityBalanceAndRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} [response] GetIdentityBalanceAndRevisionResponse + */ + + /** + * Calls getIdentityBalanceAndRevision. + * @function getIdentityBalanceAndRevision + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceAndRevisionCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceAndRevisionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(request, callback) { + return this.rpcCall(getIdentityBalanceAndRevision, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse, request, callback); + }, "name", { value: "getIdentityBalanceAndRevision" }); + + /** + * Calls getIdentityBalanceAndRevision. + * @function getIdentityBalanceAndRevision + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByIds}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEvonodesProposedEpochBlocksByIdsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse + */ + + /** + * Calls getEvonodesProposedEpochBlocksByIds. + * @function getEvonodesProposedEpochBlocksByIds + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByIdsCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByIds = function getEvonodesProposedEpochBlocksByIds(request, callback) { + return this.rpcCall(getEvonodesProposedEpochBlocksByIds, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); + }, "name", { value: "getEvonodesProposedEpochBlocksByIds" }); + + /** + * Calls getEvonodesProposedEpochBlocksByIds. + * @function getEvonodesProposedEpochBlocksByIds + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByRange}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEvonodesProposedEpochBlocksByRangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse + */ + + /** + * Calls getEvonodesProposedEpochBlocksByRange. + * @function getEvonodesProposedEpochBlocksByRange + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByRangeCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByRange = function getEvonodesProposedEpochBlocksByRange(request, callback) { + return this.rpcCall(getEvonodesProposedEpochBlocksByRange, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); + }, "name", { value: "getEvonodesProposedEpochBlocksByRange" }); + + /** + * Calls getEvonodesProposedEpochBlocksByRange. + * @function getEvonodesProposedEpochBlocksByRange + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContract}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractResponse} [response] GetDataContractResponse + */ + + /** + * Calls getDataContract. + * @function getDataContract + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractCallback} callback Node-style callback called with the error, if any, and GetDataContractResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContract = function getDataContract(request, callback) { + return this.rpcCall(getDataContract, $root.org.dash.platform.dapi.v0.GetDataContractRequest, $root.org.dash.platform.dapi.v0.GetDataContractResponse, request, callback); + }, "name", { value: "getDataContract" }); + + /** + * Calls getDataContract. + * @function getDataContract + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContractHistory}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} [response] GetDataContractHistoryResponse + */ + + /** + * Calls getDataContractHistory. + * @function getDataContractHistory + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractHistoryCallback} callback Node-style callback called with the error, if any, and GetDataContractHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContractHistory = function getDataContractHistory(request, callback) { + return this.rpcCall(getDataContractHistory, $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest, $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse, request, callback); + }, "name", { value: "getDataContractHistory" }); + + /** + * Calls getDataContractHistory. + * @function getDataContractHistory + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContracts}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} [response] GetDataContractsResponse + */ + + /** + * Calls getDataContracts. + * @function getDataContracts + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractsCallback} callback Node-style callback called with the error, if any, and GetDataContractsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContracts = function getDataContracts(request, callback) { + return this.rpcCall(getDataContracts, $root.org.dash.platform.dapi.v0.GetDataContractsRequest, $root.org.dash.platform.dapi.v0.GetDataContractsResponse, request, callback); + }, "name", { value: "getDataContracts" }); + + /** + * Calls getDataContracts. + * @function getDataContracts + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDocuments}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} [response] GetDocumentsResponse + */ + + /** + * Calls getDocuments. + * @function getDocuments + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDocumentsCallback} callback Node-style callback called with the error, if any, and GetDocumentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDocuments = function getDocuments(request, callback) { + return this.rpcCall(getDocuments, $root.org.dash.platform.dapi.v0.GetDocumentsRequest, $root.org.dash.platform.dapi.v0.GetDocumentsResponse, request, callback); + }, "name", { value: "getDocuments" }); + + /** + * Calls getDocuments. + * @function getDocuments + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityByPublicKeyHash}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityByPublicKeyHashCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} [response] GetIdentityByPublicKeyHashResponse + */ + + /** + * Calls getIdentityByPublicKeyHash. + * @function getIdentityByPublicKeyHash + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHashCallback} callback Node-style callback called with the error, if any, and GetIdentityByPublicKeyHashResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityByPublicKeyHash = function getIdentityByPublicKeyHash(request, callback) { + return this.rpcCall(getIdentityByPublicKeyHash, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse, request, callback); + }, "name", { value: "getIdentityByPublicKeyHash" }); + + /** + * Calls getIdentityByPublicKeyHash. + * @function getIdentityByPublicKeyHash + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#waitForStateTransitionResult}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef waitForStateTransitionResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} [response] WaitForStateTransitionResultResponse + */ + + /** + * Calls waitForStateTransitionResult. + * @function waitForStateTransitionResult + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.waitForStateTransitionResultCallback} callback Node-style callback called with the error, if any, and WaitForStateTransitionResultResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.waitForStateTransitionResult = function waitForStateTransitionResult(request, callback) { + return this.rpcCall(waitForStateTransitionResult, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, request, callback); + }, "name", { value: "waitForStateTransitionResult" }); + + /** + * Calls waitForStateTransitionResult. + * @function waitForStateTransitionResult + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getConsensusParams}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getConsensusParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} [response] GetConsensusParamsResponse + */ + + /** + * Calls getConsensusParams. + * @function getConsensusParams + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getConsensusParamsCallback} callback Node-style callback called with the error, if any, and GetConsensusParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getConsensusParams = function getConsensusParams(request, callback) { + return this.rpcCall(getConsensusParams, $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest, $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse, request, callback); + }, "name", { value: "getConsensusParams" }); + + /** + * Calls getConsensusParams. + * @function getConsensusParams + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeState}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getProtocolVersionUpgradeStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} [response] GetProtocolVersionUpgradeStateResponse + */ + + /** + * Calls getProtocolVersionUpgradeState. + * @function getProtocolVersionUpgradeState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeStateCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeState = function getProtocolVersionUpgradeState(request, callback) { + return this.rpcCall(getProtocolVersionUpgradeState, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse, request, callback); + }, "name", { value: "getProtocolVersionUpgradeState" }); + + /** + * Calls getProtocolVersionUpgradeState. + * @function getProtocolVersionUpgradeState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeVoteStatus}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getProtocolVersionUpgradeVoteStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} [response] GetProtocolVersionUpgradeVoteStatusResponse + */ + + /** + * Calls getProtocolVersionUpgradeVoteStatus. + * @function getProtocolVersionUpgradeVoteStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeVoteStatusCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeVoteStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeVoteStatus = function getProtocolVersionUpgradeVoteStatus(request, callback) { + return this.rpcCall(getProtocolVersionUpgradeVoteStatus, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse, request, callback); + }, "name", { value: "getProtocolVersionUpgradeVoteStatus" }); + + /** + * Calls getProtocolVersionUpgradeVoteStatus. + * @function getProtocolVersionUpgradeVoteStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEpochsInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEpochsInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} [response] GetEpochsInfoResponse + */ + + /** + * Calls getEpochsInfo. + * @function getEpochsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEpochsInfoCallback} callback Node-style callback called with the error, if any, and GetEpochsInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEpochsInfo = function getEpochsInfo(request, callback) { + return this.rpcCall(getEpochsInfo, $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest, $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse, request, callback); + }, "name", { value: "getEpochsInfo" }); + + /** + * Calls getEpochsInfo. + * @function getEpochsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResources}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} [response] GetContestedResourcesResponse + */ + + /** + * Calls getContestedResources. + * @function getContestedResources + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourcesCallback} callback Node-style callback called with the error, if any, and GetContestedResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResources = function getContestedResources(request, callback) { + return this.rpcCall(getContestedResources, $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse, request, callback); + }, "name", { value: "getContestedResources" }); + + /** + * Calls getContestedResources. + * @function getContestedResources + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVoteState}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceVoteStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} [response] GetContestedResourceVoteStateResponse + */ + + /** + * Calls getContestedResourceVoteState. + * @function getContestedResourceVoteState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVoteStateCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVoteStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceVoteState = function getContestedResourceVoteState(request, callback) { + return this.rpcCall(getContestedResourceVoteState, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse, request, callback); + }, "name", { value: "getContestedResourceVoteState" }); + + /** + * Calls getContestedResourceVoteState. + * @function getContestedResourceVoteState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVotersForIdentity}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceVotersForIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} [response] GetContestedResourceVotersForIdentityResponse + */ + + /** + * Calls getContestedResourceVotersForIdentity. + * @function getContestedResourceVotersForIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVotersForIdentityCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVotersForIdentityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceVotersForIdentity = function getContestedResourceVotersForIdentity(request, callback) { + return this.rpcCall(getContestedResourceVotersForIdentity, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse, request, callback); + }, "name", { value: "getContestedResourceVotersForIdentity" }); + + /** + * Calls getContestedResourceVotersForIdentity. + * @function getContestedResourceVotersForIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceIdentityVotes}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceIdentityVotesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} [response] GetContestedResourceIdentityVotesResponse + */ + + /** + * Calls getContestedResourceIdentityVotes. + * @function getContestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceIdentityVotesCallback} callback Node-style callback called with the error, if any, and GetContestedResourceIdentityVotesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceIdentityVotes = function getContestedResourceIdentityVotes(request, callback) { + return this.rpcCall(getContestedResourceIdentityVotes, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse, request, callback); + }, "name", { value: "getContestedResourceIdentityVotes" }); + + /** + * Calls getContestedResourceIdentityVotes. + * @function getContestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getVotePollsByEndDate}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getVotePollsByEndDateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} [response] GetVotePollsByEndDateResponse + */ + + /** + * Calls getVotePollsByEndDate. + * @function getVotePollsByEndDate + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getVotePollsByEndDateCallback} callback Node-style callback called with the error, if any, and GetVotePollsByEndDateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getVotePollsByEndDate = function getVotePollsByEndDate(request, callback) { + return this.rpcCall(getVotePollsByEndDate, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse, request, callback); + }, "name", { value: "getVotePollsByEndDate" }); + + /** + * Calls getVotePollsByEndDate. + * @function getVotePollsByEndDate + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPrefundedSpecializedBalance}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getPrefundedSpecializedBalanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} [response] GetPrefundedSpecializedBalanceResponse + */ + + /** + * Calls getPrefundedSpecializedBalance. + * @function getPrefundedSpecializedBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getPrefundedSpecializedBalanceCallback} callback Node-style callback called with the error, if any, and GetPrefundedSpecializedBalanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getPrefundedSpecializedBalance = function getPrefundedSpecializedBalance(request, callback) { + return this.rpcCall(getPrefundedSpecializedBalance, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse, request, callback); + }, "name", { value: "getPrefundedSpecializedBalance" }); + + /** + * Calls getPrefundedSpecializedBalance. + * @function getPrefundedSpecializedBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTotalCreditsInPlatform}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTotalCreditsInPlatformCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} [response] GetTotalCreditsInPlatformResponse + */ + + /** + * Calls getTotalCreditsInPlatform. + * @function getTotalCreditsInPlatform + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTotalCreditsInPlatformCallback} callback Node-style callback called with the error, if any, and GetTotalCreditsInPlatformResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTotalCreditsInPlatform = function getTotalCreditsInPlatform(request, callback) { + return this.rpcCall(getTotalCreditsInPlatform, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse, request, callback); + }, "name", { value: "getTotalCreditsInPlatform" }); + + /** + * Calls getTotalCreditsInPlatform. + * @function getTotalCreditsInPlatform + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPathElements}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getPathElementsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} [response] GetPathElementsResponse + */ + + /** + * Calls getPathElements. + * @function getPathElements + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getPathElementsCallback} callback Node-style callback called with the error, if any, and GetPathElementsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getPathElements = function getPathElements(request, callback) { + return this.rpcCall(getPathElements, $root.org.dash.platform.dapi.v0.GetPathElementsRequest, $root.org.dash.platform.dapi.v0.GetPathElementsResponse, request, callback); + }, "name", { value: "getPathElements" }); + + /** + * Calls getPathElements. + * @function getPathElements + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getStatus}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetStatusResponse} [response] GetStatusResponse + */ + + /** + * Calls getStatus. + * @function getStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getStatusCallback} callback Node-style callback called with the error, if any, and GetStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getStatus = function getStatus(request, callback) { + return this.rpcCall(getStatus, $root.org.dash.platform.dapi.v0.GetStatusRequest, $root.org.dash.platform.dapi.v0.GetStatusResponse, request, callback); + }, "name", { value: "getStatus" }); + + /** + * Calls getStatus. + * @function getStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getCurrentQuorumsInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getCurrentQuorumsInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} [response] GetCurrentQuorumsInfoResponse + */ + + /** + * Calls getCurrentQuorumsInfo. + * @function getCurrentQuorumsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfoCallback} callback Node-style callback called with the error, if any, and GetCurrentQuorumsInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(request, callback) { + return this.rpcCall(getCurrentQuorumsInfo, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse, request, callback); + }, "name", { value: "getCurrentQuorumsInfo" }); + + /** + * Calls getCurrentQuorumsInfo. + * @function getCurrentQuorumsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityTokenBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} [response] GetIdentityTokenBalancesResponse + */ + + /** + * Calls getIdentityTokenBalances. + * @function getIdentityTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityTokenBalances = function getIdentityTokenBalances(request, callback) { + return this.rpcCall(getIdentityTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse, request, callback); + }, "name", { value: "getIdentityTokenBalances" }); + + /** + * Calls getIdentityTokenBalances. + * @function getIdentityTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesTokenBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} [response] GetIdentitiesTokenBalancesResponse + */ + + /** + * Calls getIdentitiesTokenBalances. + * @function getIdentitiesTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesTokenBalances = function getIdentitiesTokenBalances(request, callback) { + return this.rpcCall(getIdentitiesTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse, request, callback); + }, "name", { value: "getIdentitiesTokenBalances" }); + + /** + * Calls getIdentitiesTokenBalances. + * @function getIdentitiesTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityTokenInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} [response] GetIdentityTokenInfosResponse + */ + + /** + * Calls getIdentityTokenInfos. + * @function getIdentityTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityTokenInfos = function getIdentityTokenInfos(request, callback) { + return this.rpcCall(getIdentityTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse, request, callback); + }, "name", { value: "getIdentityTokenInfos" }); + + /** + * Calls getIdentityTokenInfos. + * @function getIdentityTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesTokenInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} [response] GetIdentitiesTokenInfosResponse + */ + + /** + * Calls getIdentitiesTokenInfos. + * @function getIdentitiesTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesTokenInfos = function getIdentitiesTokenInfos(request, callback) { + return this.rpcCall(getIdentitiesTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse, request, callback); + }, "name", { value: "getIdentitiesTokenInfos" }); + + /** + * Calls getIdentitiesTokenInfos. + * @function getIdentitiesTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenStatuses}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenStatusesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} [response] GetTokenStatusesResponse + */ + + /** + * Calls getTokenStatuses. + * @function getTokenStatuses + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenStatusesCallback} callback Node-style callback called with the error, if any, and GetTokenStatusesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenStatuses = function getTokenStatuses(request, callback) { + return this.rpcCall(getTokenStatuses, $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest, $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse, request, callback); + }, "name", { value: "getTokenStatuses" }); + + /** + * Calls getTokenStatuses. + * @function getTokenStatuses + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenDirectPurchasePrices}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenDirectPurchasePricesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} [response] GetTokenDirectPurchasePricesResponse + */ + + /** + * Calls getTokenDirectPurchasePrices. + * @function getTokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenDirectPurchasePricesCallback} callback Node-style callback called with the error, if any, and GetTokenDirectPurchasePricesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenDirectPurchasePrices = function getTokenDirectPurchasePrices(request, callback) { + return this.rpcCall(getTokenDirectPurchasePrices, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, request, callback); + }, "name", { value: "getTokenDirectPurchasePrices" }); + + /** + * Calls getTokenDirectPurchasePrices. + * @function getTokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenPreProgrammedDistributions}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenPreProgrammedDistributionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} [response] GetTokenPreProgrammedDistributionsResponse + */ + + /** + * Calls getTokenPreProgrammedDistributions. + * @function getTokenPreProgrammedDistributions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributionsCallback} callback Node-style callback called with the error, if any, and GetTokenPreProgrammedDistributionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenPreProgrammedDistributions = function getTokenPreProgrammedDistributions(request, callback) { + return this.rpcCall(getTokenPreProgrammedDistributions, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse, request, callback); + }, "name", { value: "getTokenPreProgrammedDistributions" }); + + /** + * Calls getTokenPreProgrammedDistributions. + * @function getTokenPreProgrammedDistributions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenTotalSupply}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenTotalSupplyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} [response] GetTokenTotalSupplyResponse + */ + + /** + * Calls getTokenTotalSupply. + * @function getTokenTotalSupply + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenTotalSupplyCallback} callback Node-style callback called with the error, if any, and GetTokenTotalSupplyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenTotalSupply = function getTokenTotalSupply(request, callback) { + return this.rpcCall(getTokenTotalSupply, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse, request, callback); + }, "name", { value: "getTokenTotalSupply" }); + + /** + * Calls getTokenTotalSupply. + * @function getTokenTotalSupply + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} [response] GetGroupInfoResponse + */ + + /** + * Calls getGroupInfo. + * @function getGroupInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupInfoCallback} callback Node-style callback called with the error, if any, and GetGroupInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupInfo = function getGroupInfo(request, callback) { + return this.rpcCall(getGroupInfo, $root.org.dash.platform.dapi.v0.GetGroupInfoRequest, $root.org.dash.platform.dapi.v0.GetGroupInfoResponse, request, callback); + }, "name", { value: "getGroupInfo" }); + + /** + * Calls getGroupInfo. + * @function getGroupInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} [response] GetGroupInfosResponse + */ + + /** + * Calls getGroupInfos. + * @function getGroupInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupInfosCallback} callback Node-style callback called with the error, if any, and GetGroupInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupInfos = function getGroupInfos(request, callback) { + return this.rpcCall(getGroupInfos, $root.org.dash.platform.dapi.v0.GetGroupInfosRequest, $root.org.dash.platform.dapi.v0.GetGroupInfosResponse, request, callback); + }, "name", { value: "getGroupInfos" }); + + /** + * Calls getGroupInfos. + * @function getGroupInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActions}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupActionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} [response] GetGroupActionsResponse + */ + + /** + * Calls getGroupActions. + * @function getGroupActions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupActionsCallback} callback Node-style callback called with the error, if any, and GetGroupActionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupActions = function getGroupActions(request, callback) { + return this.rpcCall(getGroupActions, $root.org.dash.platform.dapi.v0.GetGroupActionsRequest, $root.org.dash.platform.dapi.v0.GetGroupActionsResponse, request, callback); + }, "name", { value: "getGroupActions" }); + + /** + * Calls getGroupActions. + * @function getGroupActions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActionSigners}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupActionSignersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} [response] GetGroupActionSignersResponse + */ + + /** + * Calls getGroupActionSigners. + * @function getGroupActionSigners + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupActionSignersCallback} callback Node-style callback called with the error, if any, and GetGroupActionSignersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupActionSigners = function getGroupActionSigners(request, callback) { + return this.rpcCall(getGroupActionSigners, $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest, $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse, request, callback); + }, "name", { value: "getGroupActionSigners" }); + + /** + * Calls getGroupActionSigners. + * @function getGroupActionSigners + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Platform; + })(); + + v0.Proof = (function() { + + /** + * Properties of a Proof. + * @memberof org.dash.platform.dapi.v0 + * @interface IProof + * @property {Uint8Array|null} [grovedbProof] Proof grovedbProof + * @property {Uint8Array|null} [quorumHash] Proof quorumHash + * @property {Uint8Array|null} [signature] Proof signature + * @property {number|null} [round] Proof round + * @property {Uint8Array|null} [blockIdHash] Proof blockIdHash + * @property {number|null} [quorumType] Proof quorumType + */ + + /** + * Constructs a new Proof. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a Proof. + * @implements IProof + * @constructor + * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set + */ + function Proof(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proof grovedbProof. + * @member {Uint8Array} grovedbProof + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.grovedbProof = $util.newBuffer([]); + + /** + * Proof quorumHash. + * @member {Uint8Array} quorumHash + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.quorumHash = $util.newBuffer([]); + + /** + * Proof signature. + * @member {Uint8Array} signature + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.signature = $util.newBuffer([]); + + /** + * Proof round. + * @member {number} round + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.round = 0; + + /** + * Proof blockIdHash. + * @member {Uint8Array} blockIdHash + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.blockIdHash = $util.newBuffer([]); + + /** + * Proof quorumType. + * @member {number} quorumType + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.quorumType = 0; + + /** + * Creates a new Proof instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.Proof} Proof instance + */ + Proof.create = function create(properties) { + return new Proof(properties); + }; + + /** + * Encodes the specified Proof message. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.grovedbProof != null && Object.hasOwnProperty.call(message, "grovedbProof")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.grovedbProof); + if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.quorumHash); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.round); + if (message.blockIdHash != null && Object.hasOwnProperty.call(message, "blockIdHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.blockIdHash); + if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.quorumType); + return writer; + }; + + /** + * Encodes the specified Proof message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proof message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.Proof(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grovedbProof = reader.bytes(); + break; + case 2: + message.quorumHash = reader.bytes(); + break; + case 3: + message.signature = reader.bytes(); + break; + case 4: + message.round = reader.uint32(); + break; + case 5: + message.blockIdHash = reader.bytes(); + break; + case 6: + message.quorumType = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proof message. + * @function verify + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) + if (!(message.grovedbProof && typeof message.grovedbProof.length === "number" || $util.isString(message.grovedbProof))) + return "grovedbProof: buffer expected"; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) + return "quorumHash: buffer expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) + if (!(message.blockIdHash && typeof message.blockIdHash.length === "number" || $util.isString(message.blockIdHash))) + return "blockIdHash: buffer expected"; + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + if (!$util.isInteger(message.quorumType)) + return "quorumType: integer expected"; + return null; + }; + + /** + * Creates a Proof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.Proof} Proof + */ + Proof.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.Proof) + return object; + var message = new $root.org.dash.platform.dapi.v0.Proof(); + if (object.grovedbProof != null) + if (typeof object.grovedbProof === "string") + $util.base64.decode(object.grovedbProof, message.grovedbProof = $util.newBuffer($util.base64.length(object.grovedbProof)), 0); + else if (object.grovedbProof.length >= 0) + message.grovedbProof = object.grovedbProof; + if (object.quorumHash != null) + if (typeof object.quorumHash === "string") + $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); + else if (object.quorumHash.length >= 0) + message.quorumHash = object.quorumHash; + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length >= 0) + message.signature = object.signature; + if (object.round != null) + message.round = object.round >>> 0; + if (object.blockIdHash != null) + if (typeof object.blockIdHash === "string") + $util.base64.decode(object.blockIdHash, message.blockIdHash = $util.newBuffer($util.base64.length(object.blockIdHash)), 0); + else if (object.blockIdHash.length >= 0) + message.blockIdHash = object.blockIdHash; + if (object.quorumType != null) + message.quorumType = object.quorumType >>> 0; + return message; + }; + + /** + * Creates a plain object from a Proof message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.Proof} message Proof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proof.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.grovedbProof = ""; + else { + object.grovedbProof = []; + if (options.bytes !== Array) + object.grovedbProof = $util.newBuffer(object.grovedbProof); + } + if (options.bytes === String) + object.quorumHash = ""; + else { + object.quorumHash = []; + if (options.bytes !== Array) + object.quorumHash = $util.newBuffer(object.quorumHash); + } + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + object.round = 0; + if (options.bytes === String) + object.blockIdHash = ""; + else { + object.blockIdHash = []; + if (options.bytes !== Array) + object.blockIdHash = $util.newBuffer(object.blockIdHash); + } + object.quorumType = 0; + } + if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) + object.grovedbProof = options.bytes === String ? $util.base64.encode(message.grovedbProof, 0, message.grovedbProof.length) : options.bytes === Array ? Array.prototype.slice.call(message.grovedbProof) : message.grovedbProof; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) + object.blockIdHash = options.bytes === String ? $util.base64.encode(message.blockIdHash, 0, message.blockIdHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.blockIdHash) : message.blockIdHash; + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + object.quorumType = message.quorumType; + return object; + }; + + /** + * Converts this Proof to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + * @returns {Object.} JSON object + */ + Proof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proof; + })(); + + v0.ResponseMetadata = (function() { + + /** + * Properties of a ResponseMetadata. + * @memberof org.dash.platform.dapi.v0 + * @interface IResponseMetadata + * @property {number|Long|null} [height] ResponseMetadata height + * @property {number|null} [coreChainLockedHeight] ResponseMetadata coreChainLockedHeight + * @property {number|null} [epoch] ResponseMetadata epoch + * @property {number|Long|null} [timeMs] ResponseMetadata timeMs + * @property {number|null} [protocolVersion] ResponseMetadata protocolVersion + * @property {string|null} [chainId] ResponseMetadata chainId + */ + + /** + * Constructs a new ResponseMetadata. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a ResponseMetadata. + * @implements IResponseMetadata + * @constructor + * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set + */ + function ResponseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseMetadata height. + * @member {number|Long} height + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseMetadata coreChainLockedHeight. + * @member {number} coreChainLockedHeight + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.coreChainLockedHeight = 0; + + /** + * ResponseMetadata epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.epoch = 0; + + /** + * ResponseMetadata timeMs. + * @member {number|Long} timeMs + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.timeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseMetadata protocolVersion. + * @member {number} protocolVersion + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.protocolVersion = 0; + + /** + * ResponseMetadata chainId. + * @member {string} chainId + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.chainId = ""; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata instance + */ + ResponseMetadata.create = function create(properties) { + return new ResponseMetadata(properties); + }; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreChainLockedHeight); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.epoch); + if (message.timeMs != null && Object.hasOwnProperty.call(message, "timeMs")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timeMs); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.protocolVersion); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.chainId); + return writer; + }; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.coreChainLockedHeight = reader.uint32(); + break; + case 3: + message.epoch = reader.uint32(); + break; + case 4: + message.timeMs = reader.uint64(); + break; + case 5: + message.protocolVersion = reader.uint32(); + break; + case 6: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMetadata message. + * @function verify + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + if (!$util.isInteger(message.coreChainLockedHeight)) + return "coreChainLockedHeight: integer expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.timeMs != null && message.hasOwnProperty("timeMs")) + if (!$util.isInteger(message.timeMs) && !(message.timeMs && $util.isInteger(message.timeMs.low) && $util.isInteger(message.timeMs.high))) + return "timeMs: integer|Long expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion)) + return "protocolVersion: integer expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + return null; + }; + + /** + * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + */ + ResponseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.ResponseMetadata) + return object; + var message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.coreChainLockedHeight != null) + message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.timeMs != null) + if ($util.Long) + (message.timeMs = $util.Long.fromValue(object.timeMs)).unsigned = true; + else if (typeof object.timeMs === "string") + message.timeMs = parseInt(object.timeMs, 10); + else if (typeof object.timeMs === "number") + message.timeMs = object.timeMs; + else if (typeof object.timeMs === "object") + message.timeMs = new $util.LongBits(object.timeMs.low >>> 0, object.timeMs.high >>> 0).toNumber(true); + if (object.protocolVersion != null) + message.protocolVersion = object.protocolVersion >>> 0; + if (object.chainId != null) + message.chainId = String(object.chainId); + return message; + }; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.ResponseMetadata} message ResponseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.coreChainLockedHeight = 0; + object.epoch = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeMs = options.longs === String ? "0" : 0; + object.protocolVersion = 0; + object.chainId = ""; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + object.coreChainLockedHeight = message.coreChainLockedHeight; + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.timeMs != null && message.hasOwnProperty("timeMs")) + if (typeof message.timeMs === "number") + object.timeMs = options.longs === String ? String(message.timeMs) : message.timeMs; + else + object.timeMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeMs) : options.longs === Number ? new $util.LongBits(message.timeMs.low >>> 0, message.timeMs.high >>> 0).toNumber(true) : message.timeMs; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = message.protocolVersion; + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + return object; + }; + + /** + * Converts this ResponseMetadata to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + * @returns {Object.} JSON object + */ + ResponseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseMetadata; + })(); + + v0.StateTransitionBroadcastError = (function() { + + /** + * Properties of a StateTransitionBroadcastError. + * @memberof org.dash.platform.dapi.v0 + * @interface IStateTransitionBroadcastError + * @property {number|null} [code] StateTransitionBroadcastError code + * @property {string|null} [message] StateTransitionBroadcastError message + * @property {Uint8Array|null} [data] StateTransitionBroadcastError data + */ + + /** + * Constructs a new StateTransitionBroadcastError. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a StateTransitionBroadcastError. + * @implements IStateTransitionBroadcastError + * @constructor + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set + */ + function StateTransitionBroadcastError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateTransitionBroadcastError code. + * @member {number} code + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.code = 0; + + /** + * StateTransitionBroadcastError message. + * @member {string} message + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.message = ""; + + /** + * StateTransitionBroadcastError data. + * @member {Uint8Array} data + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.data = $util.newBuffer([]); + + /** + * Creates a new StateTransitionBroadcastError instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError instance + */ + StateTransitionBroadcastError.create = function create(properties) { + return new StateTransitionBroadcastError(properties); + }; + + /** + * Encodes the specified StateTransitionBroadcastError message. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionBroadcastError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified StateTransitionBroadcastError message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionBroadcastError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateTransitionBroadcastError message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionBroadcastError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateTransitionBroadcastError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionBroadcastError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateTransitionBroadcastError message. + * @function verify + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateTransitionBroadcastError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a StateTransitionBroadcastError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + */ + StateTransitionBroadcastError.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError) + return object; + var message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.message != null) + message.message = String(object.message); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a StateTransitionBroadcastError message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.StateTransitionBroadcastError} message StateTransitionBroadcastError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateTransitionBroadcastError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = 0; + object.message = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this StateTransitionBroadcastError to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + * @returns {Object.} JSON object + */ + StateTransitionBroadcastError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateTransitionBroadcastError; + })(); + + /** + * KeyPurpose enum. + * @name org.dash.platform.dapi.v0.KeyPurpose + * @enum {number} + * @property {number} AUTHENTICATION=0 AUTHENTICATION value + * @property {number} ENCRYPTION=1 ENCRYPTION value + * @property {number} DECRYPTION=2 DECRYPTION value + * @property {number} TRANSFER=3 TRANSFER value + * @property {number} VOTING=5 VOTING value + */ + v0.KeyPurpose = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTHENTICATION"] = 0; + values[valuesById[1] = "ENCRYPTION"] = 1; + values[valuesById[2] = "DECRYPTION"] = 2; + values[valuesById[3] = "TRANSFER"] = 3; + values[valuesById[5] = "VOTING"] = 5; + return values; + })(); + + v0.BroadcastStateTransitionRequest = (function() { + + /** + * Properties of a BroadcastStateTransitionRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IBroadcastStateTransitionRequest + * @property {Uint8Array|null} [stateTransition] BroadcastStateTransitionRequest stateTransition + */ + + /** + * Constructs a new BroadcastStateTransitionRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BroadcastStateTransitionRequest. + * @implements IBroadcastStateTransitionRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set + */ + function BroadcastStateTransitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BroadcastStateTransitionRequest stateTransition. + * @member {Uint8Array} stateTransition + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @instance + */ + BroadcastStateTransitionRequest.prototype.stateTransition = $util.newBuffer([]); + + /** + * Creates a new BroadcastStateTransitionRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest instance + */ + BroadcastStateTransitionRequest.create = function create(properties) { + return new BroadcastStateTransitionRequest(properties); + }; + + /** + * Encodes the specified BroadcastStateTransitionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransition); + return writer; + }; + + /** + * Encodes the specified BroadcastStateTransitionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransition = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastStateTransitionRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastStateTransitionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) + return "stateTransition: buffer expected"; + return null; + }; + + /** + * Creates a BroadcastStateTransitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + */ + BroadcastStateTransitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); + if (object.stateTransition != null) + if (typeof object.stateTransition === "string") + $util.base64.decode(object.stateTransition, message.stateTransition = $util.newBuffer($util.base64.length(object.stateTransition)), 0); + else if (object.stateTransition.length >= 0) + message.stateTransition = object.stateTransition; + return message; + }; + + /** + * Creates a plain object from a BroadcastStateTransitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message BroadcastStateTransitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastStateTransitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.stateTransition = ""; + else { + object.stateTransition = []; + if (options.bytes !== Array) + object.stateTransition = $util.newBuffer(object.stateTransition); + } + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + object.stateTransition = options.bytes === String ? $util.base64.encode(message.stateTransition, 0, message.stateTransition.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransition) : message.stateTransition; + return object; + }; + + /** + * Converts this BroadcastStateTransitionRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @instance + * @returns {Object.} JSON object + */ + BroadcastStateTransitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastStateTransitionRequest; + })(); + + v0.BroadcastStateTransitionResponse = (function() { + + /** + * Properties of a BroadcastStateTransitionResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IBroadcastStateTransitionResponse + */ + + /** + * Constructs a new BroadcastStateTransitionResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BroadcastStateTransitionResponse. + * @implements IBroadcastStateTransitionResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set + */ + function BroadcastStateTransitionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new BroadcastStateTransitionResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse instance + */ + BroadcastStateTransitionResponse.create = function create(properties) { + return new BroadcastStateTransitionResponse(properties); + }; + + /** + * Encodes the specified BroadcastStateTransitionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BroadcastStateTransitionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastStateTransitionResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastStateTransitionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BroadcastStateTransitionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + */ + BroadcastStateTransitionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse) + return object; + return new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); + }; + + /** + * Creates a plain object from a BroadcastStateTransitionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message BroadcastStateTransitionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastStateTransitionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BroadcastStateTransitionResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @instance + * @returns {Object.} JSON object + */ + BroadcastStateTransitionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastStateTransitionResponse; + })(); + + v0.GetIdentityRequest = (function() { + + /** + * Properties of a GetIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityRequest + * @property {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null} [v0] GetIdentityRequest v0 + */ + + /** + * Constructs a new GetIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityRequest. + * @implements IGetIdentityRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set + */ + function GetIdentityRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + */ + GetIdentityRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + */ + Object.defineProperty(GetIdentityRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest instance + */ + GetIdentityRequest.create = function create(properties) { + return new GetIdentityRequest(properties); + }; + + /** + * Encodes the specified GetIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + */ + GetIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest} message GetIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityRequest.GetIdentityRequestV0 = (function() { + + /** + * Properties of a GetIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @interface IGetIdentityRequestV0 + * @property {Uint8Array|null} [id] GetIdentityRequestV0 id + * @property {boolean|null} [prove] GetIdentityRequestV0 prove + */ + + /** + * Constructs a new GetIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @classdesc Represents a GetIdentityRequestV0. + * @implements IGetIdentityRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set + */ + function GetIdentityRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + */ + GetIdentityRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + */ + GetIdentityRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 instance + */ + GetIdentityRequestV0.create = function create(properties) { + return new GetIdentityRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + */ + GetIdentityRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} message GetIdentityRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityRequestV0; + })(); + + return GetIdentityRequest; + })(); + + v0.GetIdentityNonceRequest = (function() { + + /** + * Properties of a GetIdentityNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityNonceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null} [v0] GetIdentityNonceRequest v0 + */ + + /** + * Constructs a new GetIdentityNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityNonceRequest. + * @implements IGetIdentityNonceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set + */ + function GetIdentityNonceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityNonceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + */ + GetIdentityNonceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + */ + Object.defineProperty(GetIdentityNonceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest instance + */ + GetIdentityNonceRequest.create = function create(properties) { + return new GetIdentityNonceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityNonceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + */ + GetIdentityNonceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest} message GetIdentityNonceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityNonceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityNonceRequest.GetIdentityNonceRequestV0 = (function() { + + /** + * Properties of a GetIdentityNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @interface IGetIdentityNonceRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityNonceRequestV0 identityId + * @property {boolean|null} [prove] GetIdentityNonceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @classdesc Represents a GetIdentityNonceRequestV0. + * @implements IGetIdentityNonceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set + */ + function GetIdentityNonceRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityNonceRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + */ + GetIdentityNonceRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityNonceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + */ + GetIdentityNonceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityNonceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 instance + */ + GetIdentityNonceRequestV0.create = function create(properties) { + return new GetIdentityNonceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityNonceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + */ + GetIdentityNonceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityNonceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityNonceRequestV0; + })(); + + return GetIdentityNonceRequest; + })(); + + v0.GetIdentityContractNonceRequest = (function() { + + /** + * Properties of a GetIdentityContractNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityContractNonceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null} [v0] GetIdentityContractNonceRequest v0 + */ + + /** + * Constructs a new GetIdentityContractNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityContractNonceRequest. + * @implements IGetIdentityContractNonceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set + */ + function GetIdentityContractNonceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityContractNonceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + */ + GetIdentityContractNonceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + */ + Object.defineProperty(GetIdentityContractNonceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest instance + */ + GetIdentityContractNonceRequest.create = function create(properties) { + return new GetIdentityContractNonceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + */ + GetIdentityContractNonceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} message GetIdentityContractNonceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityContractNonceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 = (function() { + + /** + * Properties of a GetIdentityContractNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @interface IGetIdentityContractNonceRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityContractNonceRequestV0 identityId + * @property {Uint8Array|null} [contractId] GetIdentityContractNonceRequestV0 contractId + * @property {boolean|null} [prove] GetIdentityContractNonceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityContractNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @classdesc Represents a GetIdentityContractNonceRequestV0. + * @implements IGetIdentityContractNonceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set + */ + function GetIdentityContractNonceRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityContractNonceRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityContractNonceRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetIdentityContractNonceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityContractNonceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 instance + */ + GetIdentityContractNonceRequestV0.create = function create(properties) { + return new GetIdentityContractNonceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.contractId = reader.bytes(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityContractNonceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + */ + GetIdentityContractNonceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityContractNonceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityContractNonceRequestV0; + })(); + + return GetIdentityContractNonceRequest; + })(); + + v0.GetIdentityBalanceRequest = (function() { + + /** + * Properties of a GetIdentityBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null} [v0] GetIdentityBalanceRequest v0 + */ + + /** + * Constructs a new GetIdentityBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceRequest. + * @implements IGetIdentityBalanceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set + */ + function GetIdentityBalanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + */ + GetIdentityBalanceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + */ + Object.defineProperty(GetIdentityBalanceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest instance + */ + GetIdentityBalanceRequest.create = function create(properties) { + return new GetIdentityBalanceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + */ + GetIdentityBalanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} message GetIdentityBalanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 = (function() { + + /** + * Properties of a GetIdentityBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @interface IGetIdentityBalanceRequestV0 + * @property {Uint8Array|null} [id] GetIdentityBalanceRequestV0 id + * @property {boolean|null} [prove] GetIdentityBalanceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @classdesc Represents a GetIdentityBalanceRequestV0. + * @implements IGetIdentityBalanceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set + */ + function GetIdentityBalanceRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + */ + GetIdentityBalanceRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityBalanceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + */ + GetIdentityBalanceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityBalanceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 instance + */ + GetIdentityBalanceRequestV0.create = function create(properties) { + return new GetIdentityBalanceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + */ + GetIdentityBalanceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityBalanceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceRequestV0; + })(); + + return GetIdentityBalanceRequest; + })(); + + v0.GetIdentityBalanceAndRevisionRequest = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceAndRevisionRequest + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null} [v0] GetIdentityBalanceAndRevisionRequest v0 + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceAndRevisionRequest. + * @implements IGetIdentityBalanceAndRevisionRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceAndRevisionRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + */ + GetIdentityBalanceAndRevisionRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest instance + */ + GetIdentityBalanceAndRevisionRequest.create = function create(properties) { + return new GetIdentityBalanceAndRevisionRequest(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + */ + GetIdentityBalanceAndRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @interface IGetIdentityBalanceAndRevisionRequestV0 + * @property {Uint8Array|null} [id] GetIdentityBalanceAndRevisionRequestV0 id + * @property {boolean|null} [prove] GetIdentityBalanceAndRevisionRequestV0 prove + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @classdesc Represents a GetIdentityBalanceAndRevisionRequestV0. + * @implements IGetIdentityBalanceAndRevisionRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceAndRevisionRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityBalanceAndRevisionRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityBalanceAndRevisionRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 instance + */ + GetIdentityBalanceAndRevisionRequestV0.create = function create(properties) { + return new GetIdentityBalanceAndRevisionRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + */ + GetIdentityBalanceAndRevisionRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceAndRevisionRequestV0; + })(); + + return GetIdentityBalanceAndRevisionRequest; + })(); + + v0.GetIdentityResponse = (function() { + + /** + * Properties of a GetIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityResponse + * @property {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null} [v0] GetIdentityResponse v0 + */ + + /** + * Constructs a new GetIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityResponse. + * @implements IGetIdentityResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set + */ + function GetIdentityResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + */ + GetIdentityResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + */ + Object.defineProperty(GetIdentityResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse instance + */ + GetIdentityResponse.create = function create(properties) { + return new GetIdentityResponse(properties); + }; + + /** + * Encodes the specified GetIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + */ + GetIdentityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse} message GetIdentityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityResponse.GetIdentityResponseV0 = (function() { + + /** + * Properties of a GetIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @interface IGetIdentityResponseV0 + * @property {Uint8Array|null} [identity] GetIdentityResponseV0 identity + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @classdesc Represents a GetIdentityResponseV0. + * @implements IGetIdentityResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set + */ + function GetIdentityResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityResponseV0 identity. + * @member {Uint8Array} identity + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.identity = $util.newBuffer([]); + + /** + * GetIdentityResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.proof = null; + + /** + * GetIdentityResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityResponseV0 result. + * @member {"identity"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 instance + */ + GetIdentityResponseV0.create = function create(properties) { + return new GetIdentityResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identity != null && message.hasOwnProperty("identity")) { + properties.result = 1; + if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) + return "identity: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + */ + GetIdentityResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); + if (object.identity != null) + if (typeof object.identity === "string") + $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); + else if (object.identity.length >= 0) + message.identity = object.identity; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} message GetIdentityResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identity != null && message.hasOwnProperty("identity")) { + object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; + if (options.oneofs) + object.result = "identity"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityResponseV0; + })(); + + return GetIdentityResponse; + })(); + + v0.GetIdentityNonceResponse = (function() { + + /** + * Properties of a GetIdentityNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityNonceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null} [v0] GetIdentityNonceResponse v0 + */ + + /** + * Constructs a new GetIdentityNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityNonceResponse. + * @implements IGetIdentityNonceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set + */ + function GetIdentityNonceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityNonceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + */ + GetIdentityNonceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + */ + Object.defineProperty(GetIdentityNonceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse instance + */ + GetIdentityNonceResponse.create = function create(properties) { + return new GetIdentityNonceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityNonceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + */ + GetIdentityNonceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} message GetIdentityNonceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityNonceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityNonceResponse.GetIdentityNonceResponseV0 = (function() { + + /** + * Properties of a GetIdentityNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @interface IGetIdentityNonceResponseV0 + * @property {number|Long|null} [identityNonce] GetIdentityNonceResponseV0 identityNonce + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityNonceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityNonceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @classdesc Represents a GetIdentityNonceResponseV0. + * @implements IGetIdentityNonceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set + */ + function GetIdentityNonceResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityNonceResponseV0 identityNonce. + * @member {number|Long} identityNonce + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.identityNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityNonceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.proof = null; + + /** + * GetIdentityNonceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceResponseV0 result. + * @member {"identityNonce"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityNonceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityNonce", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 instance + */ + GetIdentityNonceResponseV0.create = function create(properties) { + return new GetIdentityNonceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityNonce != null && Object.hasOwnProperty.call(message, "identityNonce")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityNonce); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityNonce = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { + properties.result = 1; + if (!$util.isInteger(message.identityNonce) && !(message.identityNonce && $util.isInteger(message.identityNonce.low) && $util.isInteger(message.identityNonce.high))) + return "identityNonce: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityNonceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + */ + GetIdentityNonceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); + if (object.identityNonce != null) + if ($util.Long) + (message.identityNonce = $util.Long.fromValue(object.identityNonce)).unsigned = true; + else if (typeof object.identityNonce === "string") + message.identityNonce = parseInt(object.identityNonce, 10); + else if (typeof object.identityNonce === "number") + message.identityNonce = object.identityNonce; + else if (typeof object.identityNonce === "object") + message.identityNonce = new $util.LongBits(object.identityNonce.low >>> 0, object.identityNonce.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { + if (typeof message.identityNonce === "number") + object.identityNonce = options.longs === String ? String(message.identityNonce) : message.identityNonce; + else + object.identityNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityNonce) : options.longs === Number ? new $util.LongBits(message.identityNonce.low >>> 0, message.identityNonce.high >>> 0).toNumber(true) : message.identityNonce; + if (options.oneofs) + object.result = "identityNonce"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityNonceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityNonceResponseV0; + })(); + + return GetIdentityNonceResponse; + })(); + + v0.GetIdentityContractNonceResponse = (function() { + + /** + * Properties of a GetIdentityContractNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityContractNonceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null} [v0] GetIdentityContractNonceResponse v0 + */ + + /** + * Constructs a new GetIdentityContractNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityContractNonceResponse. + * @implements IGetIdentityContractNonceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set + */ + function GetIdentityContractNonceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityContractNonceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + */ + GetIdentityContractNonceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + */ + Object.defineProperty(GetIdentityContractNonceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse instance + */ + GetIdentityContractNonceResponse.create = function create(properties) { + return new GetIdentityContractNonceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + */ + GetIdentityContractNonceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} message GetIdentityContractNonceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityContractNonceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 = (function() { + + /** + * Properties of a GetIdentityContractNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @interface IGetIdentityContractNonceResponseV0 + * @property {number|Long|null} [identityContractNonce] GetIdentityContractNonceResponseV0 identityContractNonce + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityContractNonceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityContractNonceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityContractNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @classdesc Represents a GetIdentityContractNonceResponseV0. + * @implements IGetIdentityContractNonceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set + */ + function GetIdentityContractNonceResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityContractNonceResponseV0 identityContractNonce. + * @member {number|Long} identityContractNonce + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.identityContractNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityContractNonceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.proof = null; + + /** + * GetIdentityContractNonceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceResponseV0 result. + * @member {"identityContractNonce"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityContractNonceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityContractNonce", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 instance + */ + GetIdentityContractNonceResponseV0.create = function create(properties) { + return new GetIdentityContractNonceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityContractNonce != null && Object.hasOwnProperty.call(message, "identityContractNonce")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityContractNonce); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityContractNonce = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { + properties.result = 1; + if (!$util.isInteger(message.identityContractNonce) && !(message.identityContractNonce && $util.isInteger(message.identityContractNonce.low) && $util.isInteger(message.identityContractNonce.high))) + return "identityContractNonce: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + */ + GetIdentityContractNonceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); + if (object.identityContractNonce != null) + if ($util.Long) + (message.identityContractNonce = $util.Long.fromValue(object.identityContractNonce)).unsigned = true; + else if (typeof object.identityContractNonce === "string") + message.identityContractNonce = parseInt(object.identityContractNonce, 10); + else if (typeof object.identityContractNonce === "number") + message.identityContractNonce = object.identityContractNonce; + else if (typeof object.identityContractNonce === "object") + message.identityContractNonce = new $util.LongBits(object.identityContractNonce.low >>> 0, object.identityContractNonce.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { + if (typeof message.identityContractNonce === "number") + object.identityContractNonce = options.longs === String ? String(message.identityContractNonce) : message.identityContractNonce; + else + object.identityContractNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityContractNonce) : options.longs === Number ? new $util.LongBits(message.identityContractNonce.low >>> 0, message.identityContractNonce.high >>> 0).toNumber(true) : message.identityContractNonce; + if (options.oneofs) + object.result = "identityContractNonce"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityContractNonceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityContractNonceResponseV0; + })(); + + return GetIdentityContractNonceResponse; + })(); + + v0.GetIdentityBalanceResponse = (function() { + + /** + * Properties of a GetIdentityBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null} [v0] GetIdentityBalanceResponse v0 + */ + + /** + * Constructs a new GetIdentityBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceResponse. + * @implements IGetIdentityBalanceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set + */ + function GetIdentityBalanceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + */ + GetIdentityBalanceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + */ + Object.defineProperty(GetIdentityBalanceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse instance + */ + GetIdentityBalanceResponse.create = function create(properties) { + return new GetIdentityBalanceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + */ + GetIdentityBalanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} message GetIdentityBalanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 = (function() { + + /** + * Properties of a GetIdentityBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @interface IGetIdentityBalanceResponseV0 + * @property {number|Long|null} [balance] GetIdentityBalanceResponseV0 balance + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @classdesc Represents a GetIdentityBalanceResponseV0. + * @implements IGetIdentityBalanceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set + */ + function GetIdentityBalanceResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceResponseV0 balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityBalanceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.proof = null; + + /** + * GetIdentityBalanceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceResponseV0 result. + * @member {"balance"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityBalanceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 instance + */ + GetIdentityBalanceResponseV0.create = function create(properties) { + return new GetIdentityBalanceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balance != null && message.hasOwnProperty("balance")) { + properties.result = 1; + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + */ + GetIdentityBalanceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balance != null && message.hasOwnProperty("balance")) { + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (options.oneofs) + object.result = "balance"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityBalanceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceResponseV0; + })(); + + return GetIdentityBalanceResponse; + })(); + + v0.GetIdentityBalanceAndRevisionResponse = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceAndRevisionResponse + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null} [v0] GetIdentityBalanceAndRevisionResponse v0 + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceAndRevisionResponse. + * @implements IGetIdentityBalanceAndRevisionResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceAndRevisionResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + */ + GetIdentityBalanceAndRevisionResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse instance + */ + GetIdentityBalanceAndRevisionResponse.create = function create(properties) { + return new GetIdentityBalanceAndRevisionResponse(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + */ + GetIdentityBalanceAndRevisionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @interface IGetIdentityBalanceAndRevisionResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null} [balanceAndRevision] GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceAndRevisionResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceAndRevisionResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @classdesc Represents a GetIdentityBalanceAndRevisionResponseV0. + * @implements IGetIdentityBalanceAndRevisionResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null|undefined} balanceAndRevision + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.balanceAndRevision = null; + + /** + * GetIdentityBalanceAndRevisionResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.proof = null; + + /** + * GetIdentityBalanceAndRevisionResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionResponseV0 result. + * @member {"balanceAndRevision"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balanceAndRevision", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 instance + */ + GetIdentityBalanceAndRevisionResponseV0.create = function create(properties) { + return new GetIdentityBalanceAndRevisionResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balanceAndRevision != null && Object.hasOwnProperty.call(message, "balanceAndRevision")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.encode(message.balanceAndRevision, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify(message.balanceAndRevision); + if (error) + return "balanceAndRevision." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + */ + GetIdentityBalanceAndRevisionResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); + if (object.balanceAndRevision != null) { + if (typeof object.balanceAndRevision !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.balanceAndRevision: object expected"); + message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.fromObject(object.balanceAndRevision); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { + object.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.toObject(message.balanceAndRevision, options); + if (options.oneofs) + object.result = "balanceAndRevision"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision = (function() { + + /** + * Properties of a BalanceAndRevision. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @interface IBalanceAndRevision + * @property {number|Long|null} [balance] BalanceAndRevision balance + * @property {number|Long|null} [revision] BalanceAndRevision revision + */ + + /** + * Constructs a new BalanceAndRevision. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @classdesc Represents a BalanceAndRevision. + * @implements IBalanceAndRevision + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set + */ + function BalanceAndRevision(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BalanceAndRevision balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + */ + BalanceAndRevision.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BalanceAndRevision revision. + * @member {number|Long} revision + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + */ + BalanceAndRevision.prototype.revision = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new BalanceAndRevision instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision instance + */ + BalanceAndRevision.create = function create(properties) { + return new BalanceAndRevision(properties); + }; + + /** + * Encodes the specified BalanceAndRevision message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BalanceAndRevision.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision); + return writer; + }; + + /** + * Encodes the specified BalanceAndRevision message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BalanceAndRevision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BalanceAndRevision message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BalanceAndRevision.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.revision = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BalanceAndRevision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BalanceAndRevision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BalanceAndRevision message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BalanceAndRevision.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision) && !(message.revision && $util.isInteger(message.revision.low) && $util.isInteger(message.revision.high))) + return "revision: integer|Long expected"; + return null; + }; + + /** + * Creates a BalanceAndRevision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + */ + BalanceAndRevision.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.revision != null) + if ($util.Long) + (message.revision = $util.Long.fromValue(object.revision)).unsigned = true; + else if (typeof object.revision === "string") + message.revision = parseInt(object.revision, 10); + else if (typeof object.revision === "number") + message.revision = object.revision; + else if (typeof object.revision === "object") + message.revision = new $util.LongBits(object.revision.low >>> 0, object.revision.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a BalanceAndRevision message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} message BalanceAndRevision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BalanceAndRevision.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.revision = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revision = options.longs === String ? "0" : 0; + } + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (message.revision != null && message.hasOwnProperty("revision")) + if (typeof message.revision === "number") + object.revision = options.longs === String ? String(message.revision) : message.revision; + else + object.revision = options.longs === String ? $util.Long.prototype.toString.call(message.revision) : options.longs === Number ? new $util.LongBits(message.revision.low >>> 0, message.revision.high >>> 0).toNumber(true) : message.revision; + return object; + }; + + /** + * Converts this BalanceAndRevision to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + * @returns {Object.} JSON object + */ + BalanceAndRevision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BalanceAndRevision; + })(); + + return GetIdentityBalanceAndRevisionResponseV0; + })(); + + return GetIdentityBalanceAndRevisionResponse; + })(); + + v0.KeyRequestType = (function() { + + /** + * Properties of a KeyRequestType. + * @memberof org.dash.platform.dapi.v0 + * @interface IKeyRequestType + * @property {org.dash.platform.dapi.v0.IAllKeys|null} [allKeys] KeyRequestType allKeys + * @property {org.dash.platform.dapi.v0.ISpecificKeys|null} [specificKeys] KeyRequestType specificKeys + * @property {org.dash.platform.dapi.v0.ISearchKey|null} [searchKey] KeyRequestType searchKey + */ + + /** + * Constructs a new KeyRequestType. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a KeyRequestType. + * @implements IKeyRequestType + * @constructor + * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set + */ + function KeyRequestType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRequestType allKeys. + * @member {org.dash.platform.dapi.v0.IAllKeys|null|undefined} allKeys + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.allKeys = null; + + /** + * KeyRequestType specificKeys. + * @member {org.dash.platform.dapi.v0.ISpecificKeys|null|undefined} specificKeys + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.specificKeys = null; + + /** + * KeyRequestType searchKey. + * @member {org.dash.platform.dapi.v0.ISearchKey|null|undefined} searchKey + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.searchKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyRequestType request. + * @member {"allKeys"|"specificKeys"|"searchKey"|undefined} request + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + Object.defineProperty(KeyRequestType.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["allKeys", "specificKeys", "searchKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyRequestType instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType instance + */ + KeyRequestType.create = function create(properties) { + return new KeyRequestType(properties); + }; + + /** + * Encodes the specified KeyRequestType message. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRequestType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allKeys != null && Object.hasOwnProperty.call(message, "allKeys")) + $root.org.dash.platform.dapi.v0.AllKeys.encode(message.allKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.specificKeys != null && Object.hasOwnProperty.call(message, "specificKeys")) + $root.org.dash.platform.dapi.v0.SpecificKeys.encode(message.specificKeys, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.searchKey != null && Object.hasOwnProperty.call(message, "searchKey")) + $root.org.dash.platform.dapi.v0.SearchKey.encode(message.searchKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyRequestType message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRequestType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRequestType message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRequestType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.decode(reader, reader.uint32()); + break; + case 2: + message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.decode(reader, reader.uint32()); + break; + case 3: + message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRequestType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRequestType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRequestType message. + * @function verify + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRequestType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allKeys != null && message.hasOwnProperty("allKeys")) { + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.AllKeys.verify(message.allKeys); + if (error) + return "allKeys." + error; + } + } + if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.SpecificKeys.verify(message.specificKeys); + if (error) + return "specificKeys." + error; + } + } + if (message.searchKey != null && message.hasOwnProperty("searchKey")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.SearchKey.verify(message.searchKey); + if (error) + return "searchKey." + error; + } + } + return null; + }; + + /** + * Creates a KeyRequestType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + */ + KeyRequestType.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.KeyRequestType) + return object; + var message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); + if (object.allKeys != null) { + if (typeof object.allKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.allKeys: object expected"); + message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.fromObject(object.allKeys); + } + if (object.specificKeys != null) { + if (typeof object.specificKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.specificKeys: object expected"); + message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.fromObject(object.specificKeys); + } + if (object.searchKey != null) { + if (typeof object.searchKey !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.searchKey: object expected"); + message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.fromObject(object.searchKey); + } + return message; + }; + + /** + * Creates a plain object from a KeyRequestType message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.KeyRequestType} message KeyRequestType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRequestType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.allKeys != null && message.hasOwnProperty("allKeys")) { + object.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.toObject(message.allKeys, options); + if (options.oneofs) + object.request = "allKeys"; + } + if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { + object.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.toObject(message.specificKeys, options); + if (options.oneofs) + object.request = "specificKeys"; + } + if (message.searchKey != null && message.hasOwnProperty("searchKey")) { + object.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.toObject(message.searchKey, options); + if (options.oneofs) + object.request = "searchKey"; + } + return object; + }; + + /** + * Converts this KeyRequestType to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + * @returns {Object.} JSON object + */ + KeyRequestType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KeyRequestType; + })(); + + v0.AllKeys = (function() { + + /** + * Properties of an AllKeys. + * @memberof org.dash.platform.dapi.v0 + * @interface IAllKeys + */ + + /** + * Constructs a new AllKeys. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents an AllKeys. + * @implements IAllKeys + * @constructor + * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set + */ + function AllKeys(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AllKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys instance + */ + AllKeys.create = function create(properties) { + return new AllKeys(properties); + }; + + /** + * Encodes the specified AllKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AllKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.AllKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AllKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + */ + AllKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.AllKeys) + return object; + return new $root.org.dash.platform.dapi.v0.AllKeys(); + }; + + /** + * Creates a plain object from an AllKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.AllKeys} message AllKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllKeys.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AllKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.AllKeys + * @instance + * @returns {Object.} JSON object + */ + AllKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AllKeys; + })(); + + v0.SpecificKeys = (function() { + + /** + * Properties of a SpecificKeys. + * @memberof org.dash.platform.dapi.v0 + * @interface ISpecificKeys + * @property {Array.|null} [keyIds] SpecificKeys keyIds + */ + + /** + * Constructs a new SpecificKeys. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SpecificKeys. + * @implements ISpecificKeys + * @constructor + * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set + */ + function SpecificKeys(properties) { + this.keyIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpecificKeys keyIds. + * @member {Array.} keyIds + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @instance + */ + SpecificKeys.prototype.keyIds = $util.emptyArray; + + /** + * Creates a new SpecificKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys instance + */ + SpecificKeys.create = function create(properties) { + return new SpecificKeys(properties); + }; + + /** + * Encodes the specified SpecificKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecificKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyIds != null && message.keyIds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.keyIds.length; ++i) + writer.uint32(message.keyIds[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SpecificKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecificKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecificKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecificKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keyIds && message.keyIds.length)) + message.keyIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.keyIds.push(reader.uint32()); + } else + message.keyIds.push(reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecificKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecificKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecificKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecificKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyIds != null && message.hasOwnProperty("keyIds")) { + if (!Array.isArray(message.keyIds)) + return "keyIds: array expected"; + for (var i = 0; i < message.keyIds.length; ++i) + if (!$util.isInteger(message.keyIds[i])) + return "keyIds: integer[] expected"; + } + return null; + }; + + /** + * Creates a SpecificKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + */ + SpecificKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SpecificKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); + if (object.keyIds) { + if (!Array.isArray(object.keyIds)) + throw TypeError(".org.dash.platform.dapi.v0.SpecificKeys.keyIds: array expected"); + message.keyIds = []; + for (var i = 0; i < object.keyIds.length; ++i) + message.keyIds[i] = object.keyIds[i] >>> 0; + } + return message; + }; + + /** + * Creates a plain object from a SpecificKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.SpecificKeys} message SpecificKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecificKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keyIds = []; + if (message.keyIds && message.keyIds.length) { + object.keyIds = []; + for (var j = 0; j < message.keyIds.length; ++j) + object.keyIds[j] = message.keyIds[j]; + } + return object; + }; + + /** + * Converts this SpecificKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @instance + * @returns {Object.} JSON object + */ + SpecificKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SpecificKeys; + })(); + + v0.SearchKey = (function() { + + /** + * Properties of a SearchKey. + * @memberof org.dash.platform.dapi.v0 + * @interface ISearchKey + * @property {Object.|null} [purposeMap] SearchKey purposeMap + */ + + /** + * Constructs a new SearchKey. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SearchKey. + * @implements ISearchKey + * @constructor + * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set + */ + function SearchKey(properties) { + this.purposeMap = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchKey purposeMap. + * @member {Object.} purposeMap + * @memberof org.dash.platform.dapi.v0.SearchKey + * @instance + */ + SearchKey.prototype.purposeMap = $util.emptyObject; + + /** + * Creates a new SearchKey instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey instance + */ + SearchKey.create = function create(properties) { + return new SearchKey(properties); + }; + + /** + * Encodes the specified SearchKey message. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purposeMap != null && Object.hasOwnProperty.call(message, "purposeMap")) + for (var keys = Object.keys(message.purposeMap), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]); + $root.org.dash.platform.dapi.v0.SecurityLevelMap.encode(message.purposeMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SearchKey message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchKey message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SearchKey(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.purposeMap === $util.emptyObject) + message.purposeMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = $root.org.dash.platform.dapi.v0.SecurityLevelMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.purposeMap[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchKey message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purposeMap != null && message.hasOwnProperty("purposeMap")) { + if (!$util.isObject(message.purposeMap)) + return "purposeMap: object expected"; + var key = Object.keys(message.purposeMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "purposeMap: integer key{k:uint32} expected"; + { + var error = $root.org.dash.platform.dapi.v0.SecurityLevelMap.verify(message.purposeMap[key[i]]); + if (error) + return "purposeMap." + error; + } + } + } + return null; + }; + + /** + * Creates a SearchKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + */ + SearchKey.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SearchKey) + return object; + var message = new $root.org.dash.platform.dapi.v0.SearchKey(); + if (object.purposeMap) { + if (typeof object.purposeMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); + message.purposeMap = {}; + for (var keys = Object.keys(object.purposeMap), i = 0; i < keys.length; ++i) { + if (typeof object.purposeMap[keys[i]] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); + message.purposeMap[keys[i]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.fromObject(object.purposeMap[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchKey message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.SearchKey} message SearchKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.purposeMap = {}; + var keys2; + if (message.purposeMap && (keys2 = Object.keys(message.purposeMap)).length) { + object.purposeMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.purposeMap[keys2[j]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.toObject(message.purposeMap[keys2[j]], options); + } + return object; + }; + + /** + * Converts this SearchKey to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SearchKey + * @instance + * @returns {Object.} JSON object + */ + SearchKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchKey; + })(); + + v0.SecurityLevelMap = (function() { + + /** + * Properties of a SecurityLevelMap. + * @memberof org.dash.platform.dapi.v0 + * @interface ISecurityLevelMap + * @property {Object.|null} [securityLevelMap] SecurityLevelMap securityLevelMap + */ + + /** + * Constructs a new SecurityLevelMap. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SecurityLevelMap. + * @implements ISecurityLevelMap + * @constructor + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set + */ + function SecurityLevelMap(properties) { + this.securityLevelMap = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityLevelMap securityLevelMap. + * @member {Object.} securityLevelMap + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @instance + */ + SecurityLevelMap.prototype.securityLevelMap = $util.emptyObject; + + /** + * Creates a new SecurityLevelMap instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap instance + */ + SecurityLevelMap.create = function create(properties) { + return new SecurityLevelMap(properties); + }; + + /** + * Encodes the specified SecurityLevelMap message. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityLevelMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityLevelMap != null && Object.hasOwnProperty.call(message, "securityLevelMap")) + for (var keys = Object.keys(message.securityLevelMap), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.securityLevelMap[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityLevelMap message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityLevelMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityLevelMap message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityLevelMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.securityLevelMap === $util.emptyObject) + message.securityLevelMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.securityLevelMap[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityLevelMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityLevelMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityLevelMap message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityLevelMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityLevelMap != null && message.hasOwnProperty("securityLevelMap")) { + if (!$util.isObject(message.securityLevelMap)) + return "securityLevelMap: object expected"; + var key = Object.keys(message.securityLevelMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "securityLevelMap: integer key{k:uint32} expected"; + switch (message.securityLevelMap[key[i]]) { + default: + return "securityLevelMap: enum value{k:uint32} expected"; + case 0: + case 1: + break; + } + } + } + return null; + }; + + /** + * Creates a SecurityLevelMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + */ + SecurityLevelMap.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SecurityLevelMap) + return object; + var message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(); + if (object.securityLevelMap) { + if (typeof object.securityLevelMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SecurityLevelMap.securityLevelMap: object expected"); + message.securityLevelMap = {}; + for (var keys = Object.keys(object.securityLevelMap), i = 0; i < keys.length; ++i) + switch (object.securityLevelMap[keys[i]]) { + case "CURRENT_KEY_OF_KIND_REQUEST": + case 0: + message.securityLevelMap[keys[i]] = 0; + break; + case "ALL_KEYS_OF_KIND_REQUEST": + case 1: + message.securityLevelMap[keys[i]] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SecurityLevelMap message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.SecurityLevelMap} message SecurityLevelMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityLevelMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.securityLevelMap = {}; + var keys2; + if (message.securityLevelMap && (keys2 = Object.keys(message.securityLevelMap)).length) { + object.securityLevelMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.securityLevelMap[keys2[j]] = options.enums === String ? $root.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType[message.securityLevelMap[keys2[j]]] : message.securityLevelMap[keys2[j]]; + } + return object; + }; + + /** + * Converts this SecurityLevelMap to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @instance + * @returns {Object.} JSON object + */ + SecurityLevelMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * KeyKindRequestType enum. + * @name org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType + * @enum {number} + * @property {number} CURRENT_KEY_OF_KIND_REQUEST=0 CURRENT_KEY_OF_KIND_REQUEST value + * @property {number} ALL_KEYS_OF_KIND_REQUEST=1 ALL_KEYS_OF_KIND_REQUEST value + */ + SecurityLevelMap.KeyKindRequestType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CURRENT_KEY_OF_KIND_REQUEST"] = 0; + values[valuesById[1] = "ALL_KEYS_OF_KIND_REQUEST"] = 1; + return values; + })(); + + return SecurityLevelMap; + })(); + + v0.GetIdentityKeysRequest = (function() { + + /** + * Properties of a GetIdentityKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityKeysRequest + * @property {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null} [v0] GetIdentityKeysRequest v0 + */ + + /** + * Constructs a new GetIdentityKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityKeysRequest. + * @implements IGetIdentityKeysRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set + */ + function GetIdentityKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityKeysRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + */ + GetIdentityKeysRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + */ + Object.defineProperty(GetIdentityKeysRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest instance + */ + GetIdentityKeysRequest.create = function create(properties) { + return new GetIdentityKeysRequest(properties); + }; + + /** + * Encodes the specified GetIdentityKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + */ + GetIdentityKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest} message GetIdentityKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityKeysRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysRequest.GetIdentityKeysRequestV0 = (function() { + + /** + * Properties of a GetIdentityKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @interface IGetIdentityKeysRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityKeysRequestV0 identityId + * @property {org.dash.platform.dapi.v0.IKeyRequestType|null} [requestType] GetIdentityKeysRequestV0 requestType + * @property {google.protobuf.IUInt32Value|null} [limit] GetIdentityKeysRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetIdentityKeysRequestV0 offset + * @property {boolean|null} [prove] GetIdentityKeysRequestV0 prove + */ + + /** + * Constructs a new GetIdentityKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @classdesc Represents a GetIdentityKeysRequestV0. + * @implements IGetIdentityKeysRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set + */ + function GetIdentityKeysRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityKeysRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityKeysRequestV0 requestType. + * @member {org.dash.platform.dapi.v0.IKeyRequestType|null|undefined} requestType + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.requestType = null; + + /** + * GetIdentityKeysRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.limit = null; + + /** + * GetIdentityKeysRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.offset = null; + + /** + * GetIdentityKeysRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityKeysRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 instance + */ + GetIdentityKeysRequestV0.create = function create(properties) { + return new GetIdentityKeysRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.requestType != null && Object.hasOwnProperty.call(message, "requestType")) + $root.org.dash.platform.dapi.v0.KeyRequestType.encode(message.requestType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.decode(reader, reader.uint32()); + break; + case 3: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.requestType != null && message.hasOwnProperty("requestType")) { + var error = $root.org.dash.platform.dapi.v0.KeyRequestType.verify(message.requestType); + if (error) + return "requestType." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityKeysRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + */ + GetIdentityKeysRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.requestType != null) { + if (typeof object.requestType !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.requestType: object expected"); + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.fromObject(object.requestType); + } + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.requestType = null; + object.limit = null; + object.offset = null; + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.requestType != null && message.hasOwnProperty("requestType")) + object.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.toObject(message.requestType, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityKeysRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityKeysRequestV0; + })(); + + return GetIdentityKeysRequest; + })(); + + v0.GetIdentityKeysResponse = (function() { + + /** + * Properties of a GetIdentityKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityKeysResponse + * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null} [v0] GetIdentityKeysResponse v0 + */ + + /** + * Constructs a new GetIdentityKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityKeysResponse. + * @implements IGetIdentityKeysResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set + */ + function GetIdentityKeysResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityKeysResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + */ + GetIdentityKeysResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + */ + Object.defineProperty(GetIdentityKeysResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse instance + */ + GetIdentityKeysResponse.create = function create(properties) { + return new GetIdentityKeysResponse(properties); + }; + + /** + * Encodes the specified GetIdentityKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + */ + GetIdentityKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} message GetIdentityKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityKeysResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysResponse.GetIdentityKeysResponseV0 = (function() { + + /** + * Properties of a GetIdentityKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @interface IGetIdentityKeysResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null} [keys] GetIdentityKeysResponseV0 keys + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityKeysResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityKeysResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @classdesc Represents a GetIdentityKeysResponseV0. + * @implements IGetIdentityKeysResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set + */ + function GetIdentityKeysResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityKeysResponseV0 keys. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null|undefined} keys + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.keys = null; + + /** + * GetIdentityKeysResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.proof = null; + + /** + * GetIdentityKeysResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysResponseV0 result. + * @member {"keys"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityKeysResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["keys", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 instance + */ + GetIdentityKeysResponseV0.create = function create(properties) { + return new GetIdentityKeysResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.encode(message.keys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.keys != null && message.hasOwnProperty("keys")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify(message.keys); + if (error) + return "keys." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityKeysResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + */ + GetIdentityKeysResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); + if (object.keys != null) { + if (typeof object.keys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.keys: object expected"); + message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.fromObject(object.keys); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.keys != null && message.hasOwnProperty("keys")) { + object.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.toObject(message.keys, options); + if (options.oneofs) + object.result = "keys"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityKeysResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysResponseV0.Keys = (function() { + + /** + * Properties of a Keys. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @interface IKeys + * @property {Array.|null} [keysBytes] Keys keysBytes + */ + + /** + * Constructs a new Keys. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @classdesc Represents a Keys. + * @implements IKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set + */ + function Keys(properties) { + this.keysBytes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Keys keysBytes. + * @member {Array.} keysBytes + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @instance + */ + Keys.prototype.keysBytes = $util.emptyArray; + + /** + * Creates a new Keys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys instance + */ + Keys.create = function create(properties) { + return new Keys(properties); + }; + + /** + * Encodes the specified Keys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Keys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keysBytes != null && message.keysBytes.length) + for (var i = 0; i < message.keysBytes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keysBytes[i]); + return writer; + }; + + /** + * Encodes the specified Keys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Keys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Keys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Keys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keysBytes && message.keysBytes.length)) + message.keysBytes = []; + message.keysBytes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Keys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Keys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Keys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Keys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { + if (!Array.isArray(message.keysBytes)) + return "keysBytes: array expected"; + for (var i = 0; i < message.keysBytes.length; ++i) + if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) + return "keysBytes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Keys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + */ + Keys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); + if (object.keysBytes) { + if (!Array.isArray(object.keysBytes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.keysBytes: array expected"); + message.keysBytes = []; + for (var i = 0; i < object.keysBytes.length; ++i) + if (typeof object.keysBytes[i] === "string") + $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); + else if (object.keysBytes[i].length >= 0) + message.keysBytes[i] = object.keysBytes[i]; + } + return message; + }; + + /** + * Creates a plain object from a Keys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} message Keys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Keys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keysBytes = []; + if (message.keysBytes && message.keysBytes.length) { + object.keysBytes = []; + for (var j = 0; j < message.keysBytes.length; ++j) + object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; + } + return object; + }; + + /** + * Converts this Keys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @instance + * @returns {Object.} JSON object + */ + Keys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Keys; + })(); + + return GetIdentityKeysResponseV0; + })(); + + return GetIdentityKeysResponse; + })(); + + v0.GetIdentitiesContractKeysRequest = (function() { + + /** + * Properties of a GetIdentitiesContractKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesContractKeysRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null} [v0] GetIdentitiesContractKeysRequest v0 + */ + + /** + * Constructs a new GetIdentitiesContractKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesContractKeysRequest. + * @implements IGetIdentitiesContractKeysRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set + */ + function GetIdentitiesContractKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesContractKeysRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + */ + GetIdentitiesContractKeysRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest instance + */ + GetIdentitiesContractKeysRequest.create = function create(properties) { + return new GetIdentitiesContractKeysRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + */ + GetIdentitiesContractKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesContractKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @interface IGetIdentitiesContractKeysRequestV0 + * @property {Array.|null} [identitiesIds] GetIdentitiesContractKeysRequestV0 identitiesIds + * @property {Uint8Array|null} [contractId] GetIdentitiesContractKeysRequestV0 contractId + * @property {string|null} [documentTypeName] GetIdentitiesContractKeysRequestV0 documentTypeName + * @property {Array.|null} [purposes] GetIdentitiesContractKeysRequestV0 purposes + * @property {boolean|null} [prove] GetIdentitiesContractKeysRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesContractKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @classdesc Represents a GetIdentitiesContractKeysRequestV0. + * @implements IGetIdentitiesContractKeysRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set + */ + function GetIdentitiesContractKeysRequestV0(properties) { + this.identitiesIds = []; + this.purposes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesContractKeysRequestV0 identitiesIds. + * @member {Array.} identitiesIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.identitiesIds = $util.emptyArray; + + /** + * GetIdentitiesContractKeysRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetIdentitiesContractKeysRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.documentTypeName = ""; + + /** + * GetIdentitiesContractKeysRequestV0 purposes. + * @member {Array.} purposes + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.purposes = $util.emptyArray; + + /** + * GetIdentitiesContractKeysRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesContractKeysRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 instance + */ + GetIdentitiesContractKeysRequestV0.create = function create(properties) { + return new GetIdentitiesContractKeysRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesIds != null && message.identitiesIds.length) + for (var i = 0; i < message.identitiesIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identitiesIds[i]); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentTypeName); + if (message.purposes != null && message.purposes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.purposes.length; ++i) + writer.int32(message.purposes[i]); + writer.ldelim(); + } + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identitiesIds && message.identitiesIds.length)) + message.identitiesIds = []; + message.identitiesIds.push(reader.bytes()); + break; + case 2: + message.contractId = reader.bytes(); + break; + case 3: + message.documentTypeName = reader.string(); + break; + case 4: + if (!(message.purposes && message.purposes.length)) + message.purposes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.purposes.push(reader.int32()); + } else + message.purposes.push(reader.int32()); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identitiesIds != null && message.hasOwnProperty("identitiesIds")) { + if (!Array.isArray(message.identitiesIds)) + return "identitiesIds: array expected"; + for (var i = 0; i < message.identitiesIds.length; ++i) + if (!(message.identitiesIds[i] && typeof message.identitiesIds[i].length === "number" || $util.isString(message.identitiesIds[i]))) + return "identitiesIds: buffer[] expected"; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.purposes != null && message.hasOwnProperty("purposes")) { + if (!Array.isArray(message.purposes)) + return "purposes: array expected"; + for (var i = 0; i < message.purposes.length; ++i) + switch (message.purposes[i]) { + default: + return "purposes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + */ + GetIdentitiesContractKeysRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); + if (object.identitiesIds) { + if (!Array.isArray(object.identitiesIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.identitiesIds: array expected"); + message.identitiesIds = []; + for (var i = 0; i < object.identitiesIds.length; ++i) + if (typeof object.identitiesIds[i] === "string") + $util.base64.decode(object.identitiesIds[i], message.identitiesIds[i] = $util.newBuffer($util.base64.length(object.identitiesIds[i])), 0); + else if (object.identitiesIds[i].length >= 0) + message.identitiesIds[i] = object.identitiesIds[i]; + } + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.purposes) { + if (!Array.isArray(object.purposes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.purposes: array expected"); + message.purposes = []; + for (var i = 0; i < object.purposes.length; ++i) + switch (object.purposes[i]) { + default: + case "AUTHENTICATION": + case 0: + message.purposes[i] = 0; + break; + case "ENCRYPTION": + case 1: + message.purposes[i] = 1; + break; + case "DECRYPTION": + case 2: + message.purposes[i] = 2; + break; + case "TRANSFER": + case 3: + message.purposes[i] = 3; + break; + case "VOTING": + case 5: + message.purposes[i] = 5; + break; + } + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.identitiesIds = []; + object.purposes = []; + } + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.prove = false; + } + if (message.identitiesIds && message.identitiesIds.length) { + object.identitiesIds = []; + for (var j = 0; j < message.identitiesIds.length; ++j) + object.identitiesIds[j] = options.bytes === String ? $util.base64.encode(message.identitiesIds[j], 0, message.identitiesIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identitiesIds[j]) : message.identitiesIds[j]; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.purposes && message.purposes.length) { + object.purposes = []; + for (var j = 0; j < message.purposes.length; ++j) + object.purposes[j] = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purposes[j]] : message.purposes[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesContractKeysRequestV0; + })(); + + return GetIdentitiesContractKeysRequest; + })(); + + v0.GetIdentitiesContractKeysResponse = (function() { + + /** + * Properties of a GetIdentitiesContractKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesContractKeysResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null} [v0] GetIdentitiesContractKeysResponse v0 + */ + + /** + * Constructs a new GetIdentitiesContractKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesContractKeysResponse. + * @implements IGetIdentitiesContractKeysResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set + */ + function GetIdentitiesContractKeysResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesContractKeysResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + */ + GetIdentitiesContractKeysResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse instance + */ + GetIdentitiesContractKeysResponse.create = function create(properties) { + return new GetIdentitiesContractKeysResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + */ + GetIdentitiesContractKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesContractKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @interface IGetIdentitiesContractKeysResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null} [identitiesKeys] GetIdentitiesContractKeysResponseV0 identitiesKeys + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesContractKeysResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesContractKeysResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesContractKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @classdesc Represents a GetIdentitiesContractKeysResponseV0. + * @implements IGetIdentitiesContractKeysResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set + */ + function GetIdentitiesContractKeysResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesContractKeysResponseV0 identitiesKeys. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null|undefined} identitiesKeys + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.identitiesKeys = null; + + /** + * GetIdentitiesContractKeysResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.proof = null; + + /** + * GetIdentitiesContractKeysResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysResponseV0 result. + * @member {"identitiesKeys"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identitiesKeys", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 instance + */ + GetIdentitiesContractKeysResponseV0.create = function create(properties) { + return new GetIdentitiesContractKeysResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesKeys != null && Object.hasOwnProperty.call(message, "identitiesKeys")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.encode(message.identitiesKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify(message.identitiesKeys); + if (error) + return "identitiesKeys." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + */ + GetIdentitiesContractKeysResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); + if (object.identitiesKeys != null) { + if (typeof object.identitiesKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.identitiesKeys: object expected"); + message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.fromObject(object.identitiesKeys); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { + object.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.toObject(message.identitiesKeys, options); + if (options.oneofs) + object.result = "identitiesKeys"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysResponseV0.PurposeKeys = (function() { + + /** + * Properties of a PurposeKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IPurposeKeys + * @property {org.dash.platform.dapi.v0.KeyPurpose|null} [purpose] PurposeKeys purpose + * @property {Array.|null} [keysBytes] PurposeKeys keysBytes + */ + + /** + * Constructs a new PurposeKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents a PurposeKeys. + * @implements IPurposeKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set + */ + function PurposeKeys(properties) { + this.keysBytes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurposeKeys purpose. + * @member {org.dash.platform.dapi.v0.KeyPurpose} purpose + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + */ + PurposeKeys.prototype.purpose = 0; + + /** + * PurposeKeys keysBytes. + * @member {Array.} keysBytes + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + */ + PurposeKeys.prototype.keysBytes = $util.emptyArray; + + /** + * Creates a new PurposeKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys instance + */ + PurposeKeys.create = function create(properties) { + return new PurposeKeys(properties); + }; + + /** + * Encodes the specified PurposeKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurposeKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purpose != null && Object.hasOwnProperty.call(message, "purpose")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.purpose); + if (message.keysBytes != null && message.keysBytes.length) + for (var i = 0; i < message.keysBytes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keysBytes[i]); + return writer; + }; + + /** + * Encodes the specified PurposeKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurposeKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurposeKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurposeKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purpose = reader.int32(); + break; + case 2: + if (!(message.keysBytes && message.keysBytes.length)) + message.keysBytes = []; + message.keysBytes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurposeKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurposeKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurposeKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurposeKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purpose != null && message.hasOwnProperty("purpose")) + switch (message.purpose) { + default: + return "purpose: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { + if (!Array.isArray(message.keysBytes)) + return "keysBytes: array expected"; + for (var i = 0; i < message.keysBytes.length; ++i) + if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) + return "keysBytes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a PurposeKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + */ + PurposeKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); + switch (object.purpose) { + case "AUTHENTICATION": + case 0: + message.purpose = 0; + break; + case "ENCRYPTION": + case 1: + message.purpose = 1; + break; + case "DECRYPTION": + case 2: + message.purpose = 2; + break; + case "TRANSFER": + case 3: + message.purpose = 3; + break; + case "VOTING": + case 5: + message.purpose = 5; + break; + } + if (object.keysBytes) { + if (!Array.isArray(object.keysBytes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.keysBytes: array expected"); + message.keysBytes = []; + for (var i = 0; i < object.keysBytes.length; ++i) + if (typeof object.keysBytes[i] === "string") + $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); + else if (object.keysBytes[i].length >= 0) + message.keysBytes[i] = object.keysBytes[i]; + } + return message; + }; + + /** + * Creates a plain object from a PurposeKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} message PurposeKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurposeKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keysBytes = []; + if (options.defaults) + object.purpose = options.enums === String ? "AUTHENTICATION" : 0; + if (message.purpose != null && message.hasOwnProperty("purpose")) + object.purpose = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purpose] : message.purpose; + if (message.keysBytes && message.keysBytes.length) { + object.keysBytes = []; + for (var j = 0; j < message.keysBytes.length; ++j) + object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; + } + return object; + }; + + /** + * Converts this PurposeKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + * @returns {Object.} JSON object + */ + PurposeKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PurposeKeys; + })(); + + GetIdentitiesContractKeysResponseV0.IdentityKeys = (function() { + + /** + * Properties of an IdentityKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IIdentityKeys + * @property {Uint8Array|null} [identityId] IdentityKeys identityId + * @property {Array.|null} [keys] IdentityKeys keys + */ + + /** + * Constructs a new IdentityKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents an IdentityKeys. + * @implements IIdentityKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set + */ + function IdentityKeys(properties) { + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityKeys identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + */ + IdentityKeys.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityKeys keys. + * @member {Array.} keys + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + */ + IdentityKeys.prototype.keys = $util.emptyArray; + + /** + * Creates a new IdentityKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys instance + */ + IdentityKeys.create = function create(properties) { + return new IdentityKeys(properties); + }; + + /** + * Encodes the specified IdentityKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.encode(message.keys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + return null; + }; + + /** + * Creates an IdentityKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + */ + IdentityKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: object expected"); + message.keys[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.fromObject(object.keys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} message IdentityKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.toObject(message.keys[j], options); + } + return object; + }; + + /** + * Converts this IdentityKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + * @returns {Object.} JSON object + */ + IdentityKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityKeys; + })(); + + GetIdentitiesContractKeysResponseV0.IdentitiesKeys = (function() { + + /** + * Properties of an IdentitiesKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IIdentitiesKeys + * @property {Array.|null} [entries] IdentitiesKeys entries + */ + + /** + * Constructs a new IdentitiesKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents an IdentitiesKeys. + * @implements IIdentitiesKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set + */ + function IdentitiesKeys(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentitiesKeys entries. + * @member {Array.} entries + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @instance + */ + IdentitiesKeys.prototype.entries = $util.emptyArray; + + /** + * Creates a new IdentitiesKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys instance + */ + IdentitiesKeys.create = function create(properties) { + return new IdentitiesKeys(properties); + }; + + /** + * Encodes the specified IdentitiesKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentitiesKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentitiesKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentitiesKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentitiesKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitiesKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an IdentitiesKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + */ + IdentitiesKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: object expected"); + message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentitiesKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} message IdentitiesKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitiesKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this IdentitiesKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @instance + * @returns {Object.} JSON object + */ + IdentitiesKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentitiesKeys; + })(); + + return GetIdentitiesContractKeysResponseV0; + })(); + + return GetIdentitiesContractKeysResponse; + })(); + + v0.GetEvonodesProposedEpochBlocksByIdsRequest = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByIdsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksByIdsRequest + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByIdsRequest v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequest. + * @implements IGetEvonodesProposedEpochBlocksByIdsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByIdsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksByIdsRequest v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByIdsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByIdsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest instance + */ + GetEvonodesProposedEpochBlocksByIdsRequest.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByIdsRequest(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByIdsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByIdsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByIdsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + */ + GetEvonodesProposedEpochBlocksByIdsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByIdsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByIdsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByIdsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @interface IGetEvonodesProposedEpochBlocksByIdsRequestV0 + * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch + * @property {Array.|null} [ids] GetEvonodesProposedEpochBlocksByIdsRequestV0 ids + * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByIdsRequestV0 prove + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @implements IGetEvonodesProposedEpochBlocksByIdsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByIdsRequestV0(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.epoch = 0; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.prove = false; + + /** + * Creates a new GetEvonodesProposedEpochBlocksByIdsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByIdsRequestV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.uint32(); + break; + case 2: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) { + object.epoch = 0; + object.prove = false; + } + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByIdsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEvonodesProposedEpochBlocksByIdsRequestV0; + })(); + + return GetEvonodesProposedEpochBlocksByIdsRequest; + })(); + + v0.GetEvonodesProposedEpochBlocksResponse = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksResponse + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null} [v0] GetEvonodesProposedEpochBlocksResponse v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksResponse. + * @implements IGetEvonodesProposedEpochBlocksResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksResponse v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + */ + GetEvonodesProposedEpochBlocksResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse instance + */ + GetEvonodesProposedEpochBlocksResponse.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksResponse(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + */ + GetEvonodesProposedEpochBlocksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @interface IGetEvonodesProposedEpochBlocksResponseV0 + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null} [evonodesProposedBlockCountsInfo] GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEvonodesProposedEpochBlocksResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEvonodesProposedEpochBlocksResponseV0 metadata + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @classdesc Represents a GetEvonodesProposedEpochBlocksResponseV0. + * @implements IGetEvonodesProposedEpochBlocksResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null|undefined} evonodesProposedBlockCountsInfo + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.evonodesProposedBlockCountsInfo = null; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.proof = null; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 result. + * @member {"evonodesProposedBlockCountsInfo"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["evonodesProposedBlockCountsInfo", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 instance + */ + GetEvonodesProposedEpochBlocksResponseV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksResponseV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evonodesProposedBlockCountsInfo != null && Object.hasOwnProperty.call(message, "evonodesProposedBlockCountsInfo")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.encode(message.evonodesProposedBlockCountsInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify(message.evonodesProposedBlockCountsInfo); + if (error) + return "evonodesProposedBlockCountsInfo." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + */ + GetEvonodesProposedEpochBlocksResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); + if (object.evonodesProposedBlockCountsInfo != null) { + if (typeof object.evonodesProposedBlockCountsInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.evonodesProposedBlockCountsInfo: object expected"); + message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.fromObject(object.evonodesProposedBlockCountsInfo); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { + object.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.toObject(message.evonodesProposedBlockCountsInfo, options); + if (options.oneofs) + object.result = "evonodesProposedBlockCountsInfo"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks = (function() { + + /** + * Properties of an EvonodeProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @interface IEvonodeProposedBlocks + * @property {Uint8Array|null} [proTxHash] EvonodeProposedBlocks proTxHash + * @property {number|Long|null} [count] EvonodeProposedBlocks count + */ + + /** + * Constructs a new EvonodeProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @classdesc Represents an EvonodeProposedBlocks. + * @implements IEvonodeProposedBlocks + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set + */ + function EvonodeProposedBlocks(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvonodeProposedBlocks proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + */ + EvonodeProposedBlocks.prototype.proTxHash = $util.newBuffer([]); + + /** + * EvonodeProposedBlocks count. + * @member {number|Long} count + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + */ + EvonodeProposedBlocks.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new EvonodeProposedBlocks instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks instance + */ + EvonodeProposedBlocks.create = function create(properties) { + return new EvonodeProposedBlocks(properties); + }; + + /** + * Encodes the specified EvonodeProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodeProposedBlocks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.count); + return writer; + }; + + /** + * Encodes the specified EvonodeProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodeProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvonodeProposedBlocks message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodeProposedBlocks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.count = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvonodeProposedBlocks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodeProposedBlocks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvonodeProposedBlocks message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvonodeProposedBlocks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates an EvonodeProposedBlocks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + */ + EvonodeProposedBlocks.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = true; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an EvonodeProposedBlocks message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} message EvonodeProposedBlocks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvonodeProposedBlocks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber(true) : message.count; + return object; + }; + + /** + * Converts this EvonodeProposedBlocks to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + * @returns {Object.} JSON object + */ + EvonodeProposedBlocks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvonodeProposedBlocks; + })(); + + GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks = (function() { + + /** + * Properties of an EvonodesProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @interface IEvonodesProposedBlocks + * @property {Array.|null} [evonodesProposedBlockCounts] EvonodesProposedBlocks evonodesProposedBlockCounts + */ + + /** + * Constructs a new EvonodesProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @classdesc Represents an EvonodesProposedBlocks. + * @implements IEvonodesProposedBlocks + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set + */ + function EvonodesProposedBlocks(properties) { + this.evonodesProposedBlockCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvonodesProposedBlocks evonodesProposedBlockCounts. + * @member {Array.} evonodesProposedBlockCounts + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @instance + */ + EvonodesProposedBlocks.prototype.evonodesProposedBlockCounts = $util.emptyArray; + + /** + * Creates a new EvonodesProposedBlocks instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks instance + */ + EvonodesProposedBlocks.create = function create(properties) { + return new EvonodesProposedBlocks(properties); + }; + + /** + * Encodes the specified EvonodesProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodesProposedBlocks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evonodesProposedBlockCounts != null && message.evonodesProposedBlockCounts.length) + for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.encode(message.evonodesProposedBlockCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvonodesProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodesProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvonodesProposedBlocks message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodesProposedBlocks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length)) + message.evonodesProposedBlockCounts = []; + message.evonodesProposedBlockCounts.push($root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvonodesProposedBlocks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodesProposedBlocks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvonodesProposedBlocks message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvonodesProposedBlocks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evonodesProposedBlockCounts != null && message.hasOwnProperty("evonodesProposedBlockCounts")) { + if (!Array.isArray(message.evonodesProposedBlockCounts)) + return "evonodesProposedBlockCounts: array expected"; + for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify(message.evonodesProposedBlockCounts[i]); + if (error) + return "evonodesProposedBlockCounts." + error; + } + } + return null; + }; + + /** + * Creates an EvonodesProposedBlocks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + */ + EvonodesProposedBlocks.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); + if (object.evonodesProposedBlockCounts) { + if (!Array.isArray(object.evonodesProposedBlockCounts)) + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: array expected"); + message.evonodesProposedBlockCounts = []; + for (var i = 0; i < object.evonodesProposedBlockCounts.length; ++i) { + if (typeof object.evonodesProposedBlockCounts[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: object expected"); + message.evonodesProposedBlockCounts[i] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.fromObject(object.evonodesProposedBlockCounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EvonodesProposedBlocks message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} message EvonodesProposedBlocks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvonodesProposedBlocks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evonodesProposedBlockCounts = []; + if (message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length) { + object.evonodesProposedBlockCounts = []; + for (var j = 0; j < message.evonodesProposedBlockCounts.length; ++j) + object.evonodesProposedBlockCounts[j] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.toObject(message.evonodesProposedBlockCounts[j], options); + } + return object; + }; + + /** + * Converts this EvonodesProposedBlocks to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @instance + * @returns {Object.} JSON object + */ + EvonodesProposedBlocks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvonodesProposedBlocks; + })(); + + return GetEvonodesProposedEpochBlocksResponseV0; + })(); + + return GetEvonodesProposedEpochBlocksResponse; + })(); + + v0.GetEvonodesProposedEpochBlocksByRangeRequest = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByRangeRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksByRangeRequest + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByRangeRequest v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequest. + * @implements IGetEvonodesProposedEpochBlocksByRangeRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByRangeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksByRangeRequest v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByRangeRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest instance + */ + GetEvonodesProposedEpochBlocksByRangeRequest.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByRangeRequest(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByRangeRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByRangeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByRangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + */ + GetEvonodesProposedEpochBlocksByRangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByRangeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByRangeRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByRangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @interface IGetEvonodesProposedEpochBlocksByRangeRequestV0 + * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch + * @property {number|null} [limit] GetEvonodesProposedEpochBlocksByRangeRequestV0 limit + * @property {Uint8Array|null} [startAfter] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter + * @property {Uint8Array|null} [startAt] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt + * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByRangeRequestV0 prove + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @implements IGetEvonodesProposedEpochBlocksByRangeRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByRangeRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.epoch = 0; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.limit = 0; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAfter = $util.newBuffer([]); + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAt = $util.newBuffer([]); + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByRangeRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByRangeRequestV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.uint32(); + break; + case 2: + message.limit = reader.uint32(); + break; + case 3: + message.startAfter = reader.bytes(); + break; + case 4: + message.startAt = reader.bytes(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.epoch = 0; + object.limit = 0; + object.prove = false; + } + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (options.oneofs) + object.start = "startAfter"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; + if (options.oneofs) + object.start = "startAt"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByRangeRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEvonodesProposedEpochBlocksByRangeRequestV0; + })(); + + return GetEvonodesProposedEpochBlocksByRangeRequest; + })(); + + v0.GetIdentitiesBalancesRequest = (function() { + + /** + * Properties of a GetIdentitiesBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null} [v0] GetIdentitiesBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentitiesBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesBalancesRequest. + * @implements IGetIdentitiesBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set + */ + function GetIdentitiesBalancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + */ + GetIdentitiesBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest instance + */ + GetIdentitiesBalancesRequest.create = function create(properties) { + return new GetIdentitiesBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + */ + GetIdentitiesBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @interface IGetIdentitiesBalancesRequestV0 + * @property {Array.|null} [ids] GetIdentitiesBalancesRequestV0 ids + * @property {boolean|null} [prove] GetIdentitiesBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @classdesc Represents a GetIdentitiesBalancesRequestV0. + * @implements IGetIdentitiesBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentitiesBalancesRequestV0(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesBalancesRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + */ + GetIdentitiesBalancesRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetIdentitiesBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + */ + GetIdentitiesBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 instance + */ + GetIdentitiesBalancesRequestV0.create = function create(properties) { + return new GetIdentitiesBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + */ + GetIdentitiesBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) + object.prove = false; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesBalancesRequestV0; + })(); + + return GetIdentitiesBalancesRequest; + })(); + + v0.GetIdentitiesBalancesResponse = (function() { + + /** + * Properties of a GetIdentitiesBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null} [v0] GetIdentitiesBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentitiesBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesBalancesResponse. + * @implements IGetIdentitiesBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set + */ + function GetIdentitiesBalancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + */ + GetIdentitiesBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse instance + */ + GetIdentitiesBalancesResponse.create = function create(properties) { + return new GetIdentitiesBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + */ + GetIdentitiesBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @interface IGetIdentitiesBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null} [identitiesBalances] GetIdentitiesBalancesResponseV0 identitiesBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @classdesc Represents a GetIdentitiesBalancesResponseV0. + * @implements IGetIdentitiesBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentitiesBalancesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesBalancesResponseV0 identitiesBalances. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null|undefined} identitiesBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.identitiesBalances = null; + + /** + * GetIdentitiesBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentitiesBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesResponseV0 result. + * @member {"identitiesBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identitiesBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 instance + */ + GetIdentitiesBalancesResponseV0.create = function create(properties) { + return new GetIdentitiesBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesBalances != null && Object.hasOwnProperty.call(message, "identitiesBalances")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.encode(message.identitiesBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify(message.identitiesBalances); + if (error) + return "identitiesBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + */ + GetIdentitiesBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); + if (object.identitiesBalances != null) { + if (typeof object.identitiesBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.identitiesBalances: object expected"); + message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.fromObject(object.identitiesBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { + object.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.toObject(message.identitiesBalances, options); + if (options.oneofs) + object.result = "identitiesBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesResponseV0.IdentityBalance = (function() { + + /** + * Properties of an IdentityBalance. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @interface IIdentityBalance + * @property {Uint8Array|null} [identityId] IdentityBalance identityId + * @property {number|Long|null} [balance] IdentityBalance balance + */ + + /** + * Constructs a new IdentityBalance. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @classdesc Represents an IdentityBalance. + * @implements IIdentityBalance + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set + */ + function IdentityBalance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityBalance identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + */ + IdentityBalance.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityBalance balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + */ + IdentityBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new IdentityBalance instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance instance + */ + IdentityBalance.create = function create(properties) { + return new IdentityBalance(properties); + }; + + /** + * Encodes the specified IdentityBalance message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityBalance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified IdentityBalance message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityBalance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityBalance message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityBalance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityBalance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityBalance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityBalance message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityBalance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates an IdentityBalance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + */ + IdentityBalance.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an IdentityBalance message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} message IdentityBalance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityBalance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this IdentityBalance to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + * @returns {Object.} JSON object + */ + IdentityBalance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityBalance; + })(); + + GetIdentitiesBalancesResponseV0.IdentitiesBalances = (function() { + + /** + * Properties of an IdentitiesBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @interface IIdentitiesBalances + * @property {Array.|null} [entries] IdentitiesBalances entries + */ + + /** + * Constructs a new IdentitiesBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @classdesc Represents an IdentitiesBalances. + * @implements IIdentitiesBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set + */ + function IdentitiesBalances(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentitiesBalances entries. + * @member {Array.} entries + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @instance + */ + IdentitiesBalances.prototype.entries = $util.emptyArray; + + /** + * Creates a new IdentitiesBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances instance + */ + IdentitiesBalances.create = function create(properties) { + return new IdentitiesBalances(properties); + }; + + /** + * Encodes the specified IdentitiesBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentitiesBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentitiesBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesBalances.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentitiesBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentitiesBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitiesBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an IdentitiesBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + */ + IdentitiesBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: object expected"); + message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentitiesBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} message IdentitiesBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitiesBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this IdentitiesBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @instance + * @returns {Object.} JSON object + */ + IdentitiesBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentitiesBalances; + })(); + + return GetIdentitiesBalancesResponseV0; + })(); + + return GetIdentitiesBalancesResponse; + })(); + + v0.GetDataContractRequest = (function() { + + /** + * Properties of a GetDataContractRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractRequest + * @property {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null} [v0] GetDataContractRequest v0 + */ + + /** + * Constructs a new GetDataContractRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractRequest. + * @implements IGetDataContractRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set + */ + function GetDataContractRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + */ + GetDataContractRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + */ + Object.defineProperty(GetDataContractRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest instance + */ + GetDataContractRequest.create = function create(properties) { + return new GetDataContractRequest(properties); + }; + + /** + * Encodes the specified GetDataContractRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + */ + GetDataContractRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest} message GetDataContractRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractRequest.GetDataContractRequestV0 = (function() { + + /** + * Properties of a GetDataContractRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @interface IGetDataContractRequestV0 + * @property {Uint8Array|null} [id] GetDataContractRequestV0 id + * @property {boolean|null} [prove] GetDataContractRequestV0 prove + */ + + /** + * Constructs a new GetDataContractRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @classdesc Represents a GetDataContractRequestV0. + * @implements IGetDataContractRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set + */ + function GetDataContractRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + */ + GetDataContractRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetDataContractRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + */ + GetDataContractRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 instance + */ + GetDataContractRequestV0.create = function create(properties) { + return new GetDataContractRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + */ + GetDataContractRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} message GetDataContractRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractRequestV0; + })(); + + return GetDataContractRequest; + })(); + + v0.GetDataContractResponse = (function() { + + /** + * Properties of a GetDataContractResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractResponse + * @property {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null} [v0] GetDataContractResponse v0 + */ + + /** + * Constructs a new GetDataContractResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractResponse. + * @implements IGetDataContractResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + */ + function GetDataContractResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + GetDataContractResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + Object.defineProperty(GetDataContractResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse instance + */ + GetDataContractResponse.create = function create(properties) { + return new GetDataContractResponse(properties); + }; + + /** + * Encodes the specified GetDataContractResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + */ + GetDataContractResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse} message GetDataContractResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractResponse.GetDataContractResponseV0 = (function() { + + /** + * Properties of a GetDataContractResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @interface IGetDataContractResponseV0 + * @property {Uint8Array|null} [dataContract] GetDataContractResponseV0 dataContract + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @classdesc Represents a GetDataContractResponseV0. + * @implements IGetDataContractResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set + */ + function GetDataContractResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractResponseV0 dataContract. + * @member {Uint8Array} dataContract + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.dataContract = $util.newBuffer([]); + + /** + * GetDataContractResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.proof = null; + + /** + * GetDataContractResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractResponseV0 result. + * @member {"dataContract"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContract", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 instance + */ + GetDataContractResponseV0.create = function create(properties) { + return new GetDataContractResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContract); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContract = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + properties.result = 1; + if (!(message.dataContract && typeof message.dataContract.length === "number" || $util.isString(message.dataContract))) + return "dataContract: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + */ + GetDataContractResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); + if (object.dataContract != null) + if (typeof object.dataContract === "string") + $util.base64.decode(object.dataContract, message.dataContract = $util.newBuffer($util.base64.length(object.dataContract)), 0); + else if (object.dataContract.length >= 0) + message.dataContract = object.dataContract; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} message GetDataContractResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + object.dataContract = options.bytes === String ? $util.base64.encode(message.dataContract, 0, message.dataContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContract) : message.dataContract; + if (options.oneofs) + object.result = "dataContract"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractResponseV0; + })(); + + return GetDataContractResponse; + })(); + + v0.GetDataContractsRequest = (function() { + + /** + * Properties of a GetDataContractsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractsRequest + * @property {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null} [v0] GetDataContractsRequest v0 + */ + + /** + * Constructs a new GetDataContractsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractsRequest. + * @implements IGetDataContractsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set + */ + function GetDataContractsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + */ + GetDataContractsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + */ + Object.defineProperty(GetDataContractsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest instance + */ + GetDataContractsRequest.create = function create(properties) { + return new GetDataContractsRequest(properties); + }; + + /** + * Encodes the specified GetDataContractsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + */ + GetDataContractsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest} message GetDataContractsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractsRequest.GetDataContractsRequestV0 = (function() { + + /** + * Properties of a GetDataContractsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @interface IGetDataContractsRequestV0 + * @property {Array.|null} [ids] GetDataContractsRequestV0 ids + * @property {boolean|null} [prove] GetDataContractsRequestV0 prove + */ + + /** + * Constructs a new GetDataContractsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @classdesc Represents a GetDataContractsRequestV0. + * @implements IGetDataContractsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set + */ + function GetDataContractsRequestV0(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + */ + GetDataContractsRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetDataContractsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + */ + GetDataContractsRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 instance + */ + GetDataContractsRequestV0.create = function create(properties) { + return new GetDataContractsRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + */ + GetDataContractsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} message GetDataContractsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) + object.prove = false; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractsRequestV0; + })(); + + return GetDataContractsRequest; + })(); + + v0.GetDataContractsResponse = (function() { + + /** + * Properties of a GetDataContractsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractsResponse + * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null} [v0] GetDataContractsResponse v0 + */ + + /** + * Constructs a new GetDataContractsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractsResponse. + * @implements IGetDataContractsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set + */ + function GetDataContractsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + GetDataContractsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + Object.defineProperty(GetDataContractsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse instance + */ + GetDataContractsResponse.create = function create(properties) { + return new GetDataContractsResponse(properties); + }; + + /** + * Encodes the specified GetDataContractsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + */ + GetDataContractsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} message GetDataContractsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractsResponse.DataContractEntry = (function() { + + /** + * Properties of a DataContractEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContractEntry + * @property {Uint8Array|null} [identifier] DataContractEntry identifier + * @property {google.protobuf.IBytesValue|null} [dataContract] DataContractEntry dataContract + */ + + /** + * Constructs a new DataContractEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContractEntry. + * @implements IDataContractEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set + */ + function DataContractEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContractEntry identifier. + * @member {Uint8Array} identifier + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + */ + DataContractEntry.prototype.identifier = $util.newBuffer([]); + + /** + * DataContractEntry dataContract. + * @member {google.protobuf.IBytesValue|null|undefined} dataContract + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + */ + DataContractEntry.prototype.dataContract = null; + + /** + * Creates a new DataContractEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry instance + */ + DataContractEntry.create = function create(properties) { + return new DataContractEntry(properties); + }; + + /** + * Encodes the specified DataContractEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); + if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) + $root.google.protobuf.BytesValue.encode(message.dataContract, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContractEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.bytes(); + break; + case 2: + message.dataContract = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifier != null && message.hasOwnProperty("identifier")) + if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) + return "identifier: buffer expected"; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + var error = $root.google.protobuf.BytesValue.verify(message.dataContract); + if (error) + return "dataContract." + error; + } + return null; + }; + + /** + * Creates a DataContractEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + */ + DataContractEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); + if (object.identifier != null) + if (typeof object.identifier === "string") + $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); + else if (object.identifier.length >= 0) + message.identifier = object.identifier; + if (object.dataContract != null) { + if (typeof object.dataContract !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.dataContract: object expected"); + message.dataContract = $root.google.protobuf.BytesValue.fromObject(object.dataContract); + } + return message; + }; + + /** + * Creates a plain object from a DataContractEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} message DataContractEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identifier = ""; + else { + object.identifier = []; + if (options.bytes !== Array) + object.identifier = $util.newBuffer(object.identifier); + } + object.dataContract = null; + } + if (message.identifier != null && message.hasOwnProperty("identifier")) + object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) + object.dataContract = $root.google.protobuf.BytesValue.toObject(message.dataContract, options); + return object; + }; + + /** + * Converts this DataContractEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + * @returns {Object.} JSON object + */ + DataContractEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractEntry; + })(); + + GetDataContractsResponse.DataContracts = (function() { + + /** + * Properties of a DataContracts. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContracts + * @property {Array.|null} [dataContractEntries] DataContracts dataContractEntries + */ + + /** + * Constructs a new DataContracts. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContracts. + * @implements IDataContracts + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set + */ + function DataContracts(properties) { + this.dataContractEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContracts dataContractEntries. + * @member {Array.} dataContractEntries + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @instance + */ + DataContracts.prototype.dataContractEntries = $util.emptyArray; + + /** + * Creates a new DataContracts instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts instance + */ + DataContracts.create = function create(properties) { + return new DataContracts(properties); + }; + + /** + * Encodes the specified DataContracts message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContracts.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractEntries != null && message.dataContractEntries.length) + for (var i = 0; i < message.dataContractEntries.length; ++i) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContracts message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContracts.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContracts message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContracts.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataContractEntries && message.dataContractEntries.length)) + message.dataContractEntries = []; + message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContracts message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContracts.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContracts message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContracts.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { + if (!Array.isArray(message.dataContractEntries)) + return "dataContractEntries: array expected"; + for (var i = 0; i < message.dataContractEntries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify(message.dataContractEntries[i]); + if (error) + return "dataContractEntries." + error; + } + } + return null; + }; + + /** + * Creates a DataContracts message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + */ + DataContracts.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); + if (object.dataContractEntries) { + if (!Array.isArray(object.dataContractEntries)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: array expected"); + message.dataContractEntries = []; + for (var i = 0; i < object.dataContractEntries.length; ++i) { + if (typeof object.dataContractEntries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: object expected"); + message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.fromObject(object.dataContractEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataContracts message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} message DataContracts + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContracts.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataContractEntries = []; + if (message.dataContractEntries && message.dataContractEntries.length) { + object.dataContractEntries = []; + for (var j = 0; j < message.dataContractEntries.length; ++j) + object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject(message.dataContractEntries[j], options); + } + return object; + }; + + /** + * Converts this DataContracts to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @instance + * @returns {Object.} JSON object + */ + DataContracts.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContracts; + })(); + + GetDataContractsResponse.GetDataContractsResponseV0 = (function() { + + /** + * Properties of a GetDataContractsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IGetDataContractsResponseV0 + * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null} [dataContracts] GetDataContractsResponseV0 dataContracts + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractsResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a GetDataContractsResponseV0. + * @implements IGetDataContractsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set + */ + function GetDataContractsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsResponseV0 dataContracts. + * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null|undefined} dataContracts + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.dataContracts = null; + + /** + * GetDataContractsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.proof = null; + + /** + * GetDataContractsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsResponseV0 result. + * @member {"dataContracts"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContracts", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 instance + */ + GetDataContractsResponseV0.create = function create(properties) { + return new GetDataContractsResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContracts != null && Object.hasOwnProperty.call(message, "dataContracts")) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.encode(message.dataContracts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify(message.dataContracts); + if (error) + return "dataContracts." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + */ + GetDataContractsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); + if (object.dataContracts != null) { + if (typeof object.dataContracts !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.dataContracts: object expected"); + message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.fromObject(object.dataContracts); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} message GetDataContractsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { + object.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(message.dataContracts, options); + if (options.oneofs) + object.result = "dataContracts"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractsResponseV0; + })(); + + return GetDataContractsResponse; + })(); + + v0.GetDataContractHistoryRequest = (function() { + + /** + * Properties of a GetDataContractHistoryRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractHistoryRequest + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null} [v0] GetDataContractHistoryRequest v0 + */ + + /** + * Constructs a new GetDataContractHistoryRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractHistoryRequest. + * @implements IGetDataContractHistoryRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set + */ + function GetDataContractHistoryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractHistoryRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + */ + GetDataContractHistoryRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + */ + Object.defineProperty(GetDataContractHistoryRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest instance + */ + GetDataContractHistoryRequest.create = function create(properties) { + return new GetDataContractHistoryRequest(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + */ + GetDataContractHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} message GetDataContractHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractHistoryRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 = (function() { + + /** + * Properties of a GetDataContractHistoryRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @interface IGetDataContractHistoryRequestV0 + * @property {Uint8Array|null} [id] GetDataContractHistoryRequestV0 id + * @property {google.protobuf.IUInt32Value|null} [limit] GetDataContractHistoryRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetDataContractHistoryRequestV0 offset + * @property {number|Long|null} [startAtMs] GetDataContractHistoryRequestV0 startAtMs + * @property {boolean|null} [prove] GetDataContractHistoryRequestV0 prove + */ + + /** + * Constructs a new GetDataContractHistoryRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @classdesc Represents a GetDataContractHistoryRequestV0. + * @implements IGetDataContractHistoryRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set + */ + function GetDataContractHistoryRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractHistoryRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetDataContractHistoryRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.limit = null; + + /** + * GetDataContractHistoryRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.offset = null; + + /** + * GetDataContractHistoryRequestV0 startAtMs. + * @member {number|Long} startAtMs + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.startAtMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetDataContractHistoryRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractHistoryRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 instance + */ + GetDataContractHistoryRequestV0.create = function create(properties) { + return new GetDataContractHistoryRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startAtMs != null && Object.hasOwnProperty.call(message, "startAtMs")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startAtMs); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 3: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.startAtMs = reader.uint64(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) + if (!$util.isInteger(message.startAtMs) && !(message.startAtMs && $util.isInteger(message.startAtMs.low) && $util.isInteger(message.startAtMs.high))) + return "startAtMs: integer|Long expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractHistoryRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + */ + GetDataContractHistoryRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.startAtMs != null) + if ($util.Long) + (message.startAtMs = $util.Long.fromValue(object.startAtMs)).unsigned = true; + else if (typeof object.startAtMs === "string") + message.startAtMs = parseInt(object.startAtMs, 10); + else if (typeof object.startAtMs === "number") + message.startAtMs = object.startAtMs; + else if (typeof object.startAtMs === "object") + message.startAtMs = new $util.LongBits(object.startAtMs.low >>> 0, object.startAtMs.high >>> 0).toNumber(true); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.limit = null; + object.offset = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startAtMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startAtMs = options.longs === String ? "0" : 0; + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) + if (typeof message.startAtMs === "number") + object.startAtMs = options.longs === String ? String(message.startAtMs) : message.startAtMs; + else + object.startAtMs = options.longs === String ? $util.Long.prototype.toString.call(message.startAtMs) : options.longs === Number ? new $util.LongBits(message.startAtMs.low >>> 0, message.startAtMs.high >>> 0).toNumber(true) : message.startAtMs; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractHistoryRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractHistoryRequestV0; + })(); + + return GetDataContractHistoryRequest; + })(); + + v0.GetDataContractHistoryResponse = (function() { + + /** + * Properties of a GetDataContractHistoryResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractHistoryResponse + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null} [v0] GetDataContractHistoryResponse v0 + */ + + /** + * Constructs a new GetDataContractHistoryResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractHistoryResponse. + * @implements IGetDataContractHistoryResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set + */ + function GetDataContractHistoryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractHistoryResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + */ + GetDataContractHistoryResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + */ + Object.defineProperty(GetDataContractHistoryResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse instance + */ + GetDataContractHistoryResponse.create = function create(properties) { + return new GetDataContractHistoryResponse(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + */ + GetDataContractHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} message GetDataContractHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractHistoryResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 = (function() { + + /** + * Properties of a GetDataContractHistoryResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @interface IGetDataContractHistoryResponseV0 + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null} [dataContractHistory] GetDataContractHistoryResponseV0 dataContractHistory + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractHistoryResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractHistoryResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractHistoryResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @classdesc Represents a GetDataContractHistoryResponseV0. + * @implements IGetDataContractHistoryResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set + */ + function GetDataContractHistoryResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractHistoryResponseV0 dataContractHistory. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null|undefined} dataContractHistory + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.dataContractHistory = null; + + /** + * GetDataContractHistoryResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.proof = null; + + /** + * GetDataContractHistoryResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryResponseV0 result. + * @member {"dataContractHistory"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractHistoryResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContractHistory", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 instance + */ + GetDataContractHistoryResponseV0.create = function create(properties) { + return new GetDataContractHistoryResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractHistory != null && Object.hasOwnProperty.call(message, "dataContractHistory")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.encode(message.dataContractHistory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify(message.dataContractHistory); + if (error) + return "dataContractHistory." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractHistoryResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + */ + GetDataContractHistoryResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); + if (object.dataContractHistory != null) { + if (typeof object.dataContractHistory !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.dataContractHistory: object expected"); + message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.fromObject(object.dataContractHistory); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { + object.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.toObject(message.dataContractHistory, options); + if (options.oneofs) + object.result = "dataContractHistory"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractHistoryResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryResponseV0.DataContractHistoryEntry = (function() { + + /** + * Properties of a DataContractHistoryEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @interface IDataContractHistoryEntry + * @property {number|Long|null} [date] DataContractHistoryEntry date + * @property {Uint8Array|null} [value] DataContractHistoryEntry value + */ + + /** + * Constructs a new DataContractHistoryEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @classdesc Represents a DataContractHistoryEntry. + * @implements IDataContractHistoryEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set + */ + function DataContractHistoryEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContractHistoryEntry date. + * @member {number|Long} date + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + */ + DataContractHistoryEntry.prototype.date = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DataContractHistoryEntry value. + * @member {Uint8Array} value + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + */ + DataContractHistoryEntry.prototype.value = $util.newBuffer([]); + + /** + * Creates a new DataContractHistoryEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry instance + */ + DataContractHistoryEntry.create = function create(properties) { + return new DataContractHistoryEntry(properties); + }; + + /** + * Encodes the specified DataContractHistoryEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistoryEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.date != null && Object.hasOwnProperty.call(message, "date")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.date); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified DataContractHistoryEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistoryEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractHistoryEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistoryEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.date = reader.uint64(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractHistoryEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistoryEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractHistoryEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractHistoryEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.date != null && message.hasOwnProperty("date")) + if (!$util.isInteger(message.date) && !(message.date && $util.isInteger(message.date.low) && $util.isInteger(message.date.high))) + return "date: integer|Long expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a DataContractHistoryEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + */ + DataContractHistoryEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); + if (object.date != null) + if ($util.Long) + (message.date = $util.Long.fromValue(object.date)).unsigned = true; + else if (typeof object.date === "string") + message.date = parseInt(object.date, 10); + else if (typeof object.date === "number") + message.date = object.date; + else if (typeof object.date === "object") + message.date = new $util.LongBits(object.date.low >>> 0, object.date.high >>> 0).toNumber(true); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a DataContractHistoryEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} message DataContractHistoryEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractHistoryEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.date = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.date != null && message.hasOwnProperty("date")) + if (typeof message.date === "number") + object.date = options.longs === String ? String(message.date) : message.date; + else + object.date = options.longs === String ? $util.Long.prototype.toString.call(message.date) : options.longs === Number ? new $util.LongBits(message.date.low >>> 0, message.date.high >>> 0).toNumber(true) : message.date; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this DataContractHistoryEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + * @returns {Object.} JSON object + */ + DataContractHistoryEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractHistoryEntry; + })(); + + GetDataContractHistoryResponseV0.DataContractHistory = (function() { + + /** + * Properties of a DataContractHistory. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @interface IDataContractHistory + * @property {Array.|null} [dataContractEntries] DataContractHistory dataContractEntries + */ + + /** + * Constructs a new DataContractHistory. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @classdesc Represents a DataContractHistory. + * @implements IDataContractHistory + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set + */ + function DataContractHistory(properties) { + this.dataContractEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContractHistory dataContractEntries. + * @member {Array.} dataContractEntries + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @instance + */ + DataContractHistory.prototype.dataContractEntries = $util.emptyArray; + + /** + * Creates a new DataContractHistory instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory instance + */ + DataContractHistory.create = function create(properties) { + return new DataContractHistory(properties); + }; + + /** + * Encodes the specified DataContractHistory message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractEntries != null && message.dataContractEntries.length) + for (var i = 0; i < message.dataContractEntries.length; ++i) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContractHistory message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractHistory message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataContractEntries && message.dataContractEntries.length)) + message.dataContractEntries = []; + message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractHistory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractHistory message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractHistory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { + if (!Array.isArray(message.dataContractEntries)) + return "dataContractEntries: array expected"; + for (var i = 0; i < message.dataContractEntries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify(message.dataContractEntries[i]); + if (error) + return "dataContractEntries." + error; + } + } + return null; + }; + + /** + * Creates a DataContractHistory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + */ + DataContractHistory.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); + if (object.dataContractEntries) { + if (!Array.isArray(object.dataContractEntries)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: array expected"); + message.dataContractEntries = []; + for (var i = 0; i < object.dataContractEntries.length; ++i) { + if (typeof object.dataContractEntries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: object expected"); + message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.fromObject(object.dataContractEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataContractHistory message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} message DataContractHistory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractHistory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataContractEntries = []; + if (message.dataContractEntries && message.dataContractEntries.length) { + object.dataContractEntries = []; + for (var j = 0; j < message.dataContractEntries.length; ++j) + object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.toObject(message.dataContractEntries[j], options); + } + return object; + }; + + /** + * Converts this DataContractHistory to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @instance + * @returns {Object.} JSON object + */ + DataContractHistory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractHistory; + })(); + + return GetDataContractHistoryResponseV0; + })(); + + return GetDataContractHistoryResponse; + })(); + + v0.GetDocumentsRequest = (function() { + + /** + * Properties of a GetDocumentsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsRequest + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null} [v0] GetDocumentsRequest v0 + */ + + /** + * Constructs a new GetDocumentsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsRequest. + * @implements IGetDocumentsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + */ + function GetDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsRequest v0. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + Object.defineProperty(GetDocumentsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest instance + */ + GetDocumentsRequest.create = function create(properties) { + return new GetDocumentsRequest(properties); + }; + + /** + * Encodes the specified GetDocumentsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + */ + GetDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest} message GetDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDocumentsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsRequest.GetDocumentsRequestV0 = (function() { + + /** + * Properties of a GetDocumentsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @interface IGetDocumentsRequestV0 + * @property {Uint8Array|null} [dataContractId] GetDocumentsRequestV0 dataContractId + * @property {string|null} [documentType] GetDocumentsRequestV0 documentType + * @property {Uint8Array|null} [where] GetDocumentsRequestV0 where + * @property {Uint8Array|null} [orderBy] GetDocumentsRequestV0 orderBy + * @property {number|null} [limit] GetDocumentsRequestV0 limit + * @property {Uint8Array|null} [startAfter] GetDocumentsRequestV0 startAfter + * @property {Uint8Array|null} [startAt] GetDocumentsRequestV0 startAt + * @property {boolean|null} [prove] GetDocumentsRequestV0 prove + */ + + /** + * Constructs a new GetDocumentsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @classdesc Represents a GetDocumentsRequestV0. + * @implements IGetDocumentsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set + */ + function GetDocumentsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsRequestV0 dataContractId. + * @member {Uint8Array} dataContractId + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.dataContractId = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 documentType. + * @member {string} documentType + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.documentType = ""; + + /** + * GetDocumentsRequestV0 where. + * @member {Uint8Array} where + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.where = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 orderBy. + * @member {Uint8Array} orderBy + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.orderBy = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.limit = 0; + + /** + * GetDocumentsRequestV0 startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.startAfter = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.startAt = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsRequestV0 start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + Object.defineProperty(GetDocumentsRequestV0.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 instance + */ + GetDocumentsRequestV0.create = function create(properties) { + return new GetDocumentsRequestV0(properties); + }; + + /** + * Encodes the specified GetDocumentsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); + if (message.where != null && Object.hasOwnProperty.call(message, "where")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDocumentsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractId = reader.bytes(); + break; + case 2: + message.documentType = reader.string(); + break; + case 3: + message.where = reader.bytes(); + break; + case 4: + message.orderBy = reader.bytes(); + break; + case 5: + message.limit = reader.uint32(); + break; + case 6: + message.startAfter = reader.bytes(); + break; + case 7: + message.startAt = reader.bytes(); + break; + case 8: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) + return "dataContractId: buffer expected"; + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; + if (message.where != null && message.hasOwnProperty("where")) + if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) + return "where: buffer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) + return "orderBy: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDocumentsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + */ + GetDocumentsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); + if (object.dataContractId != null) + if (typeof object.dataContractId === "string") + $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); + else if (object.dataContractId.length >= 0) + message.dataContractId = object.dataContractId; + if (object.documentType != null) + message.documentType = String(object.documentType); + if (object.where != null) + if (typeof object.where === "string") + $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); + else if (object.where.length >= 0) + message.where = object.where; + if (object.orderBy != null) + if (typeof object.orderBy === "string") + $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); + else if (object.orderBy.length >= 0) + message.orderBy = object.orderBy; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} message GetDocumentsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.dataContractId = ""; + else { + object.dataContractId = []; + if (options.bytes !== Array) + object.dataContractId = $util.newBuffer(object.dataContractId); + } + object.documentType = ""; + if (options.bytes === String) + object.where = ""; + else { + object.where = []; + if (options.bytes !== Array) + object.where = $util.newBuffer(object.where); + } + if (options.bytes === String) + object.orderBy = ""; + else { + object.orderBy = []; + if (options.bytes !== Array) + object.orderBy = $util.newBuffer(object.orderBy); + } + object.limit = 0; + object.prove = false; + } + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; + if (message.where != null && message.hasOwnProperty("where")) + object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (options.oneofs) + object.start = "startAfter"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; + if (options.oneofs) + object.start = "startAt"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDocumentsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDocumentsRequestV0; + })(); + + return GetDocumentsRequest; + })(); + + v0.GetDocumentsResponse = (function() { + + /** + * Properties of a GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsResponse + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 + */ + + /** + * Constructs a new GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsResponse. + * @implements IGetDocumentsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + */ + function GetDocumentsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsResponse v0. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + Object.defineProperty(GetDocumentsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance + */ + GetDocumentsResponse.create = function create(properties) { + return new GetDocumentsResponse(properties); + }; + + /** + * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + */ + GetDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDocumentsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsResponse.GetDocumentsResponseV0 = (function() { + + /** + * Properties of a GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @interface IGetDocumentsResponseV0 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata + */ + + /** + * Constructs a new GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @classdesc Represents a GetDocumentsResponseV0. + * @implements IGetDocumentsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set + */ + function GetDocumentsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsResponseV0 documents. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.documents = null; + + /** + * GetDocumentsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.proof = null; + + /** + * GetDocumentsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsResponseV0 result. + * @member {"documents"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance + */ + GetDocumentsResponseV0.create = function create(properties) { + return new GetDocumentsResponseV0(properties); + }; + + /** + * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + */ + GetDocumentsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); + if (options.oneofs) + object.result = "documents"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDocumentsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsResponseV0.Documents = (function() { + + /** + * Properties of a Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ + + /** + * Constructs a new Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + */ + function Documents(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Documents documents. + * @member {Array.} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; + + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; + + /** + * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); + return writer; + }; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documents message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) + return "documents: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + if (typeof object.documents[i] === "string") + $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); + else if (object.documents[i].length >= 0) + message.documents[i] = object.documents[i]; + } + return message; + }; + + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; + } + return object; + }; + + /** + * Converts this Documents to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Documents; + })(); + + return GetDocumentsResponseV0; + })(); + + return GetDocumentsResponse; + })(); + + v0.GetIdentityByPublicKeyHashRequest = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityByPublicKeyHashRequest + * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null} [v0] GetIdentityByPublicKeyHashRequest v0 + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityByPublicKeyHashRequest. + * @implements IGetIdentityByPublicKeyHashRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + */ + GetIdentityByPublicKeyHashRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest instance + */ + GetIdentityByPublicKeyHashRequest.create = function create(properties) { + return new GetIdentityByPublicKeyHashRequest(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + */ + GetIdentityByPublicKeyHashRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @interface IGetIdentityByPublicKeyHashRequestV0 + * @property {Uint8Array|null} [publicKeyHash] GetIdentityByPublicKeyHashRequestV0 publicKeyHash + * @property {boolean|null} [prove] GetIdentityByPublicKeyHashRequestV0 prove + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @classdesc Represents a GetIdentityByPublicKeyHashRequestV0. + * @implements IGetIdentityByPublicKeyHashRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashRequestV0 publicKeyHash. + * @member {Uint8Array} publicKeyHash + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + */ + GetIdentityByPublicKeyHashRequestV0.prototype.publicKeyHash = $util.newBuffer([]); + + /** + * GetIdentityByPublicKeyHashRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + */ + GetIdentityByPublicKeyHashRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityByPublicKeyHashRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 instance + */ + GetIdentityByPublicKeyHashRequestV0.create = function create(properties) { + return new GetIdentityByPublicKeyHashRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKeyHash != null && Object.hasOwnProperty.call(message, "publicKeyHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKeyHash); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKeyHash = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) + if (!(message.publicKeyHash && typeof message.publicKeyHash.length === "number" || $util.isString(message.publicKeyHash))) + return "publicKeyHash: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + */ + GetIdentityByPublicKeyHashRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); + if (object.publicKeyHash != null) + if (typeof object.publicKeyHash === "string") + $util.base64.decode(object.publicKeyHash, message.publicKeyHash = $util.newBuffer($util.base64.length(object.publicKeyHash)), 0); + else if (object.publicKeyHash.length >= 0) + message.publicKeyHash = object.publicKeyHash; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.publicKeyHash = ""; + else { + object.publicKeyHash = []; + if (options.bytes !== Array) + object.publicKeyHash = $util.newBuffer(object.publicKeyHash); + } + object.prove = false; + } + if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) + object.publicKeyHash = options.bytes === String ? $util.base64.encode(message.publicKeyHash, 0, message.publicKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeyHash) : message.publicKeyHash; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityByPublicKeyHashRequestV0; + })(); + + return GetIdentityByPublicKeyHashRequest; + })(); + + v0.GetIdentityByPublicKeyHashResponse = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityByPublicKeyHashResponse + * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null} [v0] GetIdentityByPublicKeyHashResponse v0 + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityByPublicKeyHashResponse. + * @implements IGetIdentityByPublicKeyHashResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + */ + GetIdentityByPublicKeyHashResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse instance + */ + GetIdentityByPublicKeyHashResponse.create = function create(properties) { + return new GetIdentityByPublicKeyHashResponse(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + */ + GetIdentityByPublicKeyHashResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @interface IGetIdentityByPublicKeyHashResponseV0 + * @property {Uint8Array|null} [identity] GetIdentityByPublicKeyHashResponseV0 identity + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityByPublicKeyHashResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityByPublicKeyHashResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @classdesc Represents a GetIdentityByPublicKeyHashResponseV0. + * @implements IGetIdentityByPublicKeyHashResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashResponseV0 identity. + * @member {Uint8Array} identity + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.identity = $util.newBuffer([]); + + /** + * GetIdentityByPublicKeyHashResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.proof = null; + + /** + * GetIdentityByPublicKeyHashResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashResponseV0 result. + * @member {"identity"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 instance + */ + GetIdentityByPublicKeyHashResponseV0.create = function create(properties) { + return new GetIdentityByPublicKeyHashResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identity != null && message.hasOwnProperty("identity")) { + properties.result = 1; + if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) + return "identity: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + */ + GetIdentityByPublicKeyHashResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); + if (object.identity != null) + if (typeof object.identity === "string") + $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); + else if (object.identity.length >= 0) + message.identity = object.identity; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identity != null && message.hasOwnProperty("identity")) { + object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; + if (options.oneofs) + object.result = "identity"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityByPublicKeyHashResponseV0; + })(); + + return GetIdentityByPublicKeyHashResponse; + })(); + + v0.WaitForStateTransitionResultRequest = (function() { + + /** + * Properties of a WaitForStateTransitionResultRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IWaitForStateTransitionResultRequest + * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null} [v0] WaitForStateTransitionResultRequest v0 + */ + + /** + * Constructs a new WaitForStateTransitionResultRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a WaitForStateTransitionResultRequest. + * @implements IWaitForStateTransitionResultRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + */ + function WaitForStateTransitionResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultRequest v0. + * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + */ + WaitForStateTransitionResultRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest instance + */ + WaitForStateTransitionResultRequest.create = function create(properties) { + return new WaitForStateTransitionResultRequest(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + */ + WaitForStateTransitionResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this WaitForStateTransitionResultRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 = (function() { + + /** + * Properties of a WaitForStateTransitionResultRequestV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @interface IWaitForStateTransitionResultRequestV0 + * @property {Uint8Array|null} [stateTransitionHash] WaitForStateTransitionResultRequestV0 stateTransitionHash + * @property {boolean|null} [prove] WaitForStateTransitionResultRequestV0 prove + */ + + /** + * Constructs a new WaitForStateTransitionResultRequestV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @classdesc Represents a WaitForStateTransitionResultRequestV0. + * @implements IWaitForStateTransitionResultRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set + */ + function WaitForStateTransitionResultRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultRequestV0 stateTransitionHash. + * @member {Uint8Array} stateTransitionHash + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + */ + WaitForStateTransitionResultRequestV0.prototype.stateTransitionHash = $util.newBuffer([]); + + /** + * WaitForStateTransitionResultRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + */ + WaitForStateTransitionResultRequestV0.prototype.prove = false; + + /** + * Creates a new WaitForStateTransitionResultRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 instance + */ + WaitForStateTransitionResultRequestV0.create = function create(properties) { + return new WaitForStateTransitionResultRequestV0(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransitionHash); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransitionHash = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) + if (!(message.stateTransitionHash && typeof message.stateTransitionHash.length === "number" || $util.isString(message.stateTransitionHash))) + return "stateTransitionHash: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a WaitForStateTransitionResultRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + */ + WaitForStateTransitionResultRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); + if (object.stateTransitionHash != null) + if (typeof object.stateTransitionHash === "string") + $util.base64.decode(object.stateTransitionHash, message.stateTransitionHash = $util.newBuffer($util.base64.length(object.stateTransitionHash)), 0); + else if (object.stateTransitionHash.length >= 0) + message.stateTransitionHash = object.stateTransitionHash; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.stateTransitionHash = ""; + else { + object.stateTransitionHash = []; + if (options.bytes !== Array) + object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); + } + object.prove = false; + } + if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) + object.stateTransitionHash = options.bytes === String ? $util.base64.encode(message.stateTransitionHash, 0, message.stateTransitionHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransitionHash) : message.stateTransitionHash; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this WaitForStateTransitionResultRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitForStateTransitionResultRequestV0; + })(); + + return WaitForStateTransitionResultRequest; + })(); + + v0.WaitForStateTransitionResultResponse = (function() { + + /** + * Properties of a WaitForStateTransitionResultResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IWaitForStateTransitionResultResponse + * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null} [v0] WaitForStateTransitionResultResponse v0 + */ + + /** + * Constructs a new WaitForStateTransitionResultResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a WaitForStateTransitionResultResponse. + * @implements IWaitForStateTransitionResultResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + */ + function WaitForStateTransitionResultResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultResponse v0. + * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + WaitForStateTransitionResultResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse instance + */ + WaitForStateTransitionResultResponse.create = function create(properties) { + return new WaitForStateTransitionResultResponse(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + */ + WaitForStateTransitionResultResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this WaitForStateTransitionResultResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 = (function() { + + /** + * Properties of a WaitForStateTransitionResultResponseV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @interface IWaitForStateTransitionResultResponseV0 + * @property {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null} [error] WaitForStateTransitionResultResponseV0 error + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] WaitForStateTransitionResultResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] WaitForStateTransitionResultResponseV0 metadata + */ + + /** + * Constructs a new WaitForStateTransitionResultResponseV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @classdesc Represents a WaitForStateTransitionResultResponseV0. + * @implements IWaitForStateTransitionResultResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set + */ + function WaitForStateTransitionResultResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultResponseV0 error. + * @member {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null|undefined} error + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.error = null; + + /** + * WaitForStateTransitionResultResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.proof = null; + + /** + * WaitForStateTransitionResultResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultResponseV0 result. + * @member {"error"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 instance + */ + WaitForStateTransitionResultResponseV0.create = function create(properties) { + return new WaitForStateTransitionResultResponseV0(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + */ + WaitForStateTransitionResultResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.error: object expected"); + message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.fromObject(object.error); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this WaitForStateTransitionResultResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitForStateTransitionResultResponseV0; + })(); + + return WaitForStateTransitionResultResponse; + })(); + + v0.GetConsensusParamsRequest = (function() { + + /** + * Properties of a GetConsensusParamsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetConsensusParamsRequest + * @property {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null} [v0] GetConsensusParamsRequest v0 + */ + + /** + * Constructs a new GetConsensusParamsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetConsensusParamsRequest. + * @implements IGetConsensusParamsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + */ + function GetConsensusParamsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsRequest v0. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + */ + GetConsensusParamsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetConsensusParamsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + */ + Object.defineProperty(GetConsensusParamsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetConsensusParamsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest instance + */ + GetConsensusParamsRequest.create = function create(properties) { + return new GetConsensusParamsRequest(properties); + }; + + /** + * Encodes the specified GetConsensusParamsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetConsensusParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + */ + GetConsensusParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest} message GetConsensusParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetConsensusParamsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetConsensusParamsRequest.GetConsensusParamsRequestV0 = (function() { + + /** + * Properties of a GetConsensusParamsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @interface IGetConsensusParamsRequestV0 + * @property {number|null} [height] GetConsensusParamsRequestV0 height + * @property {boolean|null} [prove] GetConsensusParamsRequestV0 prove + */ + + /** + * Constructs a new GetConsensusParamsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @classdesc Represents a GetConsensusParamsRequestV0. + * @implements IGetConsensusParamsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set + */ + function GetConsensusParamsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsRequestV0 height. + * @member {number} height + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + */ + GetConsensusParamsRequestV0.prototype.height = 0; + + /** + * GetConsensusParamsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + */ + GetConsensusParamsRequestV0.prototype.prove = false; + + /** + * Creates a new GetConsensusParamsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 instance + */ + GetConsensusParamsRequestV0.create = function create(properties) { + return new GetConsensusParamsRequestV0(properties); + }; + + /** + * Encodes the specified GetConsensusParamsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.height); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int32(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetConsensusParamsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + */ + GetConsensusParamsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); + if (object.height != null) + message.height = object.height | 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.height = 0; + object.prove = false; + } + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetConsensusParamsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetConsensusParamsRequestV0; + })(); + + return GetConsensusParamsRequest; + })(); + + v0.GetConsensusParamsResponse = (function() { + + /** + * Properties of a GetConsensusParamsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetConsensusParamsResponse + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null} [v0] GetConsensusParamsResponse v0 + */ + + /** + * Constructs a new GetConsensusParamsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetConsensusParamsResponse. + * @implements IGetConsensusParamsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + */ + function GetConsensusParamsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsResponse v0. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + */ + GetConsensusParamsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetConsensusParamsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + */ + Object.defineProperty(GetConsensusParamsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetConsensusParamsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse instance + */ + GetConsensusParamsResponse.create = function create(properties) { + return new GetConsensusParamsResponse(properties); + }; + + /** + * Encodes the specified GetConsensusParamsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetConsensusParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + */ + GetConsensusParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} message GetConsensusParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetConsensusParamsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetConsensusParamsResponse.ConsensusParamsBlock = (function() { + + /** + * Properties of a ConsensusParamsBlock. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IConsensusParamsBlock + * @property {string|null} [maxBytes] ConsensusParamsBlock maxBytes + * @property {string|null} [maxGas] ConsensusParamsBlock maxGas + * @property {string|null} [timeIotaMs] ConsensusParamsBlock timeIotaMs + */ + + /** + * Constructs a new ConsensusParamsBlock. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a ConsensusParamsBlock. + * @implements IConsensusParamsBlock + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set + */ + function ConsensusParamsBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParamsBlock maxBytes. + * @member {string} maxBytes + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.maxBytes = ""; + + /** + * ConsensusParamsBlock maxGas. + * @member {string} maxGas + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.maxGas = ""; + + /** + * ConsensusParamsBlock timeIotaMs. + * @member {string} timeIotaMs + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.timeIotaMs = ""; + + /** + * Creates a new ConsensusParamsBlock instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock instance + */ + ConsensusParamsBlock.create = function create(properties) { + return new ConsensusParamsBlock(properties); + }; + + /** + * Encodes the specified ConsensusParamsBlock message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxGas); + if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeIotaMs); + return writer; + }; + + /** + * Encodes the specified ConsensusParamsBlock message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParamsBlock message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.string(); + break; + case 2: + message.maxGas = reader.string(); + break; + case 3: + message.timeIotaMs = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParamsBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParamsBlock message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParamsBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isString(message.maxBytes)) + return "maxBytes: string expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isString(message.maxGas)) + return "maxGas: string expected"; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (!$util.isString(message.timeIotaMs)) + return "timeIotaMs: string expected"; + return null; + }; + + /** + * Creates a ConsensusParamsBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + */ + ConsensusParamsBlock.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); + if (object.maxBytes != null) + message.maxBytes = String(object.maxBytes); + if (object.maxGas != null) + message.maxGas = String(object.maxGas); + if (object.timeIotaMs != null) + message.timeIotaMs = String(object.timeIotaMs); + return message; + }; + + /** + * Creates a plain object from a ConsensusParamsBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} message ConsensusParamsBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParamsBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxBytes = ""; + object.maxGas = ""; + object.timeIotaMs = ""; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + object.maxBytes = message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + object.maxGas = message.maxGas; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + object.timeIotaMs = message.timeIotaMs; + return object; + }; + + /** + * Converts this ConsensusParamsBlock to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + * @returns {Object.} JSON object + */ + ConsensusParamsBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParamsBlock; + })(); + + GetConsensusParamsResponse.ConsensusParamsEvidence = (function() { + + /** + * Properties of a ConsensusParamsEvidence. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IConsensusParamsEvidence + * @property {string|null} [maxAgeNumBlocks] ConsensusParamsEvidence maxAgeNumBlocks + * @property {string|null} [maxAgeDuration] ConsensusParamsEvidence maxAgeDuration + * @property {string|null} [maxBytes] ConsensusParamsEvidence maxBytes + */ + + /** + * Constructs a new ConsensusParamsEvidence. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a ConsensusParamsEvidence. + * @implements IConsensusParamsEvidence + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set + */ + function ConsensusParamsEvidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParamsEvidence maxAgeNumBlocks. + * @member {string} maxAgeNumBlocks + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxAgeNumBlocks = ""; + + /** + * ConsensusParamsEvidence maxAgeDuration. + * @member {string} maxAgeDuration + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxAgeDuration = ""; + + /** + * ConsensusParamsEvidence maxBytes. + * @member {string} maxBytes + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxBytes = ""; + + /** + * Creates a new ConsensusParamsEvidence instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence instance + */ + ConsensusParamsEvidence.create = function create(properties) { + return new ConsensusParamsEvidence(properties); + }; + + /** + * Encodes the specified ConsensusParamsEvidence message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxAgeNumBlocks); + if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxAgeDuration); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxBytes); + return writer; + }; + + /** + * Encodes the specified ConsensusParamsEvidence message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParamsEvidence message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.string(); + break; + case 2: + message.maxAgeDuration = reader.string(); + break; + case 3: + message.maxBytes = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParamsEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParamsEvidence message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParamsEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (!$util.isString(message.maxAgeNumBlocks)) + return "maxAgeNumBlocks: string expected"; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + if (!$util.isString(message.maxAgeDuration)) + return "maxAgeDuration: string expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isString(message.maxBytes)) + return "maxBytes: string expected"; + return null; + }; + + /** + * Creates a ConsensusParamsEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + */ + ConsensusParamsEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); + if (object.maxAgeNumBlocks != null) + message.maxAgeNumBlocks = String(object.maxAgeNumBlocks); + if (object.maxAgeDuration != null) + message.maxAgeDuration = String(object.maxAgeDuration); + if (object.maxBytes != null) + message.maxBytes = String(object.maxBytes); + return message; + }; + + /** + * Creates a plain object from a ConsensusParamsEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} message ConsensusParamsEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParamsEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxAgeNumBlocks = ""; + object.maxAgeDuration = ""; + object.maxBytes = ""; + } + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + object.maxAgeNumBlocks = message.maxAgeNumBlocks; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + object.maxAgeDuration = message.maxAgeDuration; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + object.maxBytes = message.maxBytes; + return object; + }; + + /** + * Converts this ConsensusParamsEvidence to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + * @returns {Object.} JSON object + */ + ConsensusParamsEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParamsEvidence; + })(); + + GetConsensusParamsResponse.GetConsensusParamsResponseV0 = (function() { + + /** + * Properties of a GetConsensusParamsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IGetConsensusParamsResponseV0 + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null} [block] GetConsensusParamsResponseV0 block + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null} [evidence] GetConsensusParamsResponseV0 evidence + */ + + /** + * Constructs a new GetConsensusParamsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a GetConsensusParamsResponseV0. + * @implements IGetConsensusParamsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set + */ + function GetConsensusParamsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsResponseV0 block. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null|undefined} block + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + */ + GetConsensusParamsResponseV0.prototype.block = null; + + /** + * GetConsensusParamsResponseV0 evidence. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null|undefined} evidence + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + */ + GetConsensusParamsResponseV0.prototype.evidence = null; + + /** + * Creates a new GetConsensusParamsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 instance + */ + GetConsensusParamsResponseV0.create = function create(properties) { + return new GetConsensusParamsResponseV0(properties); + }; + + /** + * Encodes the specified GetConsensusParamsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify(message.evidence); + if (error) + return "evidence." + error; + } + return null; + }; + + /** + * Creates a GetConsensusParamsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + */ + GetConsensusParamsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.block: object expected"); + message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.evidence: object expected"); + message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.fromObject(object.evidence); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.toObject(message.evidence, options); + return object; + }; + + /** + * Converts this GetConsensusParamsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetConsensusParamsResponseV0; + })(); + + return GetConsensusParamsResponse; + })(); + + v0.GetProtocolVersionUpgradeStateRequest = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeStateRequest + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null} [v0] GetProtocolVersionUpgradeStateRequest v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeStateRequest. + * @implements IGetProtocolVersionUpgradeStateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeStateRequest v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + */ + GetProtocolVersionUpgradeStateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest instance + */ + GetProtocolVersionUpgradeStateRequest.create = function create(properties) { + return new GetProtocolVersionUpgradeStateRequest(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + */ + GetProtocolVersionUpgradeStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @interface IGetProtocolVersionUpgradeStateRequestV0 + * @property {boolean|null} [prove] GetProtocolVersionUpgradeStateRequestV0 prove + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @classdesc Represents a GetProtocolVersionUpgradeStateRequestV0. + * @implements IGetProtocolVersionUpgradeStateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeStateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @instance + */ + GetProtocolVersionUpgradeStateRequestV0.prototype.prove = false; + + /** + * Creates a new GetProtocolVersionUpgradeStateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 instance + */ + GetProtocolVersionUpgradeStateRequestV0.create = function create(properties) { + return new GetProtocolVersionUpgradeStateRequestV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + */ + GetProtocolVersionUpgradeStateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prove = false; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProtocolVersionUpgradeStateRequestV0; + })(); + + return GetProtocolVersionUpgradeStateRequest; + })(); + + v0.GetProtocolVersionUpgradeStateResponse = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeStateResponse + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null} [v0] GetProtocolVersionUpgradeStateResponse v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeStateResponse. + * @implements IGetProtocolVersionUpgradeStateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeStateResponse v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + */ + GetProtocolVersionUpgradeStateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse instance + */ + GetProtocolVersionUpgradeStateResponse.create = function create(properties) { + return new GetProtocolVersionUpgradeStateResponse(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + */ + GetProtocolVersionUpgradeStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @interface IGetProtocolVersionUpgradeStateResponseV0 + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null} [versions] GetProtocolVersionUpgradeStateResponseV0 versions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeStateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeStateResponseV0 metadata + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @classdesc Represents a GetProtocolVersionUpgradeStateResponseV0. + * @implements IGetProtocolVersionUpgradeStateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeStateResponseV0 versions. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null|undefined} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.versions = null; + + /** + * GetProtocolVersionUpgradeStateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.proof = null; + + /** + * GetProtocolVersionUpgradeStateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateResponseV0 result. + * @member {"versions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 instance + */ + GetProtocolVersionUpgradeStateResponseV0.create = function create(properties) { + return new GetProtocolVersionUpgradeStateResponseV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.versions != null && message.hasOwnProperty("versions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify(message.versions); + if (error) + return "versions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + */ + GetProtocolVersionUpgradeStateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); + if (object.versions != null) { + if (typeof object.versions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.versions: object expected"); + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.fromObject(object.versions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.versions != null && message.hasOwnProperty("versions")) { + object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.toObject(message.versions, options); + if (options.oneofs) + object.result = "versions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateResponseV0.Versions = (function() { + + /** + * Properties of a Versions. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @interface IVersions + * @property {Array.|null} [versions] Versions versions + */ + + /** + * Constructs a new Versions. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @classdesc Represents a Versions. + * @implements IVersions + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set + */ + function Versions(properties) { + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Versions versions. + * @member {Array.} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @instance + */ + Versions.prototype.versions = $util.emptyArray; + + /** + * Creates a new Versions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions instance + */ + Versions.create = function create(properties) { + return new Versions(properties); + }; + + /** + * Encodes the specified Versions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Versions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.encode(message.versions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Versions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Versions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Versions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Versions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Versions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Versions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Versions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Versions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + return null; + }; + + /** + * Creates a Versions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + */ + Versions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: object expected"); + message.versions[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.fromObject(object.versions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Versions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} message Versions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Versions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.toObject(message.versions[j], options); + } + return object; + }; + + /** + * Converts this Versions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @instance + * @returns {Object.} JSON object + */ + Versions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Versions; + })(); + + GetProtocolVersionUpgradeStateResponseV0.VersionEntry = (function() { + + /** + * Properties of a VersionEntry. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @interface IVersionEntry + * @property {number|null} [versionNumber] VersionEntry versionNumber + * @property {number|null} [voteCount] VersionEntry voteCount + */ + + /** + * Constructs a new VersionEntry. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @classdesc Represents a VersionEntry. + * @implements IVersionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set + */ + function VersionEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionEntry versionNumber. + * @member {number} versionNumber + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + */ + VersionEntry.prototype.versionNumber = 0; + + /** + * VersionEntry voteCount. + * @member {number} voteCount + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + */ + VersionEntry.prototype.voteCount = 0; + + /** + * Creates a new VersionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry instance + */ + VersionEntry.create = function create(properties) { + return new VersionEntry(properties); + }; + + /** + * Encodes the specified VersionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.versionNumber); + if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); + return writer; + }; + + /** + * Encodes the specified VersionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versionNumber = reader.uint32(); + break; + case 2: + message.voteCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + if (!$util.isInteger(message.versionNumber)) + return "versionNumber: integer expected"; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + if (!$util.isInteger(message.voteCount)) + return "voteCount: integer expected"; + return null; + }; + + /** + * Creates a VersionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + */ + VersionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); + if (object.versionNumber != null) + message.versionNumber = object.versionNumber >>> 0; + if (object.voteCount != null) + message.voteCount = object.voteCount >>> 0; + return message; + }; + + /** + * Creates a plain object from a VersionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} message VersionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.versionNumber = 0; + object.voteCount = 0; + } + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + object.versionNumber = message.versionNumber; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + object.voteCount = message.voteCount; + return object; + }; + + /** + * Converts this VersionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + * @returns {Object.} JSON object + */ + VersionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionEntry; + })(); + + return GetProtocolVersionUpgradeStateResponseV0; + })(); + + return GetProtocolVersionUpgradeStateResponse; + })(); + + v0.GetProtocolVersionUpgradeVoteStatusRequest = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeVoteStatusRequest + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null} [v0] GetProtocolVersionUpgradeVoteStatusRequest v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequest. + * @implements IGetProtocolVersionUpgradeVoteStatusRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusRequest v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest instance + */ + GetProtocolVersionUpgradeVoteStatusRequest.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusRequest(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + */ + GetProtocolVersionUpgradeVoteStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @interface IGetProtocolVersionUpgradeVoteStatusRequestV0 + * @property {Uint8Array|null} [startProTxHash] GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash + * @property {number|null} [count] GetProtocolVersionUpgradeVoteStatusRequestV0 count + * @property {boolean|null} [prove] GetProtocolVersionUpgradeVoteStatusRequestV0 prove + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequestV0. + * @implements IGetProtocolVersionUpgradeVoteStatusRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash. + * @member {Uint8Array} startProTxHash + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.startProTxHash = $util.newBuffer([]); + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.count = 0; + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.prove = false; + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusRequestV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startProTxHash != null && Object.hasOwnProperty.call(message, "startProTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startProTxHash); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startProTxHash = reader.bytes(); + break; + case 2: + message.count = reader.uint32(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) + if (!(message.startProTxHash && typeof message.startProTxHash.length === "number" || $util.isString(message.startProTxHash))) + return "startProTxHash: buffer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); + if (object.startProTxHash != null) + if (typeof object.startProTxHash === "string") + $util.base64.decode(object.startProTxHash, message.startProTxHash = $util.newBuffer($util.base64.length(object.startProTxHash)), 0); + else if (object.startProTxHash.length >= 0) + message.startProTxHash = object.startProTxHash; + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startProTxHash = ""; + else { + object.startProTxHash = []; + if (options.bytes !== Array) + object.startProTxHash = $util.newBuffer(object.startProTxHash); + } + object.count = 0; + object.prove = false; + } + if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) + object.startProTxHash = options.bytes === String ? $util.base64.encode(message.startProTxHash, 0, message.startProTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.startProTxHash) : message.startProTxHash; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProtocolVersionUpgradeVoteStatusRequestV0; + })(); + + return GetProtocolVersionUpgradeVoteStatusRequest; + })(); + + v0.GetProtocolVersionUpgradeVoteStatusResponse = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeVoteStatusResponse + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null} [v0] GetProtocolVersionUpgradeVoteStatusResponse v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponse. + * @implements IGetProtocolVersionUpgradeVoteStatusResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusResponse v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse instance + */ + GetProtocolVersionUpgradeVoteStatusResponse.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusResponse(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + */ + GetProtocolVersionUpgradeVoteStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @interface IGetProtocolVersionUpgradeVoteStatusResponseV0 + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null} [versions] GetProtocolVersionUpgradeVoteStatusResponseV0 versions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeVoteStatusResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeVoteStatusResponseV0 metadata + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponseV0. + * @implements IGetProtocolVersionUpgradeVoteStatusResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 versions. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null|undefined} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.versions = null; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.proof = null; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 result. + * @member {"versions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusResponseV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.versions != null && message.hasOwnProperty("versions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify(message.versions); + if (error) + return "versions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); + if (object.versions != null) { + if (typeof object.versions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.versions: object expected"); + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.fromObject(object.versions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.versions != null && message.hasOwnProperty("versions")) { + object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.toObject(message.versions, options); + if (options.oneofs) + object.result = "versions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals = (function() { + + /** + * Properties of a VersionSignals. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @interface IVersionSignals + * @property {Array.|null} [versionSignals] VersionSignals versionSignals + */ + + /** + * Constructs a new VersionSignals. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @classdesc Represents a VersionSignals. + * @implements IVersionSignals + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set + */ + function VersionSignals(properties) { + this.versionSignals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionSignals versionSignals. + * @member {Array.} versionSignals + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @instance + */ + VersionSignals.prototype.versionSignals = $util.emptyArray; + + /** + * Creates a new VersionSignals instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals instance + */ + VersionSignals.create = function create(properties) { + return new VersionSignals(properties); + }; + + /** + * Encodes the specified VersionSignals message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionSignals != null && message.versionSignals.length) + for (var i = 0; i < message.versionSignals.length; ++i) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.encode(message.versionSignals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VersionSignals message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionSignals message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignals.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.versionSignals && message.versionSignals.length)) + message.versionSignals = []; + message.versionSignals.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionSignals message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionSignals.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionSignals != null && message.hasOwnProperty("versionSignals")) { + if (!Array.isArray(message.versionSignals)) + return "versionSignals: array expected"; + for (var i = 0; i < message.versionSignals.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify(message.versionSignals[i]); + if (error) + return "versionSignals." + error; + } + } + return null; + }; + + /** + * Creates a VersionSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + */ + VersionSignals.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); + if (object.versionSignals) { + if (!Array.isArray(object.versionSignals)) + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: array expected"); + message.versionSignals = []; + for (var i = 0; i < object.versionSignals.length; ++i) { + if (typeof object.versionSignals[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: object expected"); + message.versionSignals[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.fromObject(object.versionSignals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VersionSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} message VersionSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionSignals = []; + if (message.versionSignals && message.versionSignals.length) { + object.versionSignals = []; + for (var j = 0; j < message.versionSignals.length; ++j) + object.versionSignals[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.toObject(message.versionSignals[j], options); + } + return object; + }; + + /** + * Converts this VersionSignals to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @instance + * @returns {Object.} JSON object + */ + VersionSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionSignals; + })(); + + GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal = (function() { + + /** + * Properties of a VersionSignal. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @interface IVersionSignal + * @property {Uint8Array|null} [proTxHash] VersionSignal proTxHash + * @property {number|null} [version] VersionSignal version + */ + + /** + * Constructs a new VersionSignal. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @classdesc Represents a VersionSignal. + * @implements IVersionSignal + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set + */ + function VersionSignal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionSignal proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + */ + VersionSignal.prototype.proTxHash = $util.newBuffer([]); + + /** + * VersionSignal version. + * @member {number} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + */ + VersionSignal.prototype.version = 0; + + /** + * Creates a new VersionSignal instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal instance + */ + VersionSignal.create = function create(properties) { + return new VersionSignal(properties); + }; + + /** + * Encodes the specified VersionSignal message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.version); + return writer; + }; + + /** + * Encodes the specified VersionSignal message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionSignal message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.version = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionSignal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionSignal message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionSignal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + return null; + }; + + /** + * Creates a VersionSignal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + */ + VersionSignal.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.version != null) + message.version = object.version >>> 0; + return message; + }; + + /** + * Creates a plain object from a VersionSignal message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} message VersionSignal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionSignal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + object.version = 0; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this VersionSignal to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + * @returns {Object.} JSON object + */ + VersionSignal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionSignal; + })(); + + return GetProtocolVersionUpgradeVoteStatusResponseV0; + })(); + + return GetProtocolVersionUpgradeVoteStatusResponse; + })(); + + v0.GetEpochsInfoRequest = (function() { + + /** + * Properties of a GetEpochsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEpochsInfoRequest + * @property {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null} [v0] GetEpochsInfoRequest v0 + */ + + /** + * Constructs a new GetEpochsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEpochsInfoRequest. + * @implements IGetEpochsInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set + */ + function GetEpochsInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEpochsInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + */ + GetEpochsInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + */ + Object.defineProperty(GetEpochsInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest instance + */ + GetEpochsInfoRequest.create = function create(properties) { + return new GetEpochsInfoRequest(properties); + }; + + /** + * Encodes the specified GetEpochsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEpochsInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + */ + GetEpochsInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest} message GetEpochsInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEpochsInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoRequest.GetEpochsInfoRequestV0 = (function() { + + /** + * Properties of a GetEpochsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @interface IGetEpochsInfoRequestV0 + * @property {google.protobuf.IUInt32Value|null} [startEpoch] GetEpochsInfoRequestV0 startEpoch + * @property {number|null} [count] GetEpochsInfoRequestV0 count + * @property {boolean|null} [ascending] GetEpochsInfoRequestV0 ascending + * @property {boolean|null} [prove] GetEpochsInfoRequestV0 prove + */ + + /** + * Constructs a new GetEpochsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @classdesc Represents a GetEpochsInfoRequestV0. + * @implements IGetEpochsInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set + */ + function GetEpochsInfoRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEpochsInfoRequestV0 startEpoch. + * @member {google.protobuf.IUInt32Value|null|undefined} startEpoch + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.startEpoch = null; + + /** + * GetEpochsInfoRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.count = 0; + + /** + * GetEpochsInfoRequestV0 ascending. + * @member {boolean} ascending + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.ascending = false; + + /** + * GetEpochsInfoRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.prove = false; + + /** + * Creates a new GetEpochsInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 instance + */ + GetEpochsInfoRequestV0.create = function create(properties) { + return new GetEpochsInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetEpochsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startEpoch != null && Object.hasOwnProperty.call(message, "startEpoch")) + $root.google.protobuf.UInt32Value.encode(message.startEpoch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); + if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ascending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startEpoch = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 2: + message.count = reader.uint32(); + break; + case 3: + message.ascending = reader.bool(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) { + var error = $root.google.protobuf.UInt32Value.verify(message.startEpoch); + if (error) + return "startEpoch." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.ascending != null && message.hasOwnProperty("ascending")) + if (typeof message.ascending !== "boolean") + return "ascending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEpochsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + */ + GetEpochsInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); + if (object.startEpoch != null) { + if (typeof object.startEpoch !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.startEpoch: object expected"); + message.startEpoch = $root.google.protobuf.UInt32Value.fromObject(object.startEpoch); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.ascending != null) + message.ascending = Boolean(object.ascending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startEpoch = null; + object.count = 0; + object.ascending = false; + object.prove = false; + } + if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) + object.startEpoch = $root.google.protobuf.UInt32Value.toObject(message.startEpoch, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.ascending != null && message.hasOwnProperty("ascending")) + object.ascending = message.ascending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEpochsInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEpochsInfoRequestV0; + })(); + + return GetEpochsInfoRequest; + })(); + + v0.GetEpochsInfoResponse = (function() { + + /** + * Properties of a GetEpochsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEpochsInfoResponse + * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null} [v0] GetEpochsInfoResponse v0 + */ + + /** + * Constructs a new GetEpochsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEpochsInfoResponse. + * @implements IGetEpochsInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set + */ + function GetEpochsInfoResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEpochsInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + */ + GetEpochsInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + */ + Object.defineProperty(GetEpochsInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse instance + */ + GetEpochsInfoResponse.create = function create(properties) { + return new GetEpochsInfoResponse(properties); + }; + + /** + * Encodes the specified GetEpochsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEpochsInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + */ + GetEpochsInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} message GetEpochsInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEpochsInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoResponse.GetEpochsInfoResponseV0 = (function() { + + /** + * Properties of a GetEpochsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @interface IGetEpochsInfoResponseV0 + * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null} [epochs] GetEpochsInfoResponseV0 epochs + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEpochsInfoResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEpochsInfoResponseV0 metadata + */ + + /** + * Constructs a new GetEpochsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @classdesc Represents a GetEpochsInfoResponseV0. + * @implements IGetEpochsInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set + */ + function GetEpochsInfoResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEpochsInfoResponseV0 epochs. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null|undefined} epochs + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.epochs = null; + + /** + * GetEpochsInfoResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.proof = null; + + /** + * GetEpochsInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoResponseV0 result. + * @member {"epochs"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + Object.defineProperty(GetEpochsInfoResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["epochs", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 instance + */ + GetEpochsInfoResponseV0.create = function create(properties) { + return new GetEpochsInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetEpochsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochs != null && Object.hasOwnProperty.call(message, "epochs")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.encode(message.epochs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.epochs != null && message.hasOwnProperty("epochs")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify(message.epochs); + if (error) + return "epochs." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetEpochsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + */ + GetEpochsInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); + if (object.epochs != null) { + if (typeof object.epochs !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.epochs: object expected"); + message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.fromObject(object.epochs); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.epochs != null && message.hasOwnProperty("epochs")) { + object.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.toObject(message.epochs, options); + if (options.oneofs) + object.result = "epochs"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetEpochsInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoResponseV0.EpochInfos = (function() { + + /** + * Properties of an EpochInfos. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @interface IEpochInfos + * @property {Array.|null} [epochInfos] EpochInfos epochInfos + */ + + /** + * Constructs a new EpochInfos. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @classdesc Represents an EpochInfos. + * @implements IEpochInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set + */ + function EpochInfos(properties) { + this.epochInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EpochInfos epochInfos. + * @member {Array.} epochInfos + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @instance + */ + EpochInfos.prototype.epochInfos = $util.emptyArray; + + /** + * Creates a new EpochInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos instance + */ + EpochInfos.create = function create(properties) { + return new EpochInfos(properties); + }; + + /** + * Encodes the specified EpochInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochInfos != null && message.epochInfos.length) + for (var i = 0; i < message.epochInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.encode(message.epochInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EpochInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EpochInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfos.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.epochInfos && message.epochInfos.length)) + message.epochInfos = []; + message.epochInfos.push($root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EpochInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EpochInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EpochInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.epochInfos != null && message.hasOwnProperty("epochInfos")) { + if (!Array.isArray(message.epochInfos)) + return "epochInfos: array expected"; + for (var i = 0; i < message.epochInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify(message.epochInfos[i]); + if (error) + return "epochInfos." + error; + } + } + return null; + }; + + /** + * Creates an EpochInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + */ + EpochInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); + if (object.epochInfos) { + if (!Array.isArray(object.epochInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: array expected"); + message.epochInfos = []; + for (var i = 0; i < object.epochInfos.length; ++i) { + if (typeof object.epochInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: object expected"); + message.epochInfos[i] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.fromObject(object.epochInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EpochInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} message EpochInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EpochInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.epochInfos = []; + if (message.epochInfos && message.epochInfos.length) { + object.epochInfos = []; + for (var j = 0; j < message.epochInfos.length; ++j) + object.epochInfos[j] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.toObject(message.epochInfos[j], options); + } + return object; + }; + + /** + * Converts this EpochInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @instance + * @returns {Object.} JSON object + */ + EpochInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EpochInfos; + })(); + + GetEpochsInfoResponseV0.EpochInfo = (function() { + + /** + * Properties of an EpochInfo. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @interface IEpochInfo + * @property {number|null} [number] EpochInfo number + * @property {number|Long|null} [firstBlockHeight] EpochInfo firstBlockHeight + * @property {number|null} [firstCoreBlockHeight] EpochInfo firstCoreBlockHeight + * @property {number|Long|null} [startTime] EpochInfo startTime + * @property {number|null} [feeMultiplier] EpochInfo feeMultiplier + * @property {number|null} [protocolVersion] EpochInfo protocolVersion + */ + + /** + * Constructs a new EpochInfo. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @classdesc Represents an EpochInfo. + * @implements IEpochInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set + */ + function EpochInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EpochInfo number. + * @member {number} number + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.number = 0; + + /** + * EpochInfo firstBlockHeight. + * @member {number|Long} firstBlockHeight + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.firstBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EpochInfo firstCoreBlockHeight. + * @member {number} firstCoreBlockHeight + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.firstCoreBlockHeight = 0; + + /** + * EpochInfo startTime. + * @member {number|Long} startTime + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EpochInfo feeMultiplier. + * @member {number} feeMultiplier + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.feeMultiplier = 0; + + /** + * EpochInfo protocolVersion. + * @member {number} protocolVersion + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.protocolVersion = 0; + + /** + * Creates a new EpochInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo instance + */ + EpochInfo.create = function create(properties) { + return new EpochInfo(properties); + }; + + /** + * Encodes the specified EpochInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.number); + if (message.firstBlockHeight != null && Object.hasOwnProperty.call(message, "firstBlockHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.firstBlockHeight); + if (message.firstCoreBlockHeight != null && Object.hasOwnProperty.call(message, "firstCoreBlockHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.firstCoreBlockHeight); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startTime); + if (message.feeMultiplier != null && Object.hasOwnProperty.call(message, "feeMultiplier")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.feeMultiplier); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.protocolVersion); + return writer; + }; + + /** + * Encodes the specified EpochInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EpochInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.number = reader.uint32(); + break; + case 2: + message.firstBlockHeight = reader.uint64(); + break; + case 3: + message.firstCoreBlockHeight = reader.uint32(); + break; + case 4: + message.startTime = reader.uint64(); + break; + case 5: + message.feeMultiplier = reader.double(); + break; + case 6: + message.protocolVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EpochInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EpochInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EpochInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) + if (!$util.isInteger(message.firstBlockHeight) && !(message.firstBlockHeight && $util.isInteger(message.firstBlockHeight.low) && $util.isInteger(message.firstBlockHeight.high))) + return "firstBlockHeight: integer|Long expected"; + if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) + if (!$util.isInteger(message.firstCoreBlockHeight)) + return "firstCoreBlockHeight: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) + if (typeof message.feeMultiplier !== "number") + return "feeMultiplier: number expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion)) + return "protocolVersion: integer expected"; + return null; + }; + + /** + * Creates an EpochInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + */ + EpochInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); + if (object.number != null) + message.number = object.number >>> 0; + if (object.firstBlockHeight != null) + if ($util.Long) + (message.firstBlockHeight = $util.Long.fromValue(object.firstBlockHeight)).unsigned = true; + else if (typeof object.firstBlockHeight === "string") + message.firstBlockHeight = parseInt(object.firstBlockHeight, 10); + else if (typeof object.firstBlockHeight === "number") + message.firstBlockHeight = object.firstBlockHeight; + else if (typeof object.firstBlockHeight === "object") + message.firstBlockHeight = new $util.LongBits(object.firstBlockHeight.low >>> 0, object.firstBlockHeight.high >>> 0).toNumber(true); + if (object.firstCoreBlockHeight != null) + message.firstCoreBlockHeight = object.firstCoreBlockHeight >>> 0; + if (object.startTime != null) + if ($util.Long) + (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = true; + else if (typeof object.startTime === "string") + message.startTime = parseInt(object.startTime, 10); + else if (typeof object.startTime === "number") + message.startTime = object.startTime; + else if (typeof object.startTime === "object") + message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(true); + if (object.feeMultiplier != null) + message.feeMultiplier = Number(object.feeMultiplier); + if (object.protocolVersion != null) + message.protocolVersion = object.protocolVersion >>> 0; + return message; + }; + + /** + * Creates a plain object from an EpochInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} message EpochInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EpochInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.firstBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.firstBlockHeight = options.longs === String ? "0" : 0; + object.firstCoreBlockHeight = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTime = options.longs === String ? "0" : 0; + object.feeMultiplier = 0; + object.protocolVersion = 0; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) + if (typeof message.firstBlockHeight === "number") + object.firstBlockHeight = options.longs === String ? String(message.firstBlockHeight) : message.firstBlockHeight; + else + object.firstBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.firstBlockHeight) : options.longs === Number ? new $util.LongBits(message.firstBlockHeight.low >>> 0, message.firstBlockHeight.high >>> 0).toNumber(true) : message.firstBlockHeight; + if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) + object.firstCoreBlockHeight = message.firstCoreBlockHeight; + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber(true) : message.startTime; + if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) + object.feeMultiplier = options.json && !isFinite(message.feeMultiplier) ? String(message.feeMultiplier) : message.feeMultiplier; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = message.protocolVersion; + return object; + }; + + /** + * Converts this EpochInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + * @returns {Object.} JSON object + */ + EpochInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EpochInfo; + })(); + + return GetEpochsInfoResponseV0; + })(); + + return GetEpochsInfoResponse; + })(); + + v0.GetContestedResourcesRequest = (function() { + + /** + * Properties of a GetContestedResourcesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourcesRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null} [v0] GetContestedResourcesRequest v0 + */ + + /** + * Constructs a new GetContestedResourcesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourcesRequest. + * @implements IGetContestedResourcesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set + */ + function GetContestedResourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourcesRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + */ + GetContestedResourcesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + */ + Object.defineProperty(GetContestedResourcesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest instance + */ + GetContestedResourcesRequest.create = function create(properties) { + return new GetContestedResourcesRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourcesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + */ + GetContestedResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest} message GetContestedResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourcesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesRequest.GetContestedResourcesRequestV0 = (function() { + + /** + * Properties of a GetContestedResourcesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @interface IGetContestedResourcesRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourcesRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourcesRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourcesRequestV0 indexName + * @property {Array.|null} [startIndexValues] GetContestedResourcesRequestV0 startIndexValues + * @property {Array.|null} [endIndexValues] GetContestedResourcesRequestV0 endIndexValues + * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null} [startAtValueInfo] GetContestedResourcesRequestV0 startAtValueInfo + * @property {number|null} [count] GetContestedResourcesRequestV0 count + * @property {boolean|null} [orderAscending] GetContestedResourcesRequestV0 orderAscending + * @property {boolean|null} [prove] GetContestedResourcesRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourcesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @classdesc Represents a GetContestedResourcesRequestV0. + * @implements IGetContestedResourcesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set + */ + function GetContestedResourcesRequestV0(properties) { + this.startIndexValues = []; + this.endIndexValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourcesRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourcesRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourcesRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourcesRequestV0 startIndexValues. + * @member {Array.} startIndexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.startIndexValues = $util.emptyArray; + + /** + * GetContestedResourcesRequestV0 endIndexValues. + * @member {Array.} endIndexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.endIndexValues = $util.emptyArray; + + /** + * GetContestedResourcesRequestV0 startAtValueInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null|undefined} startAtValueInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.startAtValueInfo = null; + + /** + * GetContestedResourcesRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.count = 0; + + /** + * GetContestedResourcesRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourcesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourcesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 instance + */ + GetContestedResourcesRequestV0.create = function create(properties) { + return new GetContestedResourcesRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourcesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.startIndexValues != null && message.startIndexValues.length) + for (var i = 0; i < message.startIndexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startIndexValues[i]); + if (message.endIndexValues != null && message.endIndexValues.length) + for (var i = 0; i < message.endIndexValues.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.endIndexValues[i]); + if (message.startAtValueInfo != null && Object.hasOwnProperty.call(message, "startAtValueInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.encode(message.startAtValueInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.startIndexValues && message.startIndexValues.length)) + message.startIndexValues = []; + message.startIndexValues.push(reader.bytes()); + break; + case 5: + if (!(message.endIndexValues && message.endIndexValues.length)) + message.endIndexValues = []; + message.endIndexValues.push(reader.bytes()); + break; + case 6: + message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.decode(reader, reader.uint32()); + break; + case 7: + message.count = reader.uint32(); + break; + case 8: + message.orderAscending = reader.bool(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.startIndexValues != null && message.hasOwnProperty("startIndexValues")) { + if (!Array.isArray(message.startIndexValues)) + return "startIndexValues: array expected"; + for (var i = 0; i < message.startIndexValues.length; ++i) + if (!(message.startIndexValues[i] && typeof message.startIndexValues[i].length === "number" || $util.isString(message.startIndexValues[i]))) + return "startIndexValues: buffer[] expected"; + } + if (message.endIndexValues != null && message.hasOwnProperty("endIndexValues")) { + if (!Array.isArray(message.endIndexValues)) + return "endIndexValues: array expected"; + for (var i = 0; i < message.endIndexValues.length; ++i) + if (!(message.endIndexValues[i] && typeof message.endIndexValues[i].length === "number" || $util.isString(message.endIndexValues[i]))) + return "endIndexValues: buffer[] expected"; + } + if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify(message.startAtValueInfo); + if (error) + return "startAtValueInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourcesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + */ + GetContestedResourcesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.startIndexValues) { + if (!Array.isArray(object.startIndexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startIndexValues: array expected"); + message.startIndexValues = []; + for (var i = 0; i < object.startIndexValues.length; ++i) + if (typeof object.startIndexValues[i] === "string") + $util.base64.decode(object.startIndexValues[i], message.startIndexValues[i] = $util.newBuffer($util.base64.length(object.startIndexValues[i])), 0); + else if (object.startIndexValues[i].length >= 0) + message.startIndexValues[i] = object.startIndexValues[i]; + } + if (object.endIndexValues) { + if (!Array.isArray(object.endIndexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.endIndexValues: array expected"); + message.endIndexValues = []; + for (var i = 0; i < object.endIndexValues.length; ++i) + if (typeof object.endIndexValues[i] === "string") + $util.base64.decode(object.endIndexValues[i], message.endIndexValues[i] = $util.newBuffer($util.base64.length(object.endIndexValues[i])), 0); + else if (object.endIndexValues[i].length >= 0) + message.endIndexValues[i] = object.endIndexValues[i]; + } + if (object.startAtValueInfo != null) { + if (typeof object.startAtValueInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startAtValueInfo: object expected"); + message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.fromObject(object.startAtValueInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startIndexValues = []; + object.endIndexValues = []; + } + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + object.startAtValueInfo = null; + object.count = 0; + object.orderAscending = false; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.startIndexValues && message.startIndexValues.length) { + object.startIndexValues = []; + for (var j = 0; j < message.startIndexValues.length; ++j) + object.startIndexValues[j] = options.bytes === String ? $util.base64.encode(message.startIndexValues[j], 0, message.startIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.startIndexValues[j]) : message.startIndexValues[j]; + } + if (message.endIndexValues && message.endIndexValues.length) { + object.endIndexValues = []; + for (var j = 0; j < message.endIndexValues.length; ++j) + object.endIndexValues[j] = options.bytes === String ? $util.base64.encode(message.endIndexValues[j], 0, message.endIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.endIndexValues[j]) : message.endIndexValues[j]; + } + if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) + object.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.toObject(message.startAtValueInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourcesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesRequestV0.StartAtValueInfo = (function() { + + /** + * Properties of a StartAtValueInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @interface IStartAtValueInfo + * @property {Uint8Array|null} [startValue] StartAtValueInfo startValue + * @property {boolean|null} [startValueIncluded] StartAtValueInfo startValueIncluded + */ + + /** + * Constructs a new StartAtValueInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @classdesc Represents a StartAtValueInfo. + * @implements IStartAtValueInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set + */ + function StartAtValueInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtValueInfo startValue. + * @member {Uint8Array} startValue + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + */ + StartAtValueInfo.prototype.startValue = $util.newBuffer([]); + + /** + * StartAtValueInfo startValueIncluded. + * @member {boolean} startValueIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + */ + StartAtValueInfo.prototype.startValueIncluded = false; + + /** + * Creates a new StartAtValueInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo instance + */ + StartAtValueInfo.create = function create(properties) { + return new StartAtValueInfo(properties); + }; + + /** + * Encodes the specified StartAtValueInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtValueInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startValue != null && Object.hasOwnProperty.call(message, "startValue")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startValue); + if (message.startValueIncluded != null && Object.hasOwnProperty.call(message, "startValueIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startValueIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtValueInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtValueInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtValueInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtValueInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startValue = reader.bytes(); + break; + case 2: + message.startValueIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtValueInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtValueInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtValueInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtValueInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startValue != null && message.hasOwnProperty("startValue")) + if (!(message.startValue && typeof message.startValue.length === "number" || $util.isString(message.startValue))) + return "startValue: buffer expected"; + if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) + if (typeof message.startValueIncluded !== "boolean") + return "startValueIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtValueInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + */ + StartAtValueInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); + if (object.startValue != null) + if (typeof object.startValue === "string") + $util.base64.decode(object.startValue, message.startValue = $util.newBuffer($util.base64.length(object.startValue)), 0); + else if (object.startValue.length >= 0) + message.startValue = object.startValue; + if (object.startValueIncluded != null) + message.startValueIncluded = Boolean(object.startValueIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtValueInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} message StartAtValueInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtValueInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startValue = ""; + else { + object.startValue = []; + if (options.bytes !== Array) + object.startValue = $util.newBuffer(object.startValue); + } + object.startValueIncluded = false; + } + if (message.startValue != null && message.hasOwnProperty("startValue")) + object.startValue = options.bytes === String ? $util.base64.encode(message.startValue, 0, message.startValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValue) : message.startValue; + if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) + object.startValueIncluded = message.startValueIncluded; + return object; + }; + + /** + * Converts this StartAtValueInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtValueInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtValueInfo; + })(); + + return GetContestedResourcesRequestV0; + })(); + + return GetContestedResourcesRequest; + })(); + + v0.GetContestedResourcesResponse = (function() { + + /** + * Properties of a GetContestedResourcesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourcesResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null} [v0] GetContestedResourcesResponse v0 + */ + + /** + * Constructs a new GetContestedResourcesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourcesResponse. + * @implements IGetContestedResourcesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set + */ + function GetContestedResourcesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourcesResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + */ + GetContestedResourcesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + */ + Object.defineProperty(GetContestedResourcesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse instance + */ + GetContestedResourcesResponse.create = function create(properties) { + return new GetContestedResourcesResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourcesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + */ + GetContestedResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} message GetContestedResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourcesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesResponse.GetContestedResourcesResponseV0 = (function() { + + /** + * Properties of a GetContestedResourcesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @interface IGetContestedResourcesResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null} [contestedResourceValues] GetContestedResourcesResponseV0 contestedResourceValues + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourcesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourcesResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourcesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @classdesc Represents a GetContestedResourcesResponseV0. + * @implements IGetContestedResourcesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set + */ + function GetContestedResourcesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourcesResponseV0 contestedResourceValues. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null|undefined} contestedResourceValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.contestedResourceValues = null; + + /** + * GetContestedResourcesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.proof = null; + + /** + * GetContestedResourcesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesResponseV0 result. + * @member {"contestedResourceValues"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourcesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceValues", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 instance + */ + GetContestedResourcesResponseV0.create = function create(properties) { + return new GetContestedResourcesResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourcesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceValues != null && Object.hasOwnProperty.call(message, "contestedResourceValues")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.encode(message.contestedResourceValues, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify(message.contestedResourceValues); + if (error) + return "contestedResourceValues." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourcesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + */ + GetContestedResourcesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); + if (object.contestedResourceValues != null) { + if (typeof object.contestedResourceValues !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.contestedResourceValues: object expected"); + message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.fromObject(object.contestedResourceValues); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + object.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.toObject(message.contestedResourceValues, options); + if (options.oneofs) + object.result = "contestedResourceValues"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourcesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesResponseV0.ContestedResourceValues = (function() { + + /** + * Properties of a ContestedResourceValues. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @interface IContestedResourceValues + * @property {Array.|null} [contestedResourceValues] ContestedResourceValues contestedResourceValues + */ + + /** + * Constructs a new ContestedResourceValues. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @classdesc Represents a ContestedResourceValues. + * @implements IContestedResourceValues + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set + */ + function ContestedResourceValues(properties) { + this.contestedResourceValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceValues contestedResourceValues. + * @member {Array.} contestedResourceValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @instance + */ + ContestedResourceValues.prototype.contestedResourceValues = $util.emptyArray; + + /** + * Creates a new ContestedResourceValues instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues instance + */ + ContestedResourceValues.create = function create(properties) { + return new ContestedResourceValues(properties); + }; + + /** + * Encodes the specified ContestedResourceValues message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceValues != null && message.contestedResourceValues.length) + for (var i = 0; i < message.contestedResourceValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contestedResourceValues[i]); + return writer; + }; + + /** + * Encodes the specified ContestedResourceValues message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceValues message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceValues.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contestedResourceValues && message.contestedResourceValues.length)) + message.contestedResourceValues = []; + message.contestedResourceValues.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceValues message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + if (!Array.isArray(message.contestedResourceValues)) + return "contestedResourceValues: array expected"; + for (var i = 0; i < message.contestedResourceValues.length; ++i) + if (!(message.contestedResourceValues[i] && typeof message.contestedResourceValues[i].length === "number" || $util.isString(message.contestedResourceValues[i]))) + return "contestedResourceValues: buffer[] expected"; + } + return null; + }; + + /** + * Creates a ContestedResourceValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + */ + ContestedResourceValues.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); + if (object.contestedResourceValues) { + if (!Array.isArray(object.contestedResourceValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.contestedResourceValues: array expected"); + message.contestedResourceValues = []; + for (var i = 0; i < object.contestedResourceValues.length; ++i) + if (typeof object.contestedResourceValues[i] === "string") + $util.base64.decode(object.contestedResourceValues[i], message.contestedResourceValues[i] = $util.newBuffer($util.base64.length(object.contestedResourceValues[i])), 0); + else if (object.contestedResourceValues[i].length >= 0) + message.contestedResourceValues[i] = object.contestedResourceValues[i]; + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceValues message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} message ContestedResourceValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contestedResourceValues = []; + if (message.contestedResourceValues && message.contestedResourceValues.length) { + object.contestedResourceValues = []; + for (var j = 0; j < message.contestedResourceValues.length; ++j) + object.contestedResourceValues[j] = options.bytes === String ? $util.base64.encode(message.contestedResourceValues[j], 0, message.contestedResourceValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.contestedResourceValues[j]) : message.contestedResourceValues[j]; + } + return object; + }; + + /** + * Converts this ContestedResourceValues to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceValues; + })(); + + return GetContestedResourcesResponseV0; + })(); + + return GetContestedResourcesResponse; + })(); + + v0.GetVotePollsByEndDateRequest = (function() { + + /** + * Properties of a GetVotePollsByEndDateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetVotePollsByEndDateRequest + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null} [v0] GetVotePollsByEndDateRequest v0 + */ + + /** + * Constructs a new GetVotePollsByEndDateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetVotePollsByEndDateRequest. + * @implements IGetVotePollsByEndDateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set + */ + function GetVotePollsByEndDateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVotePollsByEndDateRequest v0. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + */ + GetVotePollsByEndDateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest instance + */ + GetVotePollsByEndDateRequest.create = function create(properties) { + return new GetVotePollsByEndDateRequest(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + */ + GetVotePollsByEndDateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetVotePollsByEndDateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 = (function() { + + /** + * Properties of a GetVotePollsByEndDateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @interface IGetVotePollsByEndDateRequestV0 + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null} [startTimeInfo] GetVotePollsByEndDateRequestV0 startTimeInfo + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null} [endTimeInfo] GetVotePollsByEndDateRequestV0 endTimeInfo + * @property {number|null} [limit] GetVotePollsByEndDateRequestV0 limit + * @property {number|null} [offset] GetVotePollsByEndDateRequestV0 offset + * @property {boolean|null} [ascending] GetVotePollsByEndDateRequestV0 ascending + * @property {boolean|null} [prove] GetVotePollsByEndDateRequestV0 prove + */ + + /** + * Constructs a new GetVotePollsByEndDateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @classdesc Represents a GetVotePollsByEndDateRequestV0. + * @implements IGetVotePollsByEndDateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set + */ + function GetVotePollsByEndDateRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVotePollsByEndDateRequestV0 startTimeInfo. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null|undefined} startTimeInfo + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.startTimeInfo = null; + + /** + * GetVotePollsByEndDateRequestV0 endTimeInfo. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null|undefined} endTimeInfo + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.endTimeInfo = null; + + /** + * GetVotePollsByEndDateRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.limit = 0; + + /** + * GetVotePollsByEndDateRequestV0 offset. + * @member {number} offset + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.offset = 0; + + /** + * GetVotePollsByEndDateRequestV0 ascending. + * @member {boolean} ascending + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.ascending = false; + + /** + * GetVotePollsByEndDateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.prove = false; + + /** + * Creates a new GetVotePollsByEndDateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 instance + */ + GetVotePollsByEndDateRequestV0.create = function create(properties) { + return new GetVotePollsByEndDateRequestV0(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeInfo != null && Object.hasOwnProperty.call(message, "startTimeInfo")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.encode(message.startTimeInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTimeInfo != null && Object.hasOwnProperty.call(message, "endTimeInfo")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.encode(message.endTimeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.offset); + if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ascending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.decode(reader, reader.uint32()); + break; + case 2: + message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.limit = reader.uint32(); + break; + case 4: + message.offset = reader.uint32(); + break; + case 5: + message.ascending = reader.bool(); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify(message.startTimeInfo); + if (error) + return "startTimeInfo." + error; + } + if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify(message.endTimeInfo); + if (error) + return "endTimeInfo." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.ascending != null && message.hasOwnProperty("ascending")) + if (typeof message.ascending !== "boolean") + return "ascending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetVotePollsByEndDateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + */ + GetVotePollsByEndDateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); + if (object.startTimeInfo != null) { + if (typeof object.startTimeInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.startTimeInfo: object expected"); + message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.fromObject(object.startTimeInfo); + } + if (object.endTimeInfo != null) { + if (typeof object.endTimeInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.endTimeInfo: object expected"); + message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.fromObject(object.endTimeInfo); + } + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.offset != null) + message.offset = object.offset >>> 0; + if (object.ascending != null) + message.ascending = Boolean(object.ascending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeInfo = null; + object.endTimeInfo = null; + object.limit = 0; + object.offset = 0; + object.ascending = false; + object.prove = false; + } + if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) + object.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.toObject(message.startTimeInfo, options); + if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) + object.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.toObject(message.endTimeInfo, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.ascending != null && message.hasOwnProperty("ascending")) + object.ascending = message.ascending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetVotePollsByEndDateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateRequestV0.StartAtTimeInfo = (function() { + + /** + * Properties of a StartAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @interface IStartAtTimeInfo + * @property {number|Long|null} [startTimeMs] StartAtTimeInfo startTimeMs + * @property {boolean|null} [startTimeIncluded] StartAtTimeInfo startTimeIncluded + */ + + /** + * Constructs a new StartAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @classdesc Represents a StartAtTimeInfo. + * @implements IStartAtTimeInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set + */ + function StartAtTimeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtTimeInfo startTimeMs. + * @member {number|Long} startTimeMs + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + */ + StartAtTimeInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StartAtTimeInfo startTimeIncluded. + * @member {boolean} startTimeIncluded + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + */ + StartAtTimeInfo.prototype.startTimeIncluded = false; + + /** + * Creates a new StartAtTimeInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo instance + */ + StartAtTimeInfo.create = function create(properties) { + return new StartAtTimeInfo(properties); + }; + + /** + * Encodes the specified StartAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtTimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); + if (message.startTimeIncluded != null && Object.hasOwnProperty.call(message, "startTimeIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startTimeIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtTimeInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtTimeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeMs = reader.uint64(); + break; + case 2: + message.startTimeIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtTimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtTimeInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtTimeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) + return "startTimeMs: integer|Long expected"; + if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) + if (typeof message.startTimeIncluded !== "boolean") + return "startTimeIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtTimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + */ + StartAtTimeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); + if (object.startTimeMs != null) + if ($util.Long) + (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; + else if (typeof object.startTimeMs === "string") + message.startTimeMs = parseInt(object.startTimeMs, 10); + else if (typeof object.startTimeMs === "number") + message.startTimeMs = object.startTimeMs; + else if (typeof object.startTimeMs === "object") + message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); + if (object.startTimeIncluded != null) + message.startTimeIncluded = Boolean(object.startTimeIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtTimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} message StartAtTimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtTimeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTimeMs = options.longs === String ? "0" : 0; + object.startTimeIncluded = false; + } + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (typeof message.startTimeMs === "number") + object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; + else + object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; + if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) + object.startTimeIncluded = message.startTimeIncluded; + return object; + }; + + /** + * Converts this StartAtTimeInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtTimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtTimeInfo; + })(); + + GetVotePollsByEndDateRequestV0.EndAtTimeInfo = (function() { + + /** + * Properties of an EndAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @interface IEndAtTimeInfo + * @property {number|Long|null} [endTimeMs] EndAtTimeInfo endTimeMs + * @property {boolean|null} [endTimeIncluded] EndAtTimeInfo endTimeIncluded + */ + + /** + * Constructs a new EndAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @classdesc Represents an EndAtTimeInfo. + * @implements IEndAtTimeInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set + */ + function EndAtTimeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndAtTimeInfo endTimeMs. + * @member {number|Long} endTimeMs + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + */ + EndAtTimeInfo.prototype.endTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EndAtTimeInfo endTimeIncluded. + * @member {boolean} endTimeIncluded + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + */ + EndAtTimeInfo.prototype.endTimeIncluded = false; + + /** + * Creates a new EndAtTimeInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo instance + */ + EndAtTimeInfo.create = function create(properties) { + return new EndAtTimeInfo(properties); + }; + + /** + * Encodes the specified EndAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndAtTimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endTimeMs != null && Object.hasOwnProperty.call(message, "endTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.endTimeMs); + if (message.endTimeIncluded != null && Object.hasOwnProperty.call(message, "endTimeIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.endTimeIncluded); + return writer; + }; + + /** + * Encodes the specified EndAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndAtTimeInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndAtTimeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.endTimeMs = reader.uint64(); + break; + case 2: + message.endTimeIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndAtTimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndAtTimeInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndAtTimeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) + if (!$util.isInteger(message.endTimeMs) && !(message.endTimeMs && $util.isInteger(message.endTimeMs.low) && $util.isInteger(message.endTimeMs.high))) + return "endTimeMs: integer|Long expected"; + if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) + if (typeof message.endTimeIncluded !== "boolean") + return "endTimeIncluded: boolean expected"; + return null; + }; + + /** + * Creates an EndAtTimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + */ + EndAtTimeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); + if (object.endTimeMs != null) + if ($util.Long) + (message.endTimeMs = $util.Long.fromValue(object.endTimeMs)).unsigned = true; + else if (typeof object.endTimeMs === "string") + message.endTimeMs = parseInt(object.endTimeMs, 10); + else if (typeof object.endTimeMs === "number") + message.endTimeMs = object.endTimeMs; + else if (typeof object.endTimeMs === "object") + message.endTimeMs = new $util.LongBits(object.endTimeMs.low >>> 0, object.endTimeMs.high >>> 0).toNumber(true); + if (object.endTimeIncluded != null) + message.endTimeIncluded = Boolean(object.endTimeIncluded); + return message; + }; + + /** + * Creates a plain object from an EndAtTimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} message EndAtTimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndAtTimeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.endTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTimeMs = options.longs === String ? "0" : 0; + object.endTimeIncluded = false; + } + if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) + if (typeof message.endTimeMs === "number") + object.endTimeMs = options.longs === String ? String(message.endTimeMs) : message.endTimeMs; + else + object.endTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeMs) : options.longs === Number ? new $util.LongBits(message.endTimeMs.low >>> 0, message.endTimeMs.high >>> 0).toNumber(true) : message.endTimeMs; + if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) + object.endTimeIncluded = message.endTimeIncluded; + return object; + }; + + /** + * Converts this EndAtTimeInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + * @returns {Object.} JSON object + */ + EndAtTimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EndAtTimeInfo; + })(); + + return GetVotePollsByEndDateRequestV0; + })(); + + return GetVotePollsByEndDateRequest; + })(); + + v0.GetVotePollsByEndDateResponse = (function() { + + /** + * Properties of a GetVotePollsByEndDateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetVotePollsByEndDateResponse + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null} [v0] GetVotePollsByEndDateResponse v0 + */ + + /** + * Constructs a new GetVotePollsByEndDateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetVotePollsByEndDateResponse. + * @implements IGetVotePollsByEndDateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set + */ + function GetVotePollsByEndDateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVotePollsByEndDateResponse v0. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + */ + GetVotePollsByEndDateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse instance + */ + GetVotePollsByEndDateResponse.create = function create(properties) { + return new GetVotePollsByEndDateResponse(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + */ + GetVotePollsByEndDateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetVotePollsByEndDateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 = (function() { + + /** + * Properties of a GetVotePollsByEndDateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @interface IGetVotePollsByEndDateResponseV0 + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null} [votePollsByTimestamps] GetVotePollsByEndDateResponseV0 votePollsByTimestamps + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetVotePollsByEndDateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetVotePollsByEndDateResponseV0 metadata + */ + + /** + * Constructs a new GetVotePollsByEndDateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @classdesc Represents a GetVotePollsByEndDateResponseV0. + * @implements IGetVotePollsByEndDateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set + */ + function GetVotePollsByEndDateResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVotePollsByEndDateResponseV0 votePollsByTimestamps. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null|undefined} votePollsByTimestamps + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.votePollsByTimestamps = null; + + /** + * GetVotePollsByEndDateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.proof = null; + + /** + * GetVotePollsByEndDateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateResponseV0 result. + * @member {"votePollsByTimestamps"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["votePollsByTimestamps", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 instance + */ + GetVotePollsByEndDateResponseV0.create = function create(properties) { + return new GetVotePollsByEndDateResponseV0(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votePollsByTimestamps != null && Object.hasOwnProperty.call(message, "votePollsByTimestamps")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.encode(message.votePollsByTimestamps, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify(message.votePollsByTimestamps); + if (error) + return "votePollsByTimestamps." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + */ + GetVotePollsByEndDateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); + if (object.votePollsByTimestamps != null) { + if (typeof object.votePollsByTimestamps !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.votePollsByTimestamps: object expected"); + message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.fromObject(object.votePollsByTimestamps); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + object.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.toObject(message.votePollsByTimestamps, options); + if (options.oneofs) + object.result = "votePollsByTimestamps"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetVotePollsByEndDateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp = (function() { + + /** + * Properties of a SerializedVotePollsByTimestamp. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @interface ISerializedVotePollsByTimestamp + * @property {number|Long|null} [timestamp] SerializedVotePollsByTimestamp timestamp + * @property {Array.|null} [serializedVotePolls] SerializedVotePollsByTimestamp serializedVotePolls + */ + + /** + * Constructs a new SerializedVotePollsByTimestamp. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @classdesc Represents a SerializedVotePollsByTimestamp. + * @implements ISerializedVotePollsByTimestamp + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set + */ + function SerializedVotePollsByTimestamp(properties) { + this.serializedVotePolls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerializedVotePollsByTimestamp timestamp. + * @member {number|Long} timestamp + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + */ + SerializedVotePollsByTimestamp.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SerializedVotePollsByTimestamp serializedVotePolls. + * @member {Array.} serializedVotePolls + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + */ + SerializedVotePollsByTimestamp.prototype.serializedVotePolls = $util.emptyArray; + + /** + * Creates a new SerializedVotePollsByTimestamp instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp instance + */ + SerializedVotePollsByTimestamp.create = function create(properties) { + return new SerializedVotePollsByTimestamp(properties); + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamp message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); + if (message.serializedVotePolls != null && message.serializedVotePolls.length) + for (var i = 0; i < message.serializedVotePolls.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.serializedVotePolls[i]); + return writer; + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamp message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + if (!(message.serializedVotePolls && message.serializedVotePolls.length)) + message.serializedVotePolls = []; + message.serializedVotePolls.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerializedVotePollsByTimestamp message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerializedVotePollsByTimestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.serializedVotePolls != null && message.hasOwnProperty("serializedVotePolls")) { + if (!Array.isArray(message.serializedVotePolls)) + return "serializedVotePolls: array expected"; + for (var i = 0; i < message.serializedVotePolls.length; ++i) + if (!(message.serializedVotePolls[i] && typeof message.serializedVotePolls[i].length === "number" || $util.isString(message.serializedVotePolls[i]))) + return "serializedVotePolls: buffer[] expected"; + } + return null; + }; + + /** + * Creates a SerializedVotePollsByTimestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + */ + SerializedVotePollsByTimestamp.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.serializedVotePolls) { + if (!Array.isArray(object.serializedVotePolls)) + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.serializedVotePolls: array expected"); + message.serializedVotePolls = []; + for (var i = 0; i < object.serializedVotePolls.length; ++i) + if (typeof object.serializedVotePolls[i] === "string") + $util.base64.decode(object.serializedVotePolls[i], message.serializedVotePolls[i] = $util.newBuffer($util.base64.length(object.serializedVotePolls[i])), 0); + else if (object.serializedVotePolls[i].length >= 0) + message.serializedVotePolls[i] = object.serializedVotePolls[i]; + } + return message; + }; + + /** + * Creates a plain object from a SerializedVotePollsByTimestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerializedVotePollsByTimestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serializedVotePolls = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.serializedVotePolls && message.serializedVotePolls.length) { + object.serializedVotePolls = []; + for (var j = 0; j < message.serializedVotePolls.length; ++j) + object.serializedVotePolls[j] = options.bytes === String ? $util.base64.encode(message.serializedVotePolls[j], 0, message.serializedVotePolls[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedVotePolls[j]) : message.serializedVotePolls[j]; + } + return object; + }; + + /** + * Converts this SerializedVotePollsByTimestamp to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + * @returns {Object.} JSON object + */ + SerializedVotePollsByTimestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerializedVotePollsByTimestamp; + })(); + + GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps = (function() { + + /** + * Properties of a SerializedVotePollsByTimestamps. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @interface ISerializedVotePollsByTimestamps + * @property {Array.|null} [votePollsByTimestamps] SerializedVotePollsByTimestamps votePollsByTimestamps + * @property {boolean|null} [finishedResults] SerializedVotePollsByTimestamps finishedResults + */ + + /** + * Constructs a new SerializedVotePollsByTimestamps. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @classdesc Represents a SerializedVotePollsByTimestamps. + * @implements ISerializedVotePollsByTimestamps + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set + */ + function SerializedVotePollsByTimestamps(properties) { + this.votePollsByTimestamps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerializedVotePollsByTimestamps votePollsByTimestamps. + * @member {Array.} votePollsByTimestamps + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + */ + SerializedVotePollsByTimestamps.prototype.votePollsByTimestamps = $util.emptyArray; + + /** + * SerializedVotePollsByTimestamps finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + */ + SerializedVotePollsByTimestamps.prototype.finishedResults = false; + + /** + * Creates a new SerializedVotePollsByTimestamps instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps instance + */ + SerializedVotePollsByTimestamps.create = function create(properties) { + return new SerializedVotePollsByTimestamps(properties); + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamps message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamps.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votePollsByTimestamps != null && message.votePollsByTimestamps.length) + for (var i = 0; i < message.votePollsByTimestamps.length; ++i) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.encode(message.votePollsByTimestamps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamps message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamps.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamps.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.votePollsByTimestamps && message.votePollsByTimestamps.length)) + message.votePollsByTimestamps = []; + message.votePollsByTimestamps.push($root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.decode(reader, reader.uint32())); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamps.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerializedVotePollsByTimestamps message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerializedVotePollsByTimestamps.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + if (!Array.isArray(message.votePollsByTimestamps)) + return "votePollsByTimestamps: array expected"; + for (var i = 0; i < message.votePollsByTimestamps.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify(message.votePollsByTimestamps[i]); + if (error) + return "votePollsByTimestamps." + error; + } + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a SerializedVotePollsByTimestamps message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + */ + SerializedVotePollsByTimestamps.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); + if (object.votePollsByTimestamps) { + if (!Array.isArray(object.votePollsByTimestamps)) + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: array expected"); + message.votePollsByTimestamps = []; + for (var i = 0; i < object.votePollsByTimestamps.length; ++i) { + if (typeof object.votePollsByTimestamps[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: object expected"); + message.votePollsByTimestamps[i] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.fromObject(object.votePollsByTimestamps[i]); + } + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a SerializedVotePollsByTimestamps message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerializedVotePollsByTimestamps.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.votePollsByTimestamps = []; + if (options.defaults) + object.finishedResults = false; + if (message.votePollsByTimestamps && message.votePollsByTimestamps.length) { + object.votePollsByTimestamps = []; + for (var j = 0; j < message.votePollsByTimestamps.length; ++j) + object.votePollsByTimestamps[j] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.toObject(message.votePollsByTimestamps[j], options); + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this SerializedVotePollsByTimestamps to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + * @returns {Object.} JSON object + */ + SerializedVotePollsByTimestamps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerializedVotePollsByTimestamps; + })(); + + return GetVotePollsByEndDateResponseV0; + })(); + + return GetVotePollsByEndDateResponse; + })(); + + v0.GetContestedResourceVoteStateRequest = (function() { + + /** + * Properties of a GetContestedResourceVoteStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVoteStateRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null} [v0] GetContestedResourceVoteStateRequest v0 + */ + + /** + * Constructs a new GetContestedResourceVoteStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVoteStateRequest. + * @implements IGetContestedResourceVoteStateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set + */ + function GetContestedResourceVoteStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVoteStateRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + */ + GetContestedResourceVoteStateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest instance + */ + GetContestedResourceVoteStateRequest.create = function create(properties) { + return new GetContestedResourceVoteStateRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + */ + GetContestedResourceVoteStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceVoteStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @interface IGetContestedResourceVoteStateRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourceVoteStateRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourceVoteStateRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourceVoteStateRequestV0 indexName + * @property {Array.|null} [indexValues] GetContestedResourceVoteStateRequestV0 indexValues + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType|null} [resultType] GetContestedResourceVoteStateRequestV0 resultType + * @property {boolean|null} [allowIncludeLockedAndAbstainingVoteTally] GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo + * @property {number|null} [count] GetContestedResourceVoteStateRequestV0 count + * @property {boolean|null} [prove] GetContestedResourceVoteStateRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceVoteStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @classdesc Represents a GetContestedResourceVoteStateRequestV0. + * @implements IGetContestedResourceVoteStateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set + */ + function GetContestedResourceVoteStateRequestV0(properties) { + this.indexValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVoteStateRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourceVoteStateRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourceVoteStateRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourceVoteStateRequestV0 indexValues. + * @member {Array.} indexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.indexValues = $util.emptyArray; + + /** + * GetContestedResourceVoteStateRequestV0 resultType. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType} resultType + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.resultType = 0; + + /** + * GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally. + * @member {boolean} allowIncludeLockedAndAbstainingVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.allowIncludeLockedAndAbstainingVoteTally = false; + + /** + * GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.startAtIdentifierInfo = null; + + /** + * GetContestedResourceVoteStateRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.count = 0; + + /** + * GetContestedResourceVoteStateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceVoteStateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 instance + */ + GetContestedResourceVoteStateRequestV0.create = function create(properties) { + return new GetContestedResourceVoteStateRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.indexValues != null && message.indexValues.length) + for (var i = 0; i < message.indexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); + if (message.resultType != null && Object.hasOwnProperty.call(message, "resultType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resultType); + if (message.allowIncludeLockedAndAbstainingVoteTally != null && Object.hasOwnProperty.call(message, "allowIncludeLockedAndAbstainingVoteTally")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowIncludeLockedAndAbstainingVoteTally); + if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.indexValues && message.indexValues.length)) + message.indexValues = []; + message.indexValues.push(reader.bytes()); + break; + case 5: + message.resultType = reader.int32(); + break; + case 6: + message.allowIncludeLockedAndAbstainingVoteTally = reader.bool(); + break; + case 7: + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); + break; + case 8: + message.count = reader.uint32(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.indexValues != null && message.hasOwnProperty("indexValues")) { + if (!Array.isArray(message.indexValues)) + return "indexValues: array expected"; + for (var i = 0; i < message.indexValues.length; ++i) + if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) + return "indexValues: buffer[] expected"; + } + if (message.resultType != null && message.hasOwnProperty("resultType")) + switch (message.resultType) { + default: + return "resultType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) + if (typeof message.allowIncludeLockedAndAbstainingVoteTally !== "boolean") + return "allowIncludeLockedAndAbstainingVoteTally: boolean expected"; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); + if (error) + return "startAtIdentifierInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + */ + GetContestedResourceVoteStateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.indexValues) { + if (!Array.isArray(object.indexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.indexValues: array expected"); + message.indexValues = []; + for (var i = 0; i < object.indexValues.length; ++i) + if (typeof object.indexValues[i] === "string") + $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); + else if (object.indexValues[i].length >= 0) + message.indexValues[i] = object.indexValues[i]; + } + switch (object.resultType) { + case "DOCUMENTS": + case 0: + message.resultType = 0; + break; + case "VOTE_TALLY": + case 1: + message.resultType = 1; + break; + case "DOCUMENTS_AND_VOTE_TALLY": + case 2: + message.resultType = 2; + break; + } + if (object.allowIncludeLockedAndAbstainingVoteTally != null) + message.allowIncludeLockedAndAbstainingVoteTally = Boolean(object.allowIncludeLockedAndAbstainingVoteTally); + if (object.startAtIdentifierInfo != null) { + if (typeof object.startAtIdentifierInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.startAtIdentifierInfo: object expected"); + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + object.resultType = options.enums === String ? "DOCUMENTS" : 0; + object.allowIncludeLockedAndAbstainingVoteTally = false; + object.startAtIdentifierInfo = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.indexValues && message.indexValues.length) { + object.indexValues = []; + for (var j = 0; j < message.indexValues.length; ++j) + object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; + } + if (message.resultType != null && message.hasOwnProperty("resultType")) + object.resultType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType[message.resultType] : message.resultType; + if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) + object.allowIncludeLockedAndAbstainingVoteTally = message.allowIncludeLockedAndAbstainingVoteTally; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) + object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo = (function() { + + /** + * Properties of a StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @interface IStartAtIdentifierInfo + * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier + * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded + */ + + /** + * Constructs a new StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @classdesc Represents a StartAtIdentifierInfo. + * @implements IStartAtIdentifierInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + */ + function StartAtIdentifierInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtIdentifierInfo startIdentifier. + * @member {Uint8Array} startIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); + + /** + * StartAtIdentifierInfo startIdentifierIncluded. + * @member {boolean} startIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; + + /** + * Creates a new StartAtIdentifierInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance + */ + StartAtIdentifierInfo.create = function create(properties) { + return new StartAtIdentifierInfo(properties); + }; + + /** + * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); + if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startIdentifier = reader.bytes(); + break; + case 2: + message.startIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtIdentifierInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtIdentifierInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) + return "startIdentifier: buffer expected"; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + if (typeof message.startIdentifierIncluded !== "boolean") + return "startIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + */ + StartAtIdentifierInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); + if (object.startIdentifier != null) + if (typeof object.startIdentifier === "string") + $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); + else if (object.startIdentifier.length >= 0) + message.startIdentifier = object.startIdentifier; + if (object.startIdentifierIncluded != null) + message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtIdentifierInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startIdentifier = ""; + else { + object.startIdentifier = []; + if (options.bytes !== Array) + object.startIdentifier = $util.newBuffer(object.startIdentifier); + } + object.startIdentifierIncluded = false; + } + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + object.startIdentifierIncluded = message.startIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtIdentifierInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtIdentifierInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtIdentifierInfo; + })(); + + /** + * ResultType enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType + * @enum {number} + * @property {number} DOCUMENTS=0 DOCUMENTS value + * @property {number} VOTE_TALLY=1 VOTE_TALLY value + * @property {number} DOCUMENTS_AND_VOTE_TALLY=2 DOCUMENTS_AND_VOTE_TALLY value + */ + GetContestedResourceVoteStateRequestV0.ResultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENTS"] = 0; + values[valuesById[1] = "VOTE_TALLY"] = 1; + values[valuesById[2] = "DOCUMENTS_AND_VOTE_TALLY"] = 2; + return values; + })(); + + return GetContestedResourceVoteStateRequestV0; + })(); + + return GetContestedResourceVoteStateRequest; + })(); + + v0.GetContestedResourceVoteStateResponse = (function() { + + /** + * Properties of a GetContestedResourceVoteStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVoteStateResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null} [v0] GetContestedResourceVoteStateResponse v0 + */ + + /** + * Constructs a new GetContestedResourceVoteStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVoteStateResponse. + * @implements IGetContestedResourceVoteStateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set + */ + function GetContestedResourceVoteStateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVoteStateResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + */ + GetContestedResourceVoteStateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse instance + */ + GetContestedResourceVoteStateResponse.create = function create(properties) { + return new GetContestedResourceVoteStateResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + */ + GetContestedResourceVoteStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceVoteStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @interface IGetContestedResourceVoteStateResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null} [contestedResourceContenders] GetContestedResourceVoteStateResponseV0 contestedResourceContenders + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVoteStateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVoteStateResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceVoteStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @classdesc Represents a GetContestedResourceVoteStateResponseV0. + * @implements IGetContestedResourceVoteStateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set + */ + function GetContestedResourceVoteStateResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVoteStateResponseV0 contestedResourceContenders. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null|undefined} contestedResourceContenders + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.contestedResourceContenders = null; + + /** + * GetContestedResourceVoteStateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.proof = null; + + /** + * GetContestedResourceVoteStateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateResponseV0 result. + * @member {"contestedResourceContenders"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceContenders", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 instance + */ + GetContestedResourceVoteStateResponseV0.create = function create(properties) { + return new GetContestedResourceVoteStateResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceContenders != null && Object.hasOwnProperty.call(message, "contestedResourceContenders")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.encode(message.contestedResourceContenders, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify(message.contestedResourceContenders); + if (error) + return "contestedResourceContenders." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + */ + GetContestedResourceVoteStateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); + if (object.contestedResourceContenders != null) { + if (typeof object.contestedResourceContenders !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.contestedResourceContenders: object expected"); + message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.fromObject(object.contestedResourceContenders); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { + object.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.toObject(message.contestedResourceContenders, options); + if (options.oneofs) + object.result = "contestedResourceContenders"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateResponseV0.FinishedVoteInfo = (function() { + + /** + * Properties of a FinishedVoteInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IFinishedVoteInfo + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome|null} [finishedVoteOutcome] FinishedVoteInfo finishedVoteOutcome + * @property {Uint8Array|null} [wonByIdentityId] FinishedVoteInfo wonByIdentityId + * @property {number|Long|null} [finishedAtBlockHeight] FinishedVoteInfo finishedAtBlockHeight + * @property {number|null} [finishedAtCoreBlockHeight] FinishedVoteInfo finishedAtCoreBlockHeight + * @property {number|Long|null} [finishedAtBlockTimeMs] FinishedVoteInfo finishedAtBlockTimeMs + * @property {number|null} [finishedAtEpoch] FinishedVoteInfo finishedAtEpoch + */ + + /** + * Constructs a new FinishedVoteInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a FinishedVoteInfo. + * @implements IFinishedVoteInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set + */ + function FinishedVoteInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FinishedVoteInfo finishedVoteOutcome. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome} finishedVoteOutcome + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedVoteOutcome = 0; + + /** + * FinishedVoteInfo wonByIdentityId. + * @member {Uint8Array} wonByIdentityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.wonByIdentityId = $util.newBuffer([]); + + /** + * FinishedVoteInfo finishedAtBlockHeight. + * @member {number|Long} finishedAtBlockHeight + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * FinishedVoteInfo finishedAtCoreBlockHeight. + * @member {number} finishedAtCoreBlockHeight + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtCoreBlockHeight = 0; + + /** + * FinishedVoteInfo finishedAtBlockTimeMs. + * @member {number|Long} finishedAtBlockTimeMs + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtBlockTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * FinishedVoteInfo finishedAtEpoch. + * @member {number} finishedAtEpoch + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtEpoch = 0; + + /** + * Creates a new FinishedVoteInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo instance + */ + FinishedVoteInfo.create = function create(properties) { + return new FinishedVoteInfo(properties); + }; + + /** + * Encodes the specified FinishedVoteInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishedVoteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finishedVoteOutcome != null && Object.hasOwnProperty.call(message, "finishedVoteOutcome")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.finishedVoteOutcome); + if (message.wonByIdentityId != null && Object.hasOwnProperty.call(message, "wonByIdentityId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.wonByIdentityId); + if (message.finishedAtBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtBlockHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.finishedAtBlockHeight); + if (message.finishedAtCoreBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtCoreBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.finishedAtCoreBlockHeight); + if (message.finishedAtBlockTimeMs != null && Object.hasOwnProperty.call(message, "finishedAtBlockTimeMs")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.finishedAtBlockTimeMs); + if (message.finishedAtEpoch != null && Object.hasOwnProperty.call(message, "finishedAtEpoch")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.finishedAtEpoch); + return writer; + }; + + /** + * Encodes the specified FinishedVoteInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishedVoteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinishedVoteInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishedVoteInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finishedVoteOutcome = reader.int32(); + break; + case 2: + message.wonByIdentityId = reader.bytes(); + break; + case 3: + message.finishedAtBlockHeight = reader.uint64(); + break; + case 4: + message.finishedAtCoreBlockHeight = reader.uint32(); + break; + case 5: + message.finishedAtBlockTimeMs = reader.uint64(); + break; + case 6: + message.finishedAtEpoch = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinishedVoteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishedVoteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinishedVoteInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinishedVoteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) + switch (message.finishedVoteOutcome) { + default: + return "finishedVoteOutcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) + if (!(message.wonByIdentityId && typeof message.wonByIdentityId.length === "number" || $util.isString(message.wonByIdentityId))) + return "wonByIdentityId: buffer expected"; + if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) + if (!$util.isInteger(message.finishedAtBlockHeight) && !(message.finishedAtBlockHeight && $util.isInteger(message.finishedAtBlockHeight.low) && $util.isInteger(message.finishedAtBlockHeight.high))) + return "finishedAtBlockHeight: integer|Long expected"; + if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) + if (!$util.isInteger(message.finishedAtCoreBlockHeight)) + return "finishedAtCoreBlockHeight: integer expected"; + if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) + if (!$util.isInteger(message.finishedAtBlockTimeMs) && !(message.finishedAtBlockTimeMs && $util.isInteger(message.finishedAtBlockTimeMs.low) && $util.isInteger(message.finishedAtBlockTimeMs.high))) + return "finishedAtBlockTimeMs: integer|Long expected"; + if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) + if (!$util.isInteger(message.finishedAtEpoch)) + return "finishedAtEpoch: integer expected"; + return null; + }; + + /** + * Creates a FinishedVoteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + */ + FinishedVoteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); + switch (object.finishedVoteOutcome) { + case "TOWARDS_IDENTITY": + case 0: + message.finishedVoteOutcome = 0; + break; + case "LOCKED": + case 1: + message.finishedVoteOutcome = 1; + break; + case "NO_PREVIOUS_WINNER": + case 2: + message.finishedVoteOutcome = 2; + break; + } + if (object.wonByIdentityId != null) + if (typeof object.wonByIdentityId === "string") + $util.base64.decode(object.wonByIdentityId, message.wonByIdentityId = $util.newBuffer($util.base64.length(object.wonByIdentityId)), 0); + else if (object.wonByIdentityId.length >= 0) + message.wonByIdentityId = object.wonByIdentityId; + if (object.finishedAtBlockHeight != null) + if ($util.Long) + (message.finishedAtBlockHeight = $util.Long.fromValue(object.finishedAtBlockHeight)).unsigned = true; + else if (typeof object.finishedAtBlockHeight === "string") + message.finishedAtBlockHeight = parseInt(object.finishedAtBlockHeight, 10); + else if (typeof object.finishedAtBlockHeight === "number") + message.finishedAtBlockHeight = object.finishedAtBlockHeight; + else if (typeof object.finishedAtBlockHeight === "object") + message.finishedAtBlockHeight = new $util.LongBits(object.finishedAtBlockHeight.low >>> 0, object.finishedAtBlockHeight.high >>> 0).toNumber(true); + if (object.finishedAtCoreBlockHeight != null) + message.finishedAtCoreBlockHeight = object.finishedAtCoreBlockHeight >>> 0; + if (object.finishedAtBlockTimeMs != null) + if ($util.Long) + (message.finishedAtBlockTimeMs = $util.Long.fromValue(object.finishedAtBlockTimeMs)).unsigned = true; + else if (typeof object.finishedAtBlockTimeMs === "string") + message.finishedAtBlockTimeMs = parseInt(object.finishedAtBlockTimeMs, 10); + else if (typeof object.finishedAtBlockTimeMs === "number") + message.finishedAtBlockTimeMs = object.finishedAtBlockTimeMs; + else if (typeof object.finishedAtBlockTimeMs === "object") + message.finishedAtBlockTimeMs = new $util.LongBits(object.finishedAtBlockTimeMs.low >>> 0, object.finishedAtBlockTimeMs.high >>> 0).toNumber(true); + if (object.finishedAtEpoch != null) + message.finishedAtEpoch = object.finishedAtEpoch >>> 0; + return message; + }; + + /** + * Creates a plain object from a FinishedVoteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} message FinishedVoteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinishedVoteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finishedVoteOutcome = options.enums === String ? "TOWARDS_IDENTITY" : 0; + if (options.bytes === String) + object.wonByIdentityId = ""; + else { + object.wonByIdentityId = []; + if (options.bytes !== Array) + object.wonByIdentityId = $util.newBuffer(object.wonByIdentityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.finishedAtBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.finishedAtBlockHeight = options.longs === String ? "0" : 0; + object.finishedAtCoreBlockHeight = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.finishedAtBlockTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.finishedAtBlockTimeMs = options.longs === String ? "0" : 0; + object.finishedAtEpoch = 0; + } + if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) + object.finishedVoteOutcome = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome[message.finishedVoteOutcome] : message.finishedVoteOutcome; + if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) + object.wonByIdentityId = options.bytes === String ? $util.base64.encode(message.wonByIdentityId, 0, message.wonByIdentityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.wonByIdentityId) : message.wonByIdentityId; + if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) + if (typeof message.finishedAtBlockHeight === "number") + object.finishedAtBlockHeight = options.longs === String ? String(message.finishedAtBlockHeight) : message.finishedAtBlockHeight; + else + object.finishedAtBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockHeight) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockHeight.low >>> 0, message.finishedAtBlockHeight.high >>> 0).toNumber(true) : message.finishedAtBlockHeight; + if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) + object.finishedAtCoreBlockHeight = message.finishedAtCoreBlockHeight; + if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) + if (typeof message.finishedAtBlockTimeMs === "number") + object.finishedAtBlockTimeMs = options.longs === String ? String(message.finishedAtBlockTimeMs) : message.finishedAtBlockTimeMs; + else + object.finishedAtBlockTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockTimeMs) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockTimeMs.low >>> 0, message.finishedAtBlockTimeMs.high >>> 0).toNumber(true) : message.finishedAtBlockTimeMs; + if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) + object.finishedAtEpoch = message.finishedAtEpoch; + return object; + }; + + /** + * Converts this FinishedVoteInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + * @returns {Object.} JSON object + */ + FinishedVoteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * FinishedVoteOutcome enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome + * @enum {number} + * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value + * @property {number} LOCKED=1 LOCKED value + * @property {number} NO_PREVIOUS_WINNER=2 NO_PREVIOUS_WINNER value + */ + FinishedVoteInfo.FinishedVoteOutcome = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; + values[valuesById[1] = "LOCKED"] = 1; + values[valuesById[2] = "NO_PREVIOUS_WINNER"] = 2; + return values; + })(); + + return FinishedVoteInfo; + })(); + + GetContestedResourceVoteStateResponseV0.ContestedResourceContenders = (function() { + + /** + * Properties of a ContestedResourceContenders. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IContestedResourceContenders + * @property {Array.|null} [contenders] ContestedResourceContenders contenders + * @property {number|null} [abstainVoteTally] ContestedResourceContenders abstainVoteTally + * @property {number|null} [lockVoteTally] ContestedResourceContenders lockVoteTally + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null} [finishedVoteInfo] ContestedResourceContenders finishedVoteInfo + */ + + /** + * Constructs a new ContestedResourceContenders. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a ContestedResourceContenders. + * @implements IContestedResourceContenders + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set + */ + function ContestedResourceContenders(properties) { + this.contenders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceContenders contenders. + * @member {Array.} contenders + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.contenders = $util.emptyArray; + + /** + * ContestedResourceContenders abstainVoteTally. + * @member {number} abstainVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.abstainVoteTally = 0; + + /** + * ContestedResourceContenders lockVoteTally. + * @member {number} lockVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.lockVoteTally = 0; + + /** + * ContestedResourceContenders finishedVoteInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null|undefined} finishedVoteInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.finishedVoteInfo = null; + + /** + * Creates a new ContestedResourceContenders instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders instance + */ + ContestedResourceContenders.create = function create(properties) { + return new ContestedResourceContenders(properties); + }; + + /** + * Encodes the specified ContestedResourceContenders message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceContenders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contenders != null && message.contenders.length) + for (var i = 0; i < message.contenders.length; ++i) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.encode(message.contenders[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.abstainVoteTally != null && Object.hasOwnProperty.call(message, "abstainVoteTally")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.abstainVoteTally); + if (message.lockVoteTally != null && Object.hasOwnProperty.call(message, "lockVoteTally")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.lockVoteTally); + if (message.finishedVoteInfo != null && Object.hasOwnProperty.call(message, "finishedVoteInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.encode(message.finishedVoteInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContestedResourceContenders message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceContenders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceContenders message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceContenders.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contenders && message.contenders.length)) + message.contenders = []; + message.contenders.push($root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.decode(reader, reader.uint32())); + break; + case 2: + message.abstainVoteTally = reader.uint32(); + break; + case 3: + message.lockVoteTally = reader.uint32(); + break; + case 4: + message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceContenders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceContenders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceContenders message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceContenders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contenders != null && message.hasOwnProperty("contenders")) { + if (!Array.isArray(message.contenders)) + return "contenders: array expected"; + for (var i = 0; i < message.contenders.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify(message.contenders[i]); + if (error) + return "contenders." + error; + } + } + if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) + if (!$util.isInteger(message.abstainVoteTally)) + return "abstainVoteTally: integer expected"; + if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) + if (!$util.isInteger(message.lockVoteTally)) + return "lockVoteTally: integer expected"; + if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify(message.finishedVoteInfo); + if (error) + return "finishedVoteInfo." + error; + } + return null; + }; + + /** + * Creates a ContestedResourceContenders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + */ + ContestedResourceContenders.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); + if (object.contenders) { + if (!Array.isArray(object.contenders)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: array expected"); + message.contenders = []; + for (var i = 0; i < object.contenders.length; ++i) { + if (typeof object.contenders[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: object expected"); + message.contenders[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.fromObject(object.contenders[i]); + } + } + if (object.abstainVoteTally != null) + message.abstainVoteTally = object.abstainVoteTally >>> 0; + if (object.lockVoteTally != null) + message.lockVoteTally = object.lockVoteTally >>> 0; + if (object.finishedVoteInfo != null) { + if (typeof object.finishedVoteInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.finishedVoteInfo: object expected"); + message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.fromObject(object.finishedVoteInfo); + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceContenders message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} message ContestedResourceContenders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceContenders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contenders = []; + if (options.defaults) { + object.abstainVoteTally = 0; + object.lockVoteTally = 0; + object.finishedVoteInfo = null; + } + if (message.contenders && message.contenders.length) { + object.contenders = []; + for (var j = 0; j < message.contenders.length; ++j) + object.contenders[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.toObject(message.contenders[j], options); + } + if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) + object.abstainVoteTally = message.abstainVoteTally; + if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) + object.lockVoteTally = message.lockVoteTally; + if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) + object.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.toObject(message.finishedVoteInfo, options); + return object; + }; + + /** + * Converts this ContestedResourceContenders to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceContenders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceContenders; + })(); + + GetContestedResourceVoteStateResponseV0.Contender = (function() { + + /** + * Properties of a Contender. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IContender + * @property {Uint8Array|null} [identifier] Contender identifier + * @property {number|null} [voteCount] Contender voteCount + * @property {Uint8Array|null} [document] Contender document + */ + + /** + * Constructs a new Contender. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a Contender. + * @implements IContender + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set + */ + function Contender(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Contender identifier. + * @member {Uint8Array} identifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.identifier = $util.newBuffer([]); + + /** + * Contender voteCount. + * @member {number} voteCount + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.voteCount = 0; + + /** + * Contender document. + * @member {Uint8Array} document + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.document = $util.newBuffer([]); + + /** + * Creates a new Contender instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender instance + */ + Contender.create = function create(properties) { + return new Contender(properties); + }; + + /** + * Encodes the specified Contender message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contender.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); + if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.document); + return writer; + }; + + /** + * Encodes the specified Contender message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contender.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Contender message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contender.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.bytes(); + break; + case 2: + message.voteCount = reader.uint32(); + break; + case 3: + message.document = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Contender message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contender.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Contender message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Contender.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifier != null && message.hasOwnProperty("identifier")) + if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) + return "identifier: buffer expected"; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + if (!$util.isInteger(message.voteCount)) + return "voteCount: integer expected"; + if (message.document != null && message.hasOwnProperty("document")) + if (!(message.document && typeof message.document.length === "number" || $util.isString(message.document))) + return "document: buffer expected"; + return null; + }; + + /** + * Creates a Contender message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + */ + Contender.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); + if (object.identifier != null) + if (typeof object.identifier === "string") + $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); + else if (object.identifier.length >= 0) + message.identifier = object.identifier; + if (object.voteCount != null) + message.voteCount = object.voteCount >>> 0; + if (object.document != null) + if (typeof object.document === "string") + $util.base64.decode(object.document, message.document = $util.newBuffer($util.base64.length(object.document)), 0); + else if (object.document.length >= 0) + message.document = object.document; + return message; + }; + + /** + * Creates a plain object from a Contender message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} message Contender + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Contender.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identifier = ""; + else { + object.identifier = []; + if (options.bytes !== Array) + object.identifier = $util.newBuffer(object.identifier); + } + object.voteCount = 0; + if (options.bytes === String) + object.document = ""; + else { + object.document = []; + if (options.bytes !== Array) + object.document = $util.newBuffer(object.document); + } + } + if (message.identifier != null && message.hasOwnProperty("identifier")) + object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + object.voteCount = message.voteCount; + if (message.document != null && message.hasOwnProperty("document")) + object.document = options.bytes === String ? $util.base64.encode(message.document, 0, message.document.length) : options.bytes === Array ? Array.prototype.slice.call(message.document) : message.document; + return object; + }; + + /** + * Converts this Contender to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + * @returns {Object.} JSON object + */ + Contender.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Contender; + })(); + + return GetContestedResourceVoteStateResponseV0; + })(); + + return GetContestedResourceVoteStateResponse; + })(); + + v0.GetContestedResourceVotersForIdentityRequest = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVotersForIdentityRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null} [v0] GetContestedResourceVotersForIdentityRequest v0 + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVotersForIdentityRequest. + * @implements IGetContestedResourceVotersForIdentityRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVotersForIdentityRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + */ + GetContestedResourceVotersForIdentityRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest instance + */ + GetContestedResourceVotersForIdentityRequest.create = function create(properties) { + return new GetContestedResourceVotersForIdentityRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + */ + GetContestedResourceVotersForIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @interface IGetContestedResourceVotersForIdentityRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourceVotersForIdentityRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourceVotersForIdentityRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourceVotersForIdentityRequestV0 indexName + * @property {Array.|null} [indexValues] GetContestedResourceVotersForIdentityRequestV0 indexValues + * @property {Uint8Array|null} [contestantId] GetContestedResourceVotersForIdentityRequestV0 contestantId + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo + * @property {number|null} [count] GetContestedResourceVotersForIdentityRequestV0 count + * @property {boolean|null} [orderAscending] GetContestedResourceVotersForIdentityRequestV0 orderAscending + * @property {boolean|null} [prove] GetContestedResourceVotersForIdentityRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @classdesc Represents a GetContestedResourceVotersForIdentityRequestV0. + * @implements IGetContestedResourceVotersForIdentityRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityRequestV0(properties) { + this.indexValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVotersForIdentityRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourceVotersForIdentityRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourceVotersForIdentityRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourceVotersForIdentityRequestV0 indexValues. + * @member {Array.} indexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.indexValues = $util.emptyArray; + + /** + * GetContestedResourceVotersForIdentityRequestV0 contestantId. + * @member {Uint8Array} contestantId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.contestantId = $util.newBuffer([]); + + /** + * GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.startAtIdentifierInfo = null; + + /** + * GetContestedResourceVotersForIdentityRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.count = 0; + + /** + * GetContestedResourceVotersForIdentityRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourceVotersForIdentityRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceVotersForIdentityRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 instance + */ + GetContestedResourceVotersForIdentityRequestV0.create = function create(properties) { + return new GetContestedResourceVotersForIdentityRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.indexValues != null && message.indexValues.length) + for (var i = 0; i < message.indexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); + if (message.contestantId != null && Object.hasOwnProperty.call(message, "contestantId")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.contestantId); + if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.indexValues && message.indexValues.length)) + message.indexValues = []; + message.indexValues.push(reader.bytes()); + break; + case 5: + message.contestantId = reader.bytes(); + break; + case 6: + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); + break; + case 7: + message.count = reader.uint32(); + break; + case 8: + message.orderAscending = reader.bool(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.indexValues != null && message.hasOwnProperty("indexValues")) { + if (!Array.isArray(message.indexValues)) + return "indexValues: array expected"; + for (var i = 0; i < message.indexValues.length; ++i) + if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) + return "indexValues: buffer[] expected"; + } + if (message.contestantId != null && message.hasOwnProperty("contestantId")) + if (!(message.contestantId && typeof message.contestantId.length === "number" || $util.isString(message.contestantId))) + return "contestantId: buffer expected"; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); + if (error) + return "startAtIdentifierInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + */ + GetContestedResourceVotersForIdentityRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.indexValues) { + if (!Array.isArray(object.indexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.indexValues: array expected"); + message.indexValues = []; + for (var i = 0; i < object.indexValues.length; ++i) + if (typeof object.indexValues[i] === "string") + $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); + else if (object.indexValues[i].length >= 0) + message.indexValues[i] = object.indexValues[i]; + } + if (object.contestantId != null) + if (typeof object.contestantId === "string") + $util.base64.decode(object.contestantId, message.contestantId = $util.newBuffer($util.base64.length(object.contestantId)), 0); + else if (object.contestantId.length >= 0) + message.contestantId = object.contestantId; + if (object.startAtIdentifierInfo != null) { + if (typeof object.startAtIdentifierInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.startAtIdentifierInfo: object expected"); + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + if (options.bytes === String) + object.contestantId = ""; + else { + object.contestantId = []; + if (options.bytes !== Array) + object.contestantId = $util.newBuffer(object.contestantId); + } + object.startAtIdentifierInfo = null; + object.count = 0; + object.orderAscending = false; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.indexValues && message.indexValues.length) { + object.indexValues = []; + for (var j = 0; j < message.indexValues.length; ++j) + object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; + } + if (message.contestantId != null && message.hasOwnProperty("contestantId")) + object.contestantId = options.bytes === String ? $util.base64.encode(message.contestantId, 0, message.contestantId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contestantId) : message.contestantId; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) + object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo = (function() { + + /** + * Properties of a StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @interface IStartAtIdentifierInfo + * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier + * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded + */ + + /** + * Constructs a new StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @classdesc Represents a StartAtIdentifierInfo. + * @implements IStartAtIdentifierInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + */ + function StartAtIdentifierInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtIdentifierInfo startIdentifier. + * @member {Uint8Array} startIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); + + /** + * StartAtIdentifierInfo startIdentifierIncluded. + * @member {boolean} startIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; + + /** + * Creates a new StartAtIdentifierInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance + */ + StartAtIdentifierInfo.create = function create(properties) { + return new StartAtIdentifierInfo(properties); + }; + + /** + * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); + if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startIdentifier = reader.bytes(); + break; + case 2: + message.startIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtIdentifierInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtIdentifierInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) + return "startIdentifier: buffer expected"; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + if (typeof message.startIdentifierIncluded !== "boolean") + return "startIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + */ + StartAtIdentifierInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); + if (object.startIdentifier != null) + if (typeof object.startIdentifier === "string") + $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); + else if (object.startIdentifier.length >= 0) + message.startIdentifier = object.startIdentifier; + if (object.startIdentifierIncluded != null) + message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtIdentifierInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startIdentifier = ""; + else { + object.startIdentifier = []; + if (options.bytes !== Array) + object.startIdentifier = $util.newBuffer(object.startIdentifier); + } + object.startIdentifierIncluded = false; + } + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + object.startIdentifierIncluded = message.startIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtIdentifierInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtIdentifierInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtIdentifierInfo; + })(); + + return GetContestedResourceVotersForIdentityRequestV0; + })(); + + return GetContestedResourceVotersForIdentityRequest; + })(); + + v0.GetContestedResourceVotersForIdentityResponse = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVotersForIdentityResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null} [v0] GetContestedResourceVotersForIdentityResponse v0 + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVotersForIdentityResponse. + * @implements IGetContestedResourceVotersForIdentityResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVotersForIdentityResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + */ + GetContestedResourceVotersForIdentityResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse instance + */ + GetContestedResourceVotersForIdentityResponse.create = function create(properties) { + return new GetContestedResourceVotersForIdentityResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + */ + GetContestedResourceVotersForIdentityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @interface IGetContestedResourceVotersForIdentityResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null} [contestedResourceVoters] GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVotersForIdentityResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVotersForIdentityResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @classdesc Represents a GetContestedResourceVotersForIdentityResponseV0. + * @implements IGetContestedResourceVotersForIdentityResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null|undefined} contestedResourceVoters + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.contestedResourceVoters = null; + + /** + * GetContestedResourceVotersForIdentityResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.proof = null; + + /** + * GetContestedResourceVotersForIdentityResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityResponseV0 result. + * @member {"contestedResourceVoters"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceVoters", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 instance + */ + GetContestedResourceVotersForIdentityResponseV0.create = function create(properties) { + return new GetContestedResourceVotersForIdentityResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceVoters != null && Object.hasOwnProperty.call(message, "contestedResourceVoters")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.encode(message.contestedResourceVoters, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify(message.contestedResourceVoters); + if (error) + return "contestedResourceVoters." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + */ + GetContestedResourceVotersForIdentityResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); + if (object.contestedResourceVoters != null) { + if (typeof object.contestedResourceVoters !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.contestedResourceVoters: object expected"); + message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.fromObject(object.contestedResourceVoters); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { + object.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.toObject(message.contestedResourceVoters, options); + if (options.oneofs) + object.result = "contestedResourceVoters"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters = (function() { + + /** + * Properties of a ContestedResourceVoters. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @interface IContestedResourceVoters + * @property {Array.|null} [voters] ContestedResourceVoters voters + * @property {boolean|null} [finishedResults] ContestedResourceVoters finishedResults + */ + + /** + * Constructs a new ContestedResourceVoters. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @classdesc Represents a ContestedResourceVoters. + * @implements IContestedResourceVoters + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set + */ + function ContestedResourceVoters(properties) { + this.voters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceVoters voters. + * @member {Array.} voters + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + */ + ContestedResourceVoters.prototype.voters = $util.emptyArray; + + /** + * ContestedResourceVoters finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + */ + ContestedResourceVoters.prototype.finishedResults = false; + + /** + * Creates a new ContestedResourceVoters instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters instance + */ + ContestedResourceVoters.create = function create(properties) { + return new ContestedResourceVoters(properties); + }; + + /** + * Encodes the specified ContestedResourceVoters message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceVoters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voters != null && message.voters.length) + for (var i = 0; i < message.voters.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.voters[i]); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified ContestedResourceVoters message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceVoters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceVoters message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceVoters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.voters && message.voters.length)) + message.voters = []; + message.voters.push(reader.bytes()); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceVoters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceVoters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceVoters message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceVoters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voters != null && message.hasOwnProperty("voters")) { + if (!Array.isArray(message.voters)) + return "voters: array expected"; + for (var i = 0; i < message.voters.length; ++i) + if (!(message.voters[i] && typeof message.voters[i].length === "number" || $util.isString(message.voters[i]))) + return "voters: buffer[] expected"; + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a ContestedResourceVoters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + */ + ContestedResourceVoters.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); + if (object.voters) { + if (!Array.isArray(object.voters)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.voters: array expected"); + message.voters = []; + for (var i = 0; i < object.voters.length; ++i) + if (typeof object.voters[i] === "string") + $util.base64.decode(object.voters[i], message.voters[i] = $util.newBuffer($util.base64.length(object.voters[i])), 0); + else if (object.voters[i].length >= 0) + message.voters[i] = object.voters[i]; + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a ContestedResourceVoters message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} message ContestedResourceVoters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceVoters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.voters = []; + if (options.defaults) + object.finishedResults = false; + if (message.voters && message.voters.length) { + object.voters = []; + for (var j = 0; j < message.voters.length; ++j) + object.voters[j] = options.bytes === String ? $util.base64.encode(message.voters[j], 0, message.voters[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.voters[j]) : message.voters[j]; + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this ContestedResourceVoters to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceVoters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceVoters; + })(); + + return GetContestedResourceVotersForIdentityResponseV0; + })(); + + return GetContestedResourceVotersForIdentityResponse; + })(); + + v0.GetContestedResourceIdentityVotesRequest = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceIdentityVotesRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null} [v0] GetContestedResourceIdentityVotesRequest v0 + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceIdentityVotesRequest. + * @implements IGetContestedResourceIdentityVotesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceIdentityVotesRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + */ + GetContestedResourceIdentityVotesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest instance + */ + GetContestedResourceIdentityVotesRequest.create = function create(properties) { + return new GetContestedResourceIdentityVotesRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + */ + GetContestedResourceIdentityVotesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @interface IGetContestedResourceIdentityVotesRequestV0 + * @property {Uint8Array|null} [identityId] GetContestedResourceIdentityVotesRequestV0 identityId + * @property {google.protobuf.IUInt32Value|null} [limit] GetContestedResourceIdentityVotesRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetContestedResourceIdentityVotesRequestV0 offset + * @property {boolean|null} [orderAscending] GetContestedResourceIdentityVotesRequestV0 orderAscending + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null} [startAtVotePollIdInfo] GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo + * @property {boolean|null} [prove] GetContestedResourceIdentityVotesRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @classdesc Represents a GetContestedResourceIdentityVotesRequestV0. + * @implements IGetContestedResourceIdentityVotesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceIdentityVotesRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetContestedResourceIdentityVotesRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.limit = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.offset = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null|undefined} startAtVotePollIdInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.startAtVotePollIdInfo = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceIdentityVotesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 instance + */ + GetContestedResourceIdentityVotesRequestV0.create = function create(properties) { + return new GetContestedResourceIdentityVotesRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.orderAscending); + if (message.startAtVotePollIdInfo != null && Object.hasOwnProperty.call(message, "startAtVotePollIdInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.encode(message.startAtVotePollIdInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 3: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.orderAscending = reader.bool(); + break; + case 5: + message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.decode(reader, reader.uint32()); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify(message.startAtVotePollIdInfo); + if (error) + return "startAtVotePollIdInfo." + error; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + */ + GetContestedResourceIdentityVotesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.startAtVotePollIdInfo != null) { + if (typeof object.startAtVotePollIdInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.startAtVotePollIdInfo: object expected"); + message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.fromObject(object.startAtVotePollIdInfo); + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.limit = null; + object.offset = null; + object.orderAscending = false; + object.startAtVotePollIdInfo = null; + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) + object.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.toObject(message.startAtVotePollIdInfo, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo = (function() { + + /** + * Properties of a StartAtVotePollIdInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @interface IStartAtVotePollIdInfo + * @property {Uint8Array|null} [startAtPollIdentifier] StartAtVotePollIdInfo startAtPollIdentifier + * @property {boolean|null} [startPollIdentifierIncluded] StartAtVotePollIdInfo startPollIdentifierIncluded + */ + + /** + * Constructs a new StartAtVotePollIdInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @classdesc Represents a StartAtVotePollIdInfo. + * @implements IStartAtVotePollIdInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set + */ + function StartAtVotePollIdInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtVotePollIdInfo startAtPollIdentifier. + * @member {Uint8Array} startAtPollIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + */ + StartAtVotePollIdInfo.prototype.startAtPollIdentifier = $util.newBuffer([]); + + /** + * StartAtVotePollIdInfo startPollIdentifierIncluded. + * @member {boolean} startPollIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + */ + StartAtVotePollIdInfo.prototype.startPollIdentifierIncluded = false; + + /** + * Creates a new StartAtVotePollIdInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo instance + */ + StartAtVotePollIdInfo.create = function create(properties) { + return new StartAtVotePollIdInfo(properties); + }; + + /** + * Encodes the specified StartAtVotePollIdInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtVotePollIdInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startAtPollIdentifier != null && Object.hasOwnProperty.call(message, "startAtPollIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startAtPollIdentifier); + if (message.startPollIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startPollIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startPollIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtVotePollIdInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtVotePollIdInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtVotePollIdInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startAtPollIdentifier = reader.bytes(); + break; + case 2: + message.startPollIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtVotePollIdInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtVotePollIdInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtVotePollIdInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) + if (!(message.startAtPollIdentifier && typeof message.startAtPollIdentifier.length === "number" || $util.isString(message.startAtPollIdentifier))) + return "startAtPollIdentifier: buffer expected"; + if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) + if (typeof message.startPollIdentifierIncluded !== "boolean") + return "startPollIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtVotePollIdInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + */ + StartAtVotePollIdInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); + if (object.startAtPollIdentifier != null) + if (typeof object.startAtPollIdentifier === "string") + $util.base64.decode(object.startAtPollIdentifier, message.startAtPollIdentifier = $util.newBuffer($util.base64.length(object.startAtPollIdentifier)), 0); + else if (object.startAtPollIdentifier.length >= 0) + message.startAtPollIdentifier = object.startAtPollIdentifier; + if (object.startPollIdentifierIncluded != null) + message.startPollIdentifierIncluded = Boolean(object.startPollIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtVotePollIdInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} message StartAtVotePollIdInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtVotePollIdInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startAtPollIdentifier = ""; + else { + object.startAtPollIdentifier = []; + if (options.bytes !== Array) + object.startAtPollIdentifier = $util.newBuffer(object.startAtPollIdentifier); + } + object.startPollIdentifierIncluded = false; + } + if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) + object.startAtPollIdentifier = options.bytes === String ? $util.base64.encode(message.startAtPollIdentifier, 0, message.startAtPollIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAtPollIdentifier) : message.startAtPollIdentifier; + if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) + object.startPollIdentifierIncluded = message.startPollIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtVotePollIdInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtVotePollIdInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtVotePollIdInfo; + })(); + + return GetContestedResourceIdentityVotesRequestV0; + })(); + + return GetContestedResourceIdentityVotesRequest; + })(); + + v0.GetContestedResourceIdentityVotesResponse = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceIdentityVotesResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null} [v0] GetContestedResourceIdentityVotesResponse v0 + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceIdentityVotesResponse. + * @implements IGetContestedResourceIdentityVotesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceIdentityVotesResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + */ + GetContestedResourceIdentityVotesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse instance + */ + GetContestedResourceIdentityVotesResponse.create = function create(properties) { + return new GetContestedResourceIdentityVotesResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + */ + GetContestedResourceIdentityVotesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @interface IGetContestedResourceIdentityVotesResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null} [votes] GetContestedResourceIdentityVotesResponseV0 votes + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceIdentityVotesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceIdentityVotesResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @classdesc Represents a GetContestedResourceIdentityVotesResponseV0. + * @implements IGetContestedResourceIdentityVotesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceIdentityVotesResponseV0 votes. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null|undefined} votes + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.votes = null; + + /** + * GetContestedResourceIdentityVotesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.proof = null; + + /** + * GetContestedResourceIdentityVotesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesResponseV0 result. + * @member {"votes"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["votes", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 instance + */ + GetContestedResourceIdentityVotesResponseV0.create = function create(properties) { + return new GetContestedResourceIdentityVotesResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votes != null && Object.hasOwnProperty.call(message, "votes")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.encode(message.votes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.votes != null && message.hasOwnProperty("votes")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify(message.votes); + if (error) + return "votes." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + */ + GetContestedResourceIdentityVotesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); + if (object.votes != null) { + if (typeof object.votes !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.votes: object expected"); + message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.fromObject(object.votes); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.votes != null && message.hasOwnProperty("votes")) { + object.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.toObject(message.votes, options); + if (options.oneofs) + object.result = "votes"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes = (function() { + + /** + * Properties of a ContestedResourceIdentityVotes. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IContestedResourceIdentityVotes + * @property {Array.|null} [contestedResourceIdentityVotes] ContestedResourceIdentityVotes contestedResourceIdentityVotes + * @property {boolean|null} [finishedResults] ContestedResourceIdentityVotes finishedResults + */ + + /** + * Constructs a new ContestedResourceIdentityVotes. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ContestedResourceIdentityVotes. + * @implements IContestedResourceIdentityVotes + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set + */ + function ContestedResourceIdentityVotes(properties) { + this.contestedResourceIdentityVotes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceIdentityVotes contestedResourceIdentityVotes. + * @member {Array.} contestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + */ + ContestedResourceIdentityVotes.prototype.contestedResourceIdentityVotes = $util.emptyArray; + + /** + * ContestedResourceIdentityVotes finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + */ + ContestedResourceIdentityVotes.prototype.finishedResults = false; + + /** + * Creates a new ContestedResourceIdentityVotes instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes instance + */ + ContestedResourceIdentityVotes.create = function create(properties) { + return new ContestedResourceIdentityVotes(properties); + }; + + /** + * Encodes the specified ContestedResourceIdentityVotes message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVotes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceIdentityVotes != null && message.contestedResourceIdentityVotes.length) + for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.encode(message.contestedResourceIdentityVotes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified ContestedResourceIdentityVotes message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVotes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVotes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length)) + message.contestedResourceIdentityVotes = []; + message.contestedResourceIdentityVotes.push($root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.decode(reader, reader.uint32())); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVotes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceIdentityVotes message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceIdentityVotes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contestedResourceIdentityVotes != null && message.hasOwnProperty("contestedResourceIdentityVotes")) { + if (!Array.isArray(message.contestedResourceIdentityVotes)) + return "contestedResourceIdentityVotes: array expected"; + for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify(message.contestedResourceIdentityVotes[i]); + if (error) + return "contestedResourceIdentityVotes." + error; + } + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a ContestedResourceIdentityVotes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + */ + ContestedResourceIdentityVotes.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); + if (object.contestedResourceIdentityVotes) { + if (!Array.isArray(object.contestedResourceIdentityVotes)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: array expected"); + message.contestedResourceIdentityVotes = []; + for (var i = 0; i < object.contestedResourceIdentityVotes.length; ++i) { + if (typeof object.contestedResourceIdentityVotes[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: object expected"); + message.contestedResourceIdentityVotes[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.fromObject(object.contestedResourceIdentityVotes[i]); + } + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a ContestedResourceIdentityVotes message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} message ContestedResourceIdentityVotes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceIdentityVotes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contestedResourceIdentityVotes = []; + if (options.defaults) + object.finishedResults = false; + if (message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length) { + object.contestedResourceIdentityVotes = []; + for (var j = 0; j < message.contestedResourceIdentityVotes.length; ++j) + object.contestedResourceIdentityVotes[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.toObject(message.contestedResourceIdentityVotes[j], options); + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this ContestedResourceIdentityVotes to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceIdentityVotes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceIdentityVotes; + })(); + + GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice = (function() { + + /** + * Properties of a ResourceVoteChoice. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IResourceVoteChoice + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType|null} [voteChoiceType] ResourceVoteChoice voteChoiceType + * @property {Uint8Array|null} [identityId] ResourceVoteChoice identityId + */ + + /** + * Constructs a new ResourceVoteChoice. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ResourceVoteChoice. + * @implements IResourceVoteChoice + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set + */ + function ResourceVoteChoice(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceVoteChoice voteChoiceType. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType} voteChoiceType + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + */ + ResourceVoteChoice.prototype.voteChoiceType = 0; + + /** + * ResourceVoteChoice identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + */ + ResourceVoteChoice.prototype.identityId = $util.newBuffer([]); + + /** + * Creates a new ResourceVoteChoice instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice instance + */ + ResourceVoteChoice.create = function create(properties) { + return new ResourceVoteChoice(properties); + }; + + /** + * Encodes the specified ResourceVoteChoice message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceVoteChoice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voteChoiceType != null && Object.hasOwnProperty.call(message, "voteChoiceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.voteChoiceType); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityId); + return writer; + }; + + /** + * Encodes the specified ResourceVoteChoice message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceVoteChoice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceVoteChoice message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceVoteChoice.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteChoiceType = reader.int32(); + break; + case 2: + message.identityId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceVoteChoice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceVoteChoice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceVoteChoice message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceVoteChoice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) + switch (message.voteChoiceType) { + default: + return "voteChoiceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + return null; + }; + + /** + * Creates a ResourceVoteChoice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + */ + ResourceVoteChoice.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); + switch (object.voteChoiceType) { + case "TOWARDS_IDENTITY": + case 0: + message.voteChoiceType = 0; + break; + case "ABSTAIN": + case 1: + message.voteChoiceType = 1; + break; + case "LOCK": + case 2: + message.voteChoiceType = 2; + break; + } + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + return message; + }; + + /** + * Creates a plain object from a ResourceVoteChoice message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} message ResourceVoteChoice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceVoteChoice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.voteChoiceType = options.enums === String ? "TOWARDS_IDENTITY" : 0; + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + } + if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) + object.voteChoiceType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType[message.voteChoiceType] : message.voteChoiceType; + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + return object; + }; + + /** + * Converts this ResourceVoteChoice to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + * @returns {Object.} JSON object + */ + ResourceVoteChoice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * VoteChoiceType enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType + * @enum {number} + * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value + * @property {number} ABSTAIN=1 ABSTAIN value + * @property {number} LOCK=2 LOCK value + */ + ResourceVoteChoice.VoteChoiceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; + values[valuesById[1] = "ABSTAIN"] = 1; + values[valuesById[2] = "LOCK"] = 2; + return values; + })(); + + return ResourceVoteChoice; + })(); + + GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote = (function() { + + /** + * Properties of a ContestedResourceIdentityVote. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IContestedResourceIdentityVote + * @property {Uint8Array|null} [contractId] ContestedResourceIdentityVote contractId + * @property {string|null} [documentTypeName] ContestedResourceIdentityVote documentTypeName + * @property {Array.|null} [serializedIndexStorageValues] ContestedResourceIdentityVote serializedIndexStorageValues + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null} [voteChoice] ContestedResourceIdentityVote voteChoice + */ + + /** + * Constructs a new ContestedResourceIdentityVote. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ContestedResourceIdentityVote. + * @implements IContestedResourceIdentityVote + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set + */ + function ContestedResourceIdentityVote(properties) { + this.serializedIndexStorageValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceIdentityVote contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.contractId = $util.newBuffer([]); + + /** + * ContestedResourceIdentityVote documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.documentTypeName = ""; + + /** + * ContestedResourceIdentityVote serializedIndexStorageValues. + * @member {Array.} serializedIndexStorageValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.serializedIndexStorageValues = $util.emptyArray; + + /** + * ContestedResourceIdentityVote voteChoice. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null|undefined} voteChoice + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.voteChoice = null; + + /** + * Creates a new ContestedResourceIdentityVote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote instance + */ + ContestedResourceIdentityVote.create = function create(properties) { + return new ContestedResourceIdentityVote(properties); + }; + + /** + * Encodes the specified ContestedResourceIdentityVote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.serializedIndexStorageValues != null && message.serializedIndexStorageValues.length) + for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.serializedIndexStorageValues[i]); + if (message.voteChoice != null && Object.hasOwnProperty.call(message, "voteChoice")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.encode(message.voteChoice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContestedResourceIdentityVote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + if (!(message.serializedIndexStorageValues && message.serializedIndexStorageValues.length)) + message.serializedIndexStorageValues = []; + message.serializedIndexStorageValues.push(reader.bytes()); + break; + case 4: + message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceIdentityVote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceIdentityVote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.serializedIndexStorageValues != null && message.hasOwnProperty("serializedIndexStorageValues")) { + if (!Array.isArray(message.serializedIndexStorageValues)) + return "serializedIndexStorageValues: array expected"; + for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) + if (!(message.serializedIndexStorageValues[i] && typeof message.serializedIndexStorageValues[i].length === "number" || $util.isString(message.serializedIndexStorageValues[i]))) + return "serializedIndexStorageValues: buffer[] expected"; + } + if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify(message.voteChoice); + if (error) + return "voteChoice." + error; + } + return null; + }; + + /** + * Creates a ContestedResourceIdentityVote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + */ + ContestedResourceIdentityVote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.serializedIndexStorageValues) { + if (!Array.isArray(object.serializedIndexStorageValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.serializedIndexStorageValues: array expected"); + message.serializedIndexStorageValues = []; + for (var i = 0; i < object.serializedIndexStorageValues.length; ++i) + if (typeof object.serializedIndexStorageValues[i] === "string") + $util.base64.decode(object.serializedIndexStorageValues[i], message.serializedIndexStorageValues[i] = $util.newBuffer($util.base64.length(object.serializedIndexStorageValues[i])), 0); + else if (object.serializedIndexStorageValues[i].length >= 0) + message.serializedIndexStorageValues[i] = object.serializedIndexStorageValues[i]; + } + if (object.voteChoice != null) { + if (typeof object.voteChoice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.voteChoice: object expected"); + message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.fromObject(object.voteChoice); + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceIdentityVote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} message ContestedResourceIdentityVote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceIdentityVote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serializedIndexStorageValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.voteChoice = null; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.serializedIndexStorageValues && message.serializedIndexStorageValues.length) { + object.serializedIndexStorageValues = []; + for (var j = 0; j < message.serializedIndexStorageValues.length; ++j) + object.serializedIndexStorageValues[j] = options.bytes === String ? $util.base64.encode(message.serializedIndexStorageValues[j], 0, message.serializedIndexStorageValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedIndexStorageValues[j]) : message.serializedIndexStorageValues[j]; + } + if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) + object.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.toObject(message.voteChoice, options); + return object; + }; + + /** + * Converts this ContestedResourceIdentityVote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceIdentityVote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceIdentityVote; + })(); + + return GetContestedResourceIdentityVotesResponseV0; + })(); + + return GetContestedResourceIdentityVotesResponse; + })(); + + v0.GetPrefundedSpecializedBalanceRequest = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPrefundedSpecializedBalanceRequest + * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null} [v0] GetPrefundedSpecializedBalanceRequest v0 + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPrefundedSpecializedBalanceRequest. + * @implements IGetPrefundedSpecializedBalanceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrefundedSpecializedBalanceRequest v0. + * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + */ + GetPrefundedSpecializedBalanceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest instance + */ + GetPrefundedSpecializedBalanceRequest.create = function create(properties) { + return new GetPrefundedSpecializedBalanceRequest(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + */ + GetPrefundedSpecializedBalanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @interface IGetPrefundedSpecializedBalanceRequestV0 + * @property {Uint8Array|null} [id] GetPrefundedSpecializedBalanceRequestV0 id + * @property {boolean|null} [prove] GetPrefundedSpecializedBalanceRequestV0 prove + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @classdesc Represents a GetPrefundedSpecializedBalanceRequestV0. + * @implements IGetPrefundedSpecializedBalanceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrefundedSpecializedBalanceRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetPrefundedSpecializedBalanceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.prove = false; + + /** + * Creates a new GetPrefundedSpecializedBalanceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 instance + */ + GetPrefundedSpecializedBalanceRequestV0.create = function create(properties) { + return new GetPrefundedSpecializedBalanceRequestV0(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + */ + GetPrefundedSpecializedBalanceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPrefundedSpecializedBalanceRequestV0; + })(); + + return GetPrefundedSpecializedBalanceRequest; + })(); + + v0.GetPrefundedSpecializedBalanceResponse = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPrefundedSpecializedBalanceResponse + * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null} [v0] GetPrefundedSpecializedBalanceResponse v0 + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPrefundedSpecializedBalanceResponse. + * @implements IGetPrefundedSpecializedBalanceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrefundedSpecializedBalanceResponse v0. + * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + */ + GetPrefundedSpecializedBalanceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse instance + */ + GetPrefundedSpecializedBalanceResponse.create = function create(properties) { + return new GetPrefundedSpecializedBalanceResponse(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + */ + GetPrefundedSpecializedBalanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @interface IGetPrefundedSpecializedBalanceResponseV0 + * @property {number|Long|null} [balance] GetPrefundedSpecializedBalanceResponseV0 balance + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPrefundedSpecializedBalanceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPrefundedSpecializedBalanceResponseV0 metadata + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @classdesc Represents a GetPrefundedSpecializedBalanceResponseV0. + * @implements IGetPrefundedSpecializedBalanceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrefundedSpecializedBalanceResponseV0 balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetPrefundedSpecializedBalanceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.proof = null; + + /** + * GetPrefundedSpecializedBalanceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceResponseV0 result. + * @member {"balance"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 instance + */ + GetPrefundedSpecializedBalanceResponseV0.create = function create(properties) { + return new GetPrefundedSpecializedBalanceResponseV0(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balance != null && message.hasOwnProperty("balance")) { + properties.result = 1; + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + */ + GetPrefundedSpecializedBalanceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balance != null && message.hasOwnProperty("balance")) { + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (options.oneofs) + object.result = "balance"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPrefundedSpecializedBalanceResponseV0; + })(); + + return GetPrefundedSpecializedBalanceResponse; + })(); + + v0.GetTotalCreditsInPlatformRequest = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTotalCreditsInPlatformRequest + * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null} [v0] GetTotalCreditsInPlatformRequest v0 + */ + + /** + * Constructs a new GetTotalCreditsInPlatformRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTotalCreditsInPlatformRequest. + * @implements IGetTotalCreditsInPlatformRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTotalCreditsInPlatformRequest v0. + * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + */ + GetTotalCreditsInPlatformRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest instance + */ + GetTotalCreditsInPlatformRequest.create = function create(properties) { + return new GetTotalCreditsInPlatformRequest(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + */ + GetTotalCreditsInPlatformRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @interface IGetTotalCreditsInPlatformRequestV0 + * @property {boolean|null} [prove] GetTotalCreditsInPlatformRequestV0 prove + */ + + /** + * Constructs a new GetTotalCreditsInPlatformRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @classdesc Represents a GetTotalCreditsInPlatformRequestV0. + * @implements IGetTotalCreditsInPlatformRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTotalCreditsInPlatformRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @instance + */ + GetTotalCreditsInPlatformRequestV0.prototype.prove = false; + + /** + * Creates a new GetTotalCreditsInPlatformRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 instance + */ + GetTotalCreditsInPlatformRequestV0.create = function create(properties) { + return new GetTotalCreditsInPlatformRequestV0(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + */ + GetTotalCreditsInPlatformRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prove = false; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTotalCreditsInPlatformRequestV0; + })(); + + return GetTotalCreditsInPlatformRequest; + })(); + + v0.GetTotalCreditsInPlatformResponse = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTotalCreditsInPlatformResponse + * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null} [v0] GetTotalCreditsInPlatformResponse v0 + */ + + /** + * Constructs a new GetTotalCreditsInPlatformResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTotalCreditsInPlatformResponse. + * @implements IGetTotalCreditsInPlatformResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTotalCreditsInPlatformResponse v0. + * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + */ + GetTotalCreditsInPlatformResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse instance + */ + GetTotalCreditsInPlatformResponse.create = function create(properties) { + return new GetTotalCreditsInPlatformResponse(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + */ + GetTotalCreditsInPlatformResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @interface IGetTotalCreditsInPlatformResponseV0 + * @property {number|Long|null} [credits] GetTotalCreditsInPlatformResponseV0 credits + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTotalCreditsInPlatformResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTotalCreditsInPlatformResponseV0 metadata + */ + + /** + * Constructs a new GetTotalCreditsInPlatformResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @classdesc Represents a GetTotalCreditsInPlatformResponseV0. + * @implements IGetTotalCreditsInPlatformResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTotalCreditsInPlatformResponseV0 credits. + * @member {number|Long} credits + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.credits = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetTotalCreditsInPlatformResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.proof = null; + + /** + * GetTotalCreditsInPlatformResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformResponseV0 result. + * @member {"credits"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["credits", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 instance + */ + GetTotalCreditsInPlatformResponseV0.create = function create(properties) { + return new GetTotalCreditsInPlatformResponseV0(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.credits != null && Object.hasOwnProperty.call(message, "credits")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.credits); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.credits = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.credits != null && message.hasOwnProperty("credits")) { + properties.result = 1; + if (!$util.isInteger(message.credits) && !(message.credits && $util.isInteger(message.credits.low) && $util.isInteger(message.credits.high))) + return "credits: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + */ + GetTotalCreditsInPlatformResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); + if (object.credits != null) + if ($util.Long) + (message.credits = $util.Long.fromValue(object.credits)).unsigned = true; + else if (typeof object.credits === "string") + message.credits = parseInt(object.credits, 10); + else if (typeof object.credits === "number") + message.credits = object.credits; + else if (typeof object.credits === "object") + message.credits = new $util.LongBits(object.credits.low >>> 0, object.credits.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.credits != null && message.hasOwnProperty("credits")) { + if (typeof message.credits === "number") + object.credits = options.longs === String ? String(message.credits) : message.credits; + else + object.credits = options.longs === String ? $util.Long.prototype.toString.call(message.credits) : options.longs === Number ? new $util.LongBits(message.credits.low >>> 0, message.credits.high >>> 0).toNumber(true) : message.credits; + if (options.oneofs) + object.result = "credits"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTotalCreditsInPlatformResponseV0; + })(); + + return GetTotalCreditsInPlatformResponse; + })(); + + v0.GetPathElementsRequest = (function() { + + /** + * Properties of a GetPathElementsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPathElementsRequest + * @property {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null} [v0] GetPathElementsRequest v0 + */ + + /** + * Constructs a new GetPathElementsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPathElementsRequest. + * @implements IGetPathElementsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set + */ + function GetPathElementsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPathElementsRequest v0. + * @member {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + */ + GetPathElementsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + */ + Object.defineProperty(GetPathElementsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest instance + */ + GetPathElementsRequest.create = function create(properties) { + return new GetPathElementsRequest(properties); + }; + + /** + * Encodes the specified GetPathElementsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPathElementsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + */ + GetPathElementsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest} message GetPathElementsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPathElementsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsRequest.GetPathElementsRequestV0 = (function() { + + /** + * Properties of a GetPathElementsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @interface IGetPathElementsRequestV0 + * @property {Array.|null} [path] GetPathElementsRequestV0 path + * @property {Array.|null} [keys] GetPathElementsRequestV0 keys + * @property {boolean|null} [prove] GetPathElementsRequestV0 prove + */ + + /** + * Constructs a new GetPathElementsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @classdesc Represents a GetPathElementsRequestV0. + * @implements IGetPathElementsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set + */ + function GetPathElementsRequestV0(properties) { + this.path = []; + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPathElementsRequestV0 path. + * @member {Array.} path + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.path = $util.emptyArray; + + /** + * GetPathElementsRequestV0 keys. + * @member {Array.} keys + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.keys = $util.emptyArray; + + /** + * GetPathElementsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.prove = false; + + /** + * Creates a new GetPathElementsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 instance + */ + GetPathElementsRequestV0.create = function create(properties) { + return new GetPathElementsRequestV0(properties); + }; + + /** + * Encodes the specified GetPathElementsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) + for (var i = 0; i < message.path.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path[i]); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keys[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetPathElementsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + message.path.push(reader.bytes()); + break; + case 2: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!(message.path[i] && typeof message.path[i].length === "number" || $util.isString(message.path[i]))) + return "path: buffer[] expected"; + } + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) + if (!(message.keys[i] && typeof message.keys[i].length === "number" || $util.isString(message.keys[i]))) + return "keys: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetPathElementsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + */ + GetPathElementsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + if (typeof object.path[i] === "string") + $util.base64.decode(object.path[i], message.path[i] = $util.newBuffer($util.base64.length(object.path[i])), 0); + else if (object.path[i].length >= 0) + message.path[i] = object.path[i]; + } + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) + if (typeof object.keys[i] === "string") + $util.base64.decode(object.keys[i], message.keys[i] = $util.newBuffer($util.base64.length(object.keys[i])), 0); + else if (object.keys[i].length >= 0) + message.keys[i] = object.keys[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetPathElementsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} message GetPathElementsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.keys = []; + } + if (options.defaults) + object.prove = false; + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = options.bytes === String ? $util.base64.encode(message.path[j], 0, message.path[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.path[j]) : message.path[j]; + } + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = options.bytes === String ? $util.base64.encode(message.keys[j], 0, message.keys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keys[j]) : message.keys[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetPathElementsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPathElementsRequestV0; + })(); + + return GetPathElementsRequest; + })(); + + v0.GetPathElementsResponse = (function() { + + /** + * Properties of a GetPathElementsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPathElementsResponse + * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null} [v0] GetPathElementsResponse v0 + */ + + /** + * Constructs a new GetPathElementsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPathElementsResponse. + * @implements IGetPathElementsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set + */ + function GetPathElementsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPathElementsResponse v0. + * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + */ + GetPathElementsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + */ + Object.defineProperty(GetPathElementsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse instance + */ + GetPathElementsResponse.create = function create(properties) { + return new GetPathElementsResponse(properties); + }; + + /** + * Encodes the specified GetPathElementsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPathElementsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + */ + GetPathElementsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} message GetPathElementsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPathElementsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsResponse.GetPathElementsResponseV0 = (function() { + + /** + * Properties of a GetPathElementsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @interface IGetPathElementsResponseV0 + * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null} [elements] GetPathElementsResponseV0 elements + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPathElementsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPathElementsResponseV0 metadata + */ + + /** + * Constructs a new GetPathElementsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @classdesc Represents a GetPathElementsResponseV0. + * @implements IGetPathElementsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set + */ + function GetPathElementsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPathElementsResponseV0 elements. + * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null|undefined} elements + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.elements = null; + + /** + * GetPathElementsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.proof = null; + + /** + * GetPathElementsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsResponseV0 result. + * @member {"elements"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + Object.defineProperty(GetPathElementsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["elements", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 instance + */ + GetPathElementsResponseV0.create = function create(properties) { + return new GetPathElementsResponseV0(properties); + }; + + /** + * Encodes the specified GetPathElementsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elements != null && Object.hasOwnProperty.call(message, "elements")) + $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.encode(message.elements, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.elements != null && message.hasOwnProperty("elements")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify(message.elements); + if (error) + return "elements." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetPathElementsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + */ + GetPathElementsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); + if (object.elements != null) { + if (typeof object.elements !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.elements: object expected"); + message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.fromObject(object.elements); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} message GetPathElementsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.elements != null && message.hasOwnProperty("elements")) { + object.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.toObject(message.elements, options); + if (options.oneofs) + object.result = "elements"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetPathElementsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsResponseV0.Elements = (function() { + + /** + * Properties of an Elements. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @interface IElements + * @property {Array.|null} [elements] Elements elements + */ + + /** + * Constructs a new Elements. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @classdesc Represents an Elements. + * @implements IElements + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set + */ + function Elements(properties) { + this.elements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Elements elements. + * @member {Array.} elements + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @instance + */ + Elements.prototype.elements = $util.emptyArray; + + /** + * Creates a new Elements instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements instance + */ + Elements.create = function create(properties) { + return new Elements(properties); + }; + + /** + * Encodes the specified Elements message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Elements.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elements != null && message.elements.length) + for (var i = 0; i < message.elements.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.elements[i]); + return writer; + }; + + /** + * Encodes the specified Elements message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Elements.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Elements message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Elements.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.elements && message.elements.length)) + message.elements = []; + message.elements.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Elements message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Elements.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Elements message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Elements.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.elements != null && message.hasOwnProperty("elements")) { + if (!Array.isArray(message.elements)) + return "elements: array expected"; + for (var i = 0; i < message.elements.length; ++i) + if (!(message.elements[i] && typeof message.elements[i].length === "number" || $util.isString(message.elements[i]))) + return "elements: buffer[] expected"; + } + return null; + }; + + /** + * Creates an Elements message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + */ + Elements.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); + if (object.elements) { + if (!Array.isArray(object.elements)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.elements: array expected"); + message.elements = []; + for (var i = 0; i < object.elements.length; ++i) + if (typeof object.elements[i] === "string") + $util.base64.decode(object.elements[i], message.elements[i] = $util.newBuffer($util.base64.length(object.elements[i])), 0); + else if (object.elements[i].length >= 0) + message.elements[i] = object.elements[i]; + } + return message; + }; + + /** + * Creates a plain object from an Elements message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} message Elements + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Elements.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.elements = []; + if (message.elements && message.elements.length) { + object.elements = []; + for (var j = 0; j < message.elements.length; ++j) + object.elements[j] = options.bytes === String ? $util.base64.encode(message.elements[j], 0, message.elements[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.elements[j]) : message.elements[j]; + } + return object; + }; + + /** + * Converts this Elements to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @instance + * @returns {Object.} JSON object + */ + Elements.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Elements; + })(); + + return GetPathElementsResponseV0; + })(); + + return GetPathElementsResponse; + })(); + + v0.GetStatusRequest = (function() { + + /** + * Properties of a GetStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetStatusRequest + * @property {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null} [v0] GetStatusRequest v0 + */ + + /** + * Constructs a new GetStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetStatusRequest. + * @implements IGetStatusRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set + */ + function GetStatusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStatusRequest v0. + * @member {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + */ + GetStatusRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetStatusRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + */ + Object.defineProperty(GetStatusRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetStatusRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest instance + */ + GetStatusRequest.create = function create(properties) { + return new GetStatusRequest(properties); + }; + + /** + * Encodes the specified GetStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + */ + GetStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest} message GetStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetStatusRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + * @returns {Object.} JSON object + */ + GetStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusRequest.GetStatusRequestV0 = (function() { + + /** + * Properties of a GetStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @interface IGetStatusRequestV0 + */ + + /** + * Constructs a new GetStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @classdesc Represents a GetStatusRequestV0. + * @implements IGetStatusRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set + */ + function GetStatusRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetStatusRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 instance + */ + GetStatusRequestV0.create = function create(properties) { + return new GetStatusRequestV0(properties); + }; + + /** + * Encodes the specified GetStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetStatusRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + */ + GetStatusRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0) + return object; + return new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); + }; + + /** + * Creates a plain object from a GetStatusRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} message GetStatusRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusRequestV0.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetStatusRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetStatusRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetStatusRequestV0; + })(); + + return GetStatusRequest; + })(); + + v0.GetStatusResponse = (function() { + + /** + * Properties of a GetStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetStatusResponse + * @property {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null} [v0] GetStatusResponse v0 + */ + + /** + * Constructs a new GetStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetStatusResponse. + * @implements IGetStatusResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set + */ + function GetStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStatusResponse v0. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + */ + GetStatusResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetStatusResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + */ + Object.defineProperty(GetStatusResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetStatusResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse instance + */ + GetStatusResponse.create = function create(properties) { + return new GetStatusResponse(properties); + }; + + /** + * Encodes the specified GetStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + */ + GetStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse} message GetStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetStatusResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + * @returns {Object.} JSON object + */ + GetStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusResponse.GetStatusResponseV0 = (function() { + + /** + * Properties of a GetStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @interface IGetStatusResponseV0 + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null} [version] GetStatusResponseV0 version + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null} [node] GetStatusResponseV0 node + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null} [chain] GetStatusResponseV0 chain + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null} [network] GetStatusResponseV0 network + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null} [stateSync] GetStatusResponseV0 stateSync + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null} [time] GetStatusResponseV0 time + */ + + /** + * Constructs a new GetStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @classdesc Represents a GetStatusResponseV0. + * @implements IGetStatusResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set + */ + function GetStatusResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStatusResponseV0 version. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.version = null; + + /** + * GetStatusResponseV0 node. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null|undefined} node + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.node = null; + + /** + * GetStatusResponseV0 chain. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null|undefined} chain + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.chain = null; + + /** + * GetStatusResponseV0 network. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null|undefined} network + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.network = null; + + /** + * GetStatusResponseV0 stateSync. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null|undefined} stateSync + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.stateSync = null; + + /** + * GetStatusResponseV0 time. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null|undefined} time + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.time = null; + + /** + * Creates a new GetStatusResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 instance + */ + GetStatusResponseV0.create = function create(properties) { + return new GetStatusResponseV0(properties); + }; + + /** + * Encodes the specified GetStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.encode(message.node, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.encode(message.chain, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.encode(message.network, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.stateSync != null && Object.hasOwnProperty.call(message, "stateSync")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.encode(message.stateSync, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.encode(message.time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.decode(reader, reader.uint32()); + break; + case 2: + message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.decode(reader, reader.uint32()); + break; + case 3: + message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.decode(reader, reader.uint32()); + break; + case 4: + message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.decode(reader, reader.uint32()); + break; + case 5: + message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.decode(reader, reader.uint32()); + break; + case 6: + message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify(message.version); + if (error) + return "version." + error; + } + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify(message.node); + if (error) + return "node." + error; + } + if (message.chain != null && message.hasOwnProperty("chain")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify(message.chain); + if (error) + return "chain." + error; + } + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify(message.network); + if (error) + return "network." + error; + } + if (message.stateSync != null && message.hasOwnProperty("stateSync")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify(message.stateSync); + if (error) + return "stateSync." + error; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify(message.time); + if (error) + return "time." + error; + } + return null; + }; + + /** + * Creates a GetStatusResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + */ + GetStatusResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.version: object expected"); + message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.fromObject(object.version); + } + if (object.node != null) { + if (typeof object.node !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.node: object expected"); + message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.fromObject(object.node); + } + if (object.chain != null) { + if (typeof object.chain !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.chain: object expected"); + message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.fromObject(object.chain); + } + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.network: object expected"); + message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.fromObject(object.network); + } + if (object.stateSync != null) { + if (typeof object.stateSync !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.stateSync: object expected"); + message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.fromObject(object.stateSync); + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.time: object expected"); + message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.fromObject(object.time); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} message GetStatusResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.node = null; + object.chain = null; + object.network = null; + object.stateSync = null; + object.time = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.toObject(message.version, options); + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.toObject(message.node, options); + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.toObject(message.chain, options); + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.toObject(message.network, options); + if (message.stateSync != null && message.hasOwnProperty("stateSync")) + object.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.toObject(message.stateSync, options); + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.toObject(message.time, options); + return object; + }; + + /** + * Converts this GetStatusResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetStatusResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusResponseV0.Version = (function() { + + /** + * Properties of a Version. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IVersion + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null} [software] Version software + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null} [protocol] Version protocol + */ + + /** + * Constructs a new Version. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set + */ + function Version(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version software. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null|undefined} software + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + */ + Version.prototype.software = null; + + /** + * Version protocol. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null|undefined} protocol + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + */ + Version.prototype.protocol = null; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.software != null && Object.hasOwnProperty.call(message, "software")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.encode(message.software, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.encode(message.protocol, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.decode(reader, reader.uint32()); + break; + case 2: + message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.software != null && message.hasOwnProperty("software")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify(message.software); + if (error) + return "software." + error; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify(message.protocol); + if (error) + return "protocol." + error; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); + if (object.software != null) { + if (typeof object.software !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.software: object expected"); + message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.fromObject(object.software); + } + if (object.protocol != null) { + if (typeof object.protocol !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.protocol: object expected"); + message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.fromObject(object.protocol); + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.software = null; + object.protocol = null; + } + if (message.software != null && message.hasOwnProperty("software")) + object.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.toObject(message.software, options); + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.toObject(message.protocol, options); + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Version.Software = (function() { + + /** + * Properties of a Software. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @interface ISoftware + * @property {string|null} [dapi] Software dapi + * @property {string|null} [drive] Software drive + * @property {string|null} [tenderdash] Software tenderdash + */ + + /** + * Constructs a new Software. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @classdesc Represents a Software. + * @implements ISoftware + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set + */ + function Software(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Software dapi. + * @member {string} dapi + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.dapi = ""; + + /** + * Software drive. + * @member {string} drive + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.drive = ""; + + /** + * Software tenderdash. + * @member {string} tenderdash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.tenderdash = ""; + + /** + * Creates a new Software instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software instance + */ + Software.create = function create(properties) { + return new Software(properties); + }; + + /** + * Encodes the specified Software message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Software.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dapi != null && Object.hasOwnProperty.call(message, "dapi")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dapi); + if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.drive); + if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tenderdash); + return writer; + }; + + /** + * Encodes the specified Software message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Software.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Software message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Software.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dapi = reader.string(); + break; + case 2: + message.drive = reader.string(); + break; + case 3: + message.tenderdash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Software message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Software.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Software message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Software.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dapi != null && message.hasOwnProperty("dapi")) + if (!$util.isString(message.dapi)) + return "dapi: string expected"; + if (message.drive != null && message.hasOwnProperty("drive")) + if (!$util.isString(message.drive)) + return "drive: string expected"; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + if (!$util.isString(message.tenderdash)) + return "tenderdash: string expected"; + return null; + }; + + /** + * Creates a Software message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + */ + Software.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); + if (object.dapi != null) + message.dapi = String(object.dapi); + if (object.drive != null) + message.drive = String(object.drive); + if (object.tenderdash != null) + message.tenderdash = String(object.tenderdash); + return message; + }; + + /** + * Creates a plain object from a Software message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} message Software + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Software.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dapi = ""; + object.drive = ""; + object.tenderdash = ""; + } + if (message.dapi != null && message.hasOwnProperty("dapi")) + object.dapi = message.dapi; + if (message.drive != null && message.hasOwnProperty("drive")) + object.drive = message.drive; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + object.tenderdash = message.tenderdash; + return object; + }; + + /** + * Converts this Software to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + * @returns {Object.} JSON object + */ + Software.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Software; + })(); + + Version.Protocol = (function() { + + /** + * Properties of a Protocol. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @interface IProtocol + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null} [tenderdash] Protocol tenderdash + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null} [drive] Protocol drive + */ + + /** + * Constructs a new Protocol. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @classdesc Represents a Protocol. + * @implements IProtocol + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set + */ + function Protocol(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Protocol tenderdash. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null|undefined} tenderdash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + */ + Protocol.prototype.tenderdash = null; + + /** + * Protocol drive. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null|undefined} drive + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + */ + Protocol.prototype.drive = null; + + /** + * Creates a new Protocol instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol instance + */ + Protocol.create = function create(properties) { + return new Protocol(properties); + }; + + /** + * Encodes the specified Protocol message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Protocol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.encode(message.tenderdash, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.encode(message.drive, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Protocol message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Protocol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Protocol message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Protocol.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.decode(reader, reader.uint32()); + break; + case 2: + message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Protocol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Protocol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Protocol message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Protocol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify(message.tenderdash); + if (error) + return "tenderdash." + error; + } + if (message.drive != null && message.hasOwnProperty("drive")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify(message.drive); + if (error) + return "drive." + error; + } + return null; + }; + + /** + * Creates a Protocol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + */ + Protocol.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); + if (object.tenderdash != null) { + if (typeof object.tenderdash !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.tenderdash: object expected"); + message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.fromObject(object.tenderdash); + } + if (object.drive != null) { + if (typeof object.drive !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.drive: object expected"); + message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.fromObject(object.drive); + } + return message; + }; + + /** + * Creates a plain object from a Protocol message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} message Protocol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Protocol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tenderdash = null; + object.drive = null; + } + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + object.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.toObject(message.tenderdash, options); + if (message.drive != null && message.hasOwnProperty("drive")) + object.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.toObject(message.drive, options); + return object; + }; + + /** + * Converts this Protocol to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + * @returns {Object.} JSON object + */ + Protocol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Protocol.Tenderdash = (function() { + + /** + * Properties of a Tenderdash. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @interface ITenderdash + * @property {number|null} [p2p] Tenderdash p2p + * @property {number|null} [block] Tenderdash block + */ + + /** + * Constructs a new Tenderdash. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @classdesc Represents a Tenderdash. + * @implements ITenderdash + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set + */ + function Tenderdash(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tenderdash p2p. + * @member {number} p2p + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + */ + Tenderdash.prototype.p2p = 0; + + /** + * Tenderdash block. + * @member {number} block + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + */ + Tenderdash.prototype.block = 0; + + /** + * Creates a new Tenderdash instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash instance + */ + Tenderdash.create = function create(properties) { + return new Tenderdash(properties); + }; + + /** + * Encodes the specified Tenderdash message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenderdash.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.p2p); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.block); + return writer; + }; + + /** + * Encodes the specified Tenderdash message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenderdash.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tenderdash message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenderdash.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p2p = reader.uint32(); + break; + case 2: + message.block = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tenderdash message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenderdash.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tenderdash message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tenderdash.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (!$util.isInteger(message.p2p)) + return "p2p: integer expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block)) + return "block: integer expected"; + return null; + }; + + /** + * Creates a Tenderdash message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + */ + Tenderdash.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); + if (object.p2p != null) + message.p2p = object.p2p >>> 0; + if (object.block != null) + message.block = object.block >>> 0; + return message; + }; + + /** + * Creates a plain object from a Tenderdash message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} message Tenderdash + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tenderdash.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.p2p = 0; + object.block = 0; + } + if (message.p2p != null && message.hasOwnProperty("p2p")) + object.p2p = message.p2p; + if (message.block != null && message.hasOwnProperty("block")) + object.block = message.block; + return object; + }; + + /** + * Converts this Tenderdash to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + * @returns {Object.} JSON object + */ + Tenderdash.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Tenderdash; + })(); + + Protocol.Drive = (function() { + + /** + * Properties of a Drive. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @interface IDrive + * @property {number|null} [latest] Drive latest + * @property {number|null} [current] Drive current + */ + + /** + * Constructs a new Drive. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @classdesc Represents a Drive. + * @implements IDrive + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set + */ + function Drive(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Drive latest. + * @member {number} latest + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + */ + Drive.prototype.latest = 0; + + /** + * Drive current. + * @member {number} current + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + */ + Drive.prototype.current = 0; + + /** + * Creates a new Drive instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive instance + */ + Drive.create = function create(properties) { + return new Drive(properties); + }; + + /** + * Encodes the specified Drive message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Drive.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latest != null && Object.hasOwnProperty.call(message, "latest")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.latest); + if (message.current != null && Object.hasOwnProperty.call(message, "current")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.current); + return writer; + }; + + /** + * Encodes the specified Drive message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Drive.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Drive message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Drive.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.latest = reader.uint32(); + break; + case 4: + message.current = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Drive message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Drive.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Drive message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Drive.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latest != null && message.hasOwnProperty("latest")) + if (!$util.isInteger(message.latest)) + return "latest: integer expected"; + if (message.current != null && message.hasOwnProperty("current")) + if (!$util.isInteger(message.current)) + return "current: integer expected"; + return null; + }; + + /** + * Creates a Drive message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + */ + Drive.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); + if (object.latest != null) + message.latest = object.latest >>> 0; + if (object.current != null) + message.current = object.current >>> 0; + return message; + }; + + /** + * Creates a plain object from a Drive message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} message Drive + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Drive.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latest = 0; + object.current = 0; + } + if (message.latest != null && message.hasOwnProperty("latest")) + object.latest = message.latest; + if (message.current != null && message.hasOwnProperty("current")) + object.current = message.current; + return object; + }; + + /** + * Converts this Drive to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + * @returns {Object.} JSON object + */ + Drive.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Drive; + })(); + + return Protocol; + })(); + + return Version; + })(); + + GetStatusResponseV0.Time = (function() { + + /** + * Properties of a Time. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface ITime + * @property {number|Long|null} [local] Time local + * @property {number|Long|null} [block] Time block + * @property {number|Long|null} [genesis] Time genesis + * @property {number|null} [epoch] Time epoch + */ + + /** + * Constructs a new Time. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Time. + * @implements ITime + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set + */ + function Time(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Time local. + * @member {number|Long} local + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.local = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time block. + * @member {number|Long} block + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time genesis. + * @member {number|Long} genesis + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.genesis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.epoch = 0; + + /** + * Creates a new Time instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time instance + */ + Time.create = function create(properties) { + return new Time(properties); + }; + + /** + * Encodes the specified Time message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Time.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.local != null && Object.hasOwnProperty.call(message, "local")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.local); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block); + if (message.genesis != null && Object.hasOwnProperty.call(message, "genesis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.genesis); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.epoch); + return writer; + }; + + /** + * Encodes the specified Time message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Time.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Time message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Time.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.local = reader.uint64(); + break; + case 2: + message.block = reader.uint64(); + break; + case 3: + message.genesis = reader.uint64(); + break; + case 4: + message.epoch = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Time message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Time.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Time message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Time.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.local != null && message.hasOwnProperty("local")) + if (!$util.isInteger(message.local) && !(message.local && $util.isInteger(message.local.low) && $util.isInteger(message.local.high))) + return "local: integer|Long expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.genesis != null && message.hasOwnProperty("genesis")) + if (!$util.isInteger(message.genesis) && !(message.genesis && $util.isInteger(message.genesis.low) && $util.isInteger(message.genesis.high))) + return "genesis: integer|Long expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + return null; + }; + + /** + * Creates a Time message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + */ + Time.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); + if (object.local != null) + if ($util.Long) + (message.local = $util.Long.fromValue(object.local)).unsigned = true; + else if (typeof object.local === "string") + message.local = parseInt(object.local, 10); + else if (typeof object.local === "number") + message.local = object.local; + else if (typeof object.local === "object") + message.local = new $util.LongBits(object.local.low >>> 0, object.local.high >>> 0).toNumber(true); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.genesis != null) + if ($util.Long) + (message.genesis = $util.Long.fromValue(object.genesis)).unsigned = true; + else if (typeof object.genesis === "string") + message.genesis = parseInt(object.genesis, 10); + else if (typeof object.genesis === "number") + message.genesis = object.genesis; + else if (typeof object.genesis === "object") + message.genesis = new $util.LongBits(object.genesis.low >>> 0, object.genesis.high >>> 0).toNumber(true); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + return message; + }; + + /** + * Creates a plain object from a Time message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} message Time + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Time.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.local = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.local = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.genesis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.genesis = options.longs === String ? "0" : 0; + object.epoch = 0; + } + if (message.local != null && message.hasOwnProperty("local")) + if (typeof message.local === "number") + object.local = options.longs === String ? String(message.local) : message.local; + else + object.local = options.longs === String ? $util.Long.prototype.toString.call(message.local) : options.longs === Number ? new $util.LongBits(message.local.low >>> 0, message.local.high >>> 0).toNumber(true) : message.local; + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.genesis != null && message.hasOwnProperty("genesis")) + if (typeof message.genesis === "number") + object.genesis = options.longs === String ? String(message.genesis) : message.genesis; + else + object.genesis = options.longs === String ? $util.Long.prototype.toString.call(message.genesis) : options.longs === Number ? new $util.LongBits(message.genesis.low >>> 0, message.genesis.high >>> 0).toNumber(true) : message.genesis; + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + return object; + }; + + /** + * Converts this Time to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + * @returns {Object.} JSON object + */ + Time.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Time; + })(); + + GetStatusResponseV0.Node = (function() { + + /** + * Properties of a Node. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface INode + * @property {Uint8Array|null} [id] Node id + * @property {Uint8Array|null} [proTxHash] Node proTxHash + */ + + /** + * Constructs a new Node. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + */ + Node.prototype.id = $util.newBuffer([]); + + /** + * Node proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + */ + Node.prototype.proTxHash = $util.newBuffer([]); + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proTxHash); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.proTxHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Node; + })(); + + GetStatusResponseV0.Chain = (function() { + + /** + * Properties of a Chain. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IChain + * @property {boolean|null} [catchingUp] Chain catchingUp + * @property {Uint8Array|null} [latestBlockHash] Chain latestBlockHash + * @property {Uint8Array|null} [latestAppHash] Chain latestAppHash + * @property {number|Long|null} [latestBlockHeight] Chain latestBlockHeight + * @property {Uint8Array|null} [earliestBlockHash] Chain earliestBlockHash + * @property {Uint8Array|null} [earliestAppHash] Chain earliestAppHash + * @property {number|Long|null} [earliestBlockHeight] Chain earliestBlockHeight + * @property {number|Long|null} [maxPeerBlockHeight] Chain maxPeerBlockHeight + * @property {number|null} [coreChainLockedHeight] Chain coreChainLockedHeight + */ + + /** + * Constructs a new Chain. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Chain. + * @implements IChain + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set + */ + function Chain(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chain catchingUp. + * @member {boolean} catchingUp + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.catchingUp = false; + + /** + * Chain latestBlockHash. + * @member {Uint8Array} latestBlockHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestBlockHash = $util.newBuffer([]); + + /** + * Chain latestAppHash. + * @member {Uint8Array} latestAppHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestAppHash = $util.newBuffer([]); + + /** + * Chain latestBlockHeight. + * @member {number|Long} latestBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain earliestBlockHash. + * @member {Uint8Array} earliestBlockHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestBlockHash = $util.newBuffer([]); + + /** + * Chain earliestAppHash. + * @member {Uint8Array} earliestAppHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestAppHash = $util.newBuffer([]); + + /** + * Chain earliestBlockHeight. + * @member {number|Long} earliestBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain maxPeerBlockHeight. + * @member {number|Long} maxPeerBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.maxPeerBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain coreChainLockedHeight. + * @member {number} coreChainLockedHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.coreChainLockedHeight = 0; + + /** + * Creates a new Chain instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain instance + */ + Chain.create = function create(properties) { + return new Chain(properties); + }; + + /** + * Encodes the specified Chain message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catchingUp != null && Object.hasOwnProperty.call(message, "catchingUp")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.catchingUp); + if (message.latestBlockHash != null && Object.hasOwnProperty.call(message, "latestBlockHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.latestBlockHash); + if (message.latestAppHash != null && Object.hasOwnProperty.call(message, "latestAppHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.latestAppHash); + if (message.latestBlockHeight != null && Object.hasOwnProperty.call(message, "latestBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.latestBlockHeight); + if (message.earliestBlockHash != null && Object.hasOwnProperty.call(message, "earliestBlockHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.earliestBlockHash); + if (message.earliestAppHash != null && Object.hasOwnProperty.call(message, "earliestAppHash")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.earliestAppHash); + if (message.earliestBlockHeight != null && Object.hasOwnProperty.call(message, "earliestBlockHeight")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.earliestBlockHeight); + if (message.maxPeerBlockHeight != null && Object.hasOwnProperty.call(message, "maxPeerBlockHeight")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.maxPeerBlockHeight); + if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.coreChainLockedHeight); + return writer; + }; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catchingUp = reader.bool(); + break; + case 2: + message.latestBlockHash = reader.bytes(); + break; + case 3: + message.latestAppHash = reader.bytes(); + break; + case 4: + message.latestBlockHeight = reader.uint64(); + break; + case 5: + message.earliestBlockHash = reader.bytes(); + break; + case 6: + message.earliestAppHash = reader.bytes(); + break; + case 7: + message.earliestBlockHeight = reader.uint64(); + break; + case 9: + message.maxPeerBlockHeight = reader.uint64(); + break; + case 10: + message.coreChainLockedHeight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chain message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) + if (typeof message.catchingUp !== "boolean") + return "catchingUp: boolean expected"; + if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) + if (!(message.latestBlockHash && typeof message.latestBlockHash.length === "number" || $util.isString(message.latestBlockHash))) + return "latestBlockHash: buffer expected"; + if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) + if (!(message.latestAppHash && typeof message.latestAppHash.length === "number" || $util.isString(message.latestAppHash))) + return "latestAppHash: buffer expected"; + if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) + if (!$util.isInteger(message.latestBlockHeight) && !(message.latestBlockHeight && $util.isInteger(message.latestBlockHeight.low) && $util.isInteger(message.latestBlockHeight.high))) + return "latestBlockHeight: integer|Long expected"; + if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) + if (!(message.earliestBlockHash && typeof message.earliestBlockHash.length === "number" || $util.isString(message.earliestBlockHash))) + return "earliestBlockHash: buffer expected"; + if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) + if (!(message.earliestAppHash && typeof message.earliestAppHash.length === "number" || $util.isString(message.earliestAppHash))) + return "earliestAppHash: buffer expected"; + if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) + if (!$util.isInteger(message.earliestBlockHeight) && !(message.earliestBlockHeight && $util.isInteger(message.earliestBlockHeight.low) && $util.isInteger(message.earliestBlockHeight.high))) + return "earliestBlockHeight: integer|Long expected"; + if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) + if (!$util.isInteger(message.maxPeerBlockHeight) && !(message.maxPeerBlockHeight && $util.isInteger(message.maxPeerBlockHeight.low) && $util.isInteger(message.maxPeerBlockHeight.high))) + return "maxPeerBlockHeight: integer|Long expected"; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + if (!$util.isInteger(message.coreChainLockedHeight)) + return "coreChainLockedHeight: integer expected"; + return null; + }; + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + */ + Chain.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); + if (object.catchingUp != null) + message.catchingUp = Boolean(object.catchingUp); + if (object.latestBlockHash != null) + if (typeof object.latestBlockHash === "string") + $util.base64.decode(object.latestBlockHash, message.latestBlockHash = $util.newBuffer($util.base64.length(object.latestBlockHash)), 0); + else if (object.latestBlockHash.length >= 0) + message.latestBlockHash = object.latestBlockHash; + if (object.latestAppHash != null) + if (typeof object.latestAppHash === "string") + $util.base64.decode(object.latestAppHash, message.latestAppHash = $util.newBuffer($util.base64.length(object.latestAppHash)), 0); + else if (object.latestAppHash.length >= 0) + message.latestAppHash = object.latestAppHash; + if (object.latestBlockHeight != null) + if ($util.Long) + (message.latestBlockHeight = $util.Long.fromValue(object.latestBlockHeight)).unsigned = true; + else if (typeof object.latestBlockHeight === "string") + message.latestBlockHeight = parseInt(object.latestBlockHeight, 10); + else if (typeof object.latestBlockHeight === "number") + message.latestBlockHeight = object.latestBlockHeight; + else if (typeof object.latestBlockHeight === "object") + message.latestBlockHeight = new $util.LongBits(object.latestBlockHeight.low >>> 0, object.latestBlockHeight.high >>> 0).toNumber(true); + if (object.earliestBlockHash != null) + if (typeof object.earliestBlockHash === "string") + $util.base64.decode(object.earliestBlockHash, message.earliestBlockHash = $util.newBuffer($util.base64.length(object.earliestBlockHash)), 0); + else if (object.earliestBlockHash.length >= 0) + message.earliestBlockHash = object.earliestBlockHash; + if (object.earliestAppHash != null) + if (typeof object.earliestAppHash === "string") + $util.base64.decode(object.earliestAppHash, message.earliestAppHash = $util.newBuffer($util.base64.length(object.earliestAppHash)), 0); + else if (object.earliestAppHash.length >= 0) + message.earliestAppHash = object.earliestAppHash; + if (object.earliestBlockHeight != null) + if ($util.Long) + (message.earliestBlockHeight = $util.Long.fromValue(object.earliestBlockHeight)).unsigned = true; + else if (typeof object.earliestBlockHeight === "string") + message.earliestBlockHeight = parseInt(object.earliestBlockHeight, 10); + else if (typeof object.earliestBlockHeight === "number") + message.earliestBlockHeight = object.earliestBlockHeight; + else if (typeof object.earliestBlockHeight === "object") + message.earliestBlockHeight = new $util.LongBits(object.earliestBlockHeight.low >>> 0, object.earliestBlockHeight.high >>> 0).toNumber(true); + if (object.maxPeerBlockHeight != null) + if ($util.Long) + (message.maxPeerBlockHeight = $util.Long.fromValue(object.maxPeerBlockHeight)).unsigned = true; + else if (typeof object.maxPeerBlockHeight === "string") + message.maxPeerBlockHeight = parseInt(object.maxPeerBlockHeight, 10); + else if (typeof object.maxPeerBlockHeight === "number") + message.maxPeerBlockHeight = object.maxPeerBlockHeight; + else if (typeof object.maxPeerBlockHeight === "object") + message.maxPeerBlockHeight = new $util.LongBits(object.maxPeerBlockHeight.low >>> 0, object.maxPeerBlockHeight.high >>> 0).toNumber(true); + if (object.coreChainLockedHeight != null) + message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; + return message; + }; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} message Chain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.catchingUp = false; + if (options.bytes === String) + object.latestBlockHash = ""; + else { + object.latestBlockHash = []; + if (options.bytes !== Array) + object.latestBlockHash = $util.newBuffer(object.latestBlockHash); + } + if (options.bytes === String) + object.latestAppHash = ""; + else { + object.latestAppHash = []; + if (options.bytes !== Array) + object.latestAppHash = $util.newBuffer(object.latestAppHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.latestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.latestBlockHeight = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.earliestBlockHash = ""; + else { + object.earliestBlockHash = []; + if (options.bytes !== Array) + object.earliestBlockHash = $util.newBuffer(object.earliestBlockHash); + } + if (options.bytes === String) + object.earliestAppHash = ""; + else { + object.earliestAppHash = []; + if (options.bytes !== Array) + object.earliestAppHash = $util.newBuffer(object.earliestAppHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.earliestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.earliestBlockHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.maxPeerBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxPeerBlockHeight = options.longs === String ? "0" : 0; + object.coreChainLockedHeight = 0; + } + if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) + object.catchingUp = message.catchingUp; + if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) + object.latestBlockHash = options.bytes === String ? $util.base64.encode(message.latestBlockHash, 0, message.latestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestBlockHash) : message.latestBlockHash; + if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) + object.latestAppHash = options.bytes === String ? $util.base64.encode(message.latestAppHash, 0, message.latestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestAppHash) : message.latestAppHash; + if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) + if (typeof message.latestBlockHeight === "number") + object.latestBlockHeight = options.longs === String ? String(message.latestBlockHeight) : message.latestBlockHeight; + else + object.latestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.latestBlockHeight) : options.longs === Number ? new $util.LongBits(message.latestBlockHeight.low >>> 0, message.latestBlockHeight.high >>> 0).toNumber(true) : message.latestBlockHeight; + if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) + object.earliestBlockHash = options.bytes === String ? $util.base64.encode(message.earliestBlockHash, 0, message.earliestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestBlockHash) : message.earliestBlockHash; + if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) + object.earliestAppHash = options.bytes === String ? $util.base64.encode(message.earliestAppHash, 0, message.earliestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestAppHash) : message.earliestAppHash; + if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) + if (typeof message.earliestBlockHeight === "number") + object.earliestBlockHeight = options.longs === String ? String(message.earliestBlockHeight) : message.earliestBlockHeight; + else + object.earliestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.earliestBlockHeight) : options.longs === Number ? new $util.LongBits(message.earliestBlockHeight.low >>> 0, message.earliestBlockHeight.high >>> 0).toNumber(true) : message.earliestBlockHeight; + if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) + if (typeof message.maxPeerBlockHeight === "number") + object.maxPeerBlockHeight = options.longs === String ? String(message.maxPeerBlockHeight) : message.maxPeerBlockHeight; + else + object.maxPeerBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.maxPeerBlockHeight) : options.longs === Number ? new $util.LongBits(message.maxPeerBlockHeight.low >>> 0, message.maxPeerBlockHeight.high >>> 0).toNumber(true) : message.maxPeerBlockHeight; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + object.coreChainLockedHeight = message.coreChainLockedHeight; + return object; + }; + + /** + * Converts this Chain to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + * @returns {Object.} JSON object + */ + Chain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Chain; + })(); + + GetStatusResponseV0.Network = (function() { + + /** + * Properties of a Network. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface INetwork + * @property {string|null} [chainId] Network chainId + * @property {number|null} [peersCount] Network peersCount + * @property {boolean|null} [listening] Network listening + */ + + /** + * Constructs a new Network. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Network. + * @implements INetwork + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set + */ + function Network(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Network chainId. + * @member {string} chainId + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.chainId = ""; + + /** + * Network peersCount. + * @member {number} peersCount + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.peersCount = 0; + + /** + * Network listening. + * @member {boolean} listening + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.listening = false; + + /** + * Creates a new Network instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network instance + */ + Network.create = function create(properties) { + return new Network(properties); + }; + + /** + * Encodes the specified Network message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.chainId); + if (message.peersCount != null && Object.hasOwnProperty.call(message, "peersCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.peersCount); + if (message.listening != null && Object.hasOwnProperty.call(message, "listening")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.listening); + return writer; + }; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Network message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.peersCount = reader.uint32(); + break; + case 3: + message.listening = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Network message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Network.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.peersCount != null && message.hasOwnProperty("peersCount")) + if (!$util.isInteger(message.peersCount)) + return "peersCount: integer expected"; + if (message.listening != null && message.hasOwnProperty("listening")) + if (typeof message.listening !== "boolean") + return "listening: boolean expected"; + return null; + }; + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + */ + Network.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.peersCount != null) + message.peersCount = object.peersCount >>> 0; + if (object.listening != null) + message.listening = Boolean(object.listening); + return message; + }; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} message Network + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Network.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chainId = ""; + object.peersCount = 0; + object.listening = false; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.peersCount != null && message.hasOwnProperty("peersCount")) + object.peersCount = message.peersCount; + if (message.listening != null && message.hasOwnProperty("listening")) + object.listening = message.listening; + return object; + }; + + /** + * Converts this Network to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + * @returns {Object.} JSON object + */ + Network.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Network; + })(); + + GetStatusResponseV0.StateSync = (function() { + + /** + * Properties of a StateSync. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IStateSync + * @property {number|Long|null} [totalSyncedTime] StateSync totalSyncedTime + * @property {number|Long|null} [remainingTime] StateSync remainingTime + * @property {number|null} [totalSnapshots] StateSync totalSnapshots + * @property {number|Long|null} [chunkProcessAvgTime] StateSync chunkProcessAvgTime + * @property {number|Long|null} [snapshotHeight] StateSync snapshotHeight + * @property {number|Long|null} [snapshotChunksCount] StateSync snapshotChunksCount + * @property {number|Long|null} [backfilledBlocks] StateSync backfilledBlocks + * @property {number|Long|null} [backfillBlocksTotal] StateSync backfillBlocksTotal + */ + + /** + * Constructs a new StateSync. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a StateSync. + * @implements IStateSync + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set + */ + function StateSync(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateSync totalSyncedTime. + * @member {number|Long} totalSyncedTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.totalSyncedTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync remainingTime. + * @member {number|Long} remainingTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.remainingTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync totalSnapshots. + * @member {number} totalSnapshots + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.totalSnapshots = 0; + + /** + * StateSync chunkProcessAvgTime. + * @member {number|Long} chunkProcessAvgTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.chunkProcessAvgTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync snapshotHeight. + * @member {number|Long} snapshotHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.snapshotHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync snapshotChunksCount. + * @member {number|Long} snapshotChunksCount + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.snapshotChunksCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync backfilledBlocks. + * @member {number|Long} backfilledBlocks + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.backfilledBlocks = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync backfillBlocksTotal. + * @member {number|Long} backfillBlocksTotal + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.backfillBlocksTotal = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new StateSync instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync instance + */ + StateSync.create = function create(properties) { + return new StateSync(properties); + }; + + /** + * Encodes the specified StateSync message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateSync.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalSyncedTime != null && Object.hasOwnProperty.call(message, "totalSyncedTime")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.totalSyncedTime); + if (message.remainingTime != null && Object.hasOwnProperty.call(message, "remainingTime")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.remainingTime); + if (message.totalSnapshots != null && Object.hasOwnProperty.call(message, "totalSnapshots")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.totalSnapshots); + if (message.chunkProcessAvgTime != null && Object.hasOwnProperty.call(message, "chunkProcessAvgTime")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.chunkProcessAvgTime); + if (message.snapshotHeight != null && Object.hasOwnProperty.call(message, "snapshotHeight")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.snapshotHeight); + if (message.snapshotChunksCount != null && Object.hasOwnProperty.call(message, "snapshotChunksCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.snapshotChunksCount); + if (message.backfilledBlocks != null && Object.hasOwnProperty.call(message, "backfilledBlocks")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.backfilledBlocks); + if (message.backfillBlocksTotal != null && Object.hasOwnProperty.call(message, "backfillBlocksTotal")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.backfillBlocksTotal); + return writer; + }; + + /** + * Encodes the specified StateSync message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateSync.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateSync message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateSync.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalSyncedTime = reader.uint64(); + break; + case 2: + message.remainingTime = reader.uint64(); + break; + case 3: + message.totalSnapshots = reader.uint32(); + break; + case 4: + message.chunkProcessAvgTime = reader.uint64(); + break; + case 5: + message.snapshotHeight = reader.uint64(); + break; + case 6: + message.snapshotChunksCount = reader.uint64(); + break; + case 7: + message.backfilledBlocks = reader.uint64(); + break; + case 8: + message.backfillBlocksTotal = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateSync message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateSync.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateSync message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateSync.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) + if (!$util.isInteger(message.totalSyncedTime) && !(message.totalSyncedTime && $util.isInteger(message.totalSyncedTime.low) && $util.isInteger(message.totalSyncedTime.high))) + return "totalSyncedTime: integer|Long expected"; + if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) + if (!$util.isInteger(message.remainingTime) && !(message.remainingTime && $util.isInteger(message.remainingTime.low) && $util.isInteger(message.remainingTime.high))) + return "remainingTime: integer|Long expected"; + if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) + if (!$util.isInteger(message.totalSnapshots)) + return "totalSnapshots: integer expected"; + if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) + if (!$util.isInteger(message.chunkProcessAvgTime) && !(message.chunkProcessAvgTime && $util.isInteger(message.chunkProcessAvgTime.low) && $util.isInteger(message.chunkProcessAvgTime.high))) + return "chunkProcessAvgTime: integer|Long expected"; + if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) + if (!$util.isInteger(message.snapshotHeight) && !(message.snapshotHeight && $util.isInteger(message.snapshotHeight.low) && $util.isInteger(message.snapshotHeight.high))) + return "snapshotHeight: integer|Long expected"; + if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) + if (!$util.isInteger(message.snapshotChunksCount) && !(message.snapshotChunksCount && $util.isInteger(message.snapshotChunksCount.low) && $util.isInteger(message.snapshotChunksCount.high))) + return "snapshotChunksCount: integer|Long expected"; + if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) + if (!$util.isInteger(message.backfilledBlocks) && !(message.backfilledBlocks && $util.isInteger(message.backfilledBlocks.low) && $util.isInteger(message.backfilledBlocks.high))) + return "backfilledBlocks: integer|Long expected"; + if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) + if (!$util.isInteger(message.backfillBlocksTotal) && !(message.backfillBlocksTotal && $util.isInteger(message.backfillBlocksTotal.low) && $util.isInteger(message.backfillBlocksTotal.high))) + return "backfillBlocksTotal: integer|Long expected"; + return null; + }; + + /** + * Creates a StateSync message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + */ + StateSync.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); + if (object.totalSyncedTime != null) + if ($util.Long) + (message.totalSyncedTime = $util.Long.fromValue(object.totalSyncedTime)).unsigned = true; + else if (typeof object.totalSyncedTime === "string") + message.totalSyncedTime = parseInt(object.totalSyncedTime, 10); + else if (typeof object.totalSyncedTime === "number") + message.totalSyncedTime = object.totalSyncedTime; + else if (typeof object.totalSyncedTime === "object") + message.totalSyncedTime = new $util.LongBits(object.totalSyncedTime.low >>> 0, object.totalSyncedTime.high >>> 0).toNumber(true); + if (object.remainingTime != null) + if ($util.Long) + (message.remainingTime = $util.Long.fromValue(object.remainingTime)).unsigned = true; + else if (typeof object.remainingTime === "string") + message.remainingTime = parseInt(object.remainingTime, 10); + else if (typeof object.remainingTime === "number") + message.remainingTime = object.remainingTime; + else if (typeof object.remainingTime === "object") + message.remainingTime = new $util.LongBits(object.remainingTime.low >>> 0, object.remainingTime.high >>> 0).toNumber(true); + if (object.totalSnapshots != null) + message.totalSnapshots = object.totalSnapshots >>> 0; + if (object.chunkProcessAvgTime != null) + if ($util.Long) + (message.chunkProcessAvgTime = $util.Long.fromValue(object.chunkProcessAvgTime)).unsigned = true; + else if (typeof object.chunkProcessAvgTime === "string") + message.chunkProcessAvgTime = parseInt(object.chunkProcessAvgTime, 10); + else if (typeof object.chunkProcessAvgTime === "number") + message.chunkProcessAvgTime = object.chunkProcessAvgTime; + else if (typeof object.chunkProcessAvgTime === "object") + message.chunkProcessAvgTime = new $util.LongBits(object.chunkProcessAvgTime.low >>> 0, object.chunkProcessAvgTime.high >>> 0).toNumber(true); + if (object.snapshotHeight != null) + if ($util.Long) + (message.snapshotHeight = $util.Long.fromValue(object.snapshotHeight)).unsigned = true; + else if (typeof object.snapshotHeight === "string") + message.snapshotHeight = parseInt(object.snapshotHeight, 10); + else if (typeof object.snapshotHeight === "number") + message.snapshotHeight = object.snapshotHeight; + else if (typeof object.snapshotHeight === "object") + message.snapshotHeight = new $util.LongBits(object.snapshotHeight.low >>> 0, object.snapshotHeight.high >>> 0).toNumber(true); + if (object.snapshotChunksCount != null) + if ($util.Long) + (message.snapshotChunksCount = $util.Long.fromValue(object.snapshotChunksCount)).unsigned = true; + else if (typeof object.snapshotChunksCount === "string") + message.snapshotChunksCount = parseInt(object.snapshotChunksCount, 10); + else if (typeof object.snapshotChunksCount === "number") + message.snapshotChunksCount = object.snapshotChunksCount; + else if (typeof object.snapshotChunksCount === "object") + message.snapshotChunksCount = new $util.LongBits(object.snapshotChunksCount.low >>> 0, object.snapshotChunksCount.high >>> 0).toNumber(true); + if (object.backfilledBlocks != null) + if ($util.Long) + (message.backfilledBlocks = $util.Long.fromValue(object.backfilledBlocks)).unsigned = true; + else if (typeof object.backfilledBlocks === "string") + message.backfilledBlocks = parseInt(object.backfilledBlocks, 10); + else if (typeof object.backfilledBlocks === "number") + message.backfilledBlocks = object.backfilledBlocks; + else if (typeof object.backfilledBlocks === "object") + message.backfilledBlocks = new $util.LongBits(object.backfilledBlocks.low >>> 0, object.backfilledBlocks.high >>> 0).toNumber(true); + if (object.backfillBlocksTotal != null) + if ($util.Long) + (message.backfillBlocksTotal = $util.Long.fromValue(object.backfillBlocksTotal)).unsigned = true; + else if (typeof object.backfillBlocksTotal === "string") + message.backfillBlocksTotal = parseInt(object.backfillBlocksTotal, 10); + else if (typeof object.backfillBlocksTotal === "number") + message.backfillBlocksTotal = object.backfillBlocksTotal; + else if (typeof object.backfillBlocksTotal === "object") + message.backfillBlocksTotal = new $util.LongBits(object.backfillBlocksTotal.low >>> 0, object.backfillBlocksTotal.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a StateSync message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} message StateSync + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateSync.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalSyncedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalSyncedTime = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.remainingTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.remainingTime = options.longs === String ? "0" : 0; + object.totalSnapshots = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.chunkProcessAvgTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.chunkProcessAvgTime = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.snapshotHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.snapshotHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.snapshotChunksCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.snapshotChunksCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.backfilledBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backfilledBlocks = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.backfillBlocksTotal = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backfillBlocksTotal = options.longs === String ? "0" : 0; + } + if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) + if (typeof message.totalSyncedTime === "number") + object.totalSyncedTime = options.longs === String ? String(message.totalSyncedTime) : message.totalSyncedTime; + else + object.totalSyncedTime = options.longs === String ? $util.Long.prototype.toString.call(message.totalSyncedTime) : options.longs === Number ? new $util.LongBits(message.totalSyncedTime.low >>> 0, message.totalSyncedTime.high >>> 0).toNumber(true) : message.totalSyncedTime; + if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) + if (typeof message.remainingTime === "number") + object.remainingTime = options.longs === String ? String(message.remainingTime) : message.remainingTime; + else + object.remainingTime = options.longs === String ? $util.Long.prototype.toString.call(message.remainingTime) : options.longs === Number ? new $util.LongBits(message.remainingTime.low >>> 0, message.remainingTime.high >>> 0).toNumber(true) : message.remainingTime; + if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) + object.totalSnapshots = message.totalSnapshots; + if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) + if (typeof message.chunkProcessAvgTime === "number") + object.chunkProcessAvgTime = options.longs === String ? String(message.chunkProcessAvgTime) : message.chunkProcessAvgTime; + else + object.chunkProcessAvgTime = options.longs === String ? $util.Long.prototype.toString.call(message.chunkProcessAvgTime) : options.longs === Number ? new $util.LongBits(message.chunkProcessAvgTime.low >>> 0, message.chunkProcessAvgTime.high >>> 0).toNumber(true) : message.chunkProcessAvgTime; + if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) + if (typeof message.snapshotHeight === "number") + object.snapshotHeight = options.longs === String ? String(message.snapshotHeight) : message.snapshotHeight; + else + object.snapshotHeight = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotHeight) : options.longs === Number ? new $util.LongBits(message.snapshotHeight.low >>> 0, message.snapshotHeight.high >>> 0).toNumber(true) : message.snapshotHeight; + if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) + if (typeof message.snapshotChunksCount === "number") + object.snapshotChunksCount = options.longs === String ? String(message.snapshotChunksCount) : message.snapshotChunksCount; + else + object.snapshotChunksCount = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotChunksCount) : options.longs === Number ? new $util.LongBits(message.snapshotChunksCount.low >>> 0, message.snapshotChunksCount.high >>> 0).toNumber(true) : message.snapshotChunksCount; + if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) + if (typeof message.backfilledBlocks === "number") + object.backfilledBlocks = options.longs === String ? String(message.backfilledBlocks) : message.backfilledBlocks; + else + object.backfilledBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.backfilledBlocks) : options.longs === Number ? new $util.LongBits(message.backfilledBlocks.low >>> 0, message.backfilledBlocks.high >>> 0).toNumber(true) : message.backfilledBlocks; + if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) + if (typeof message.backfillBlocksTotal === "number") + object.backfillBlocksTotal = options.longs === String ? String(message.backfillBlocksTotal) : message.backfillBlocksTotal; + else + object.backfillBlocksTotal = options.longs === String ? $util.Long.prototype.toString.call(message.backfillBlocksTotal) : options.longs === Number ? new $util.LongBits(message.backfillBlocksTotal.low >>> 0, message.backfillBlocksTotal.high >>> 0).toNumber(true) : message.backfillBlocksTotal; + return object; + }; + + /** + * Converts this StateSync to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + * @returns {Object.} JSON object + */ + StateSync.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateSync; + })(); + + return GetStatusResponseV0; + })(); + + return GetStatusResponse; + })(); + + v0.GetCurrentQuorumsInfoRequest = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetCurrentQuorumsInfoRequest + * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null} [v0] GetCurrentQuorumsInfoRequest v0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetCurrentQuorumsInfoRequest. + * @implements IGetCurrentQuorumsInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + */ + GetCurrentQuorumsInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetCurrentQuorumsInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + */ + Object.defineProperty(GetCurrentQuorumsInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetCurrentQuorumsInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest instance + */ + GetCurrentQuorumsInfoRequest.create = function create(properties) { + return new GetCurrentQuorumsInfoRequest(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + */ + GetCurrentQuorumsInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @interface IGetCurrentQuorumsInfoRequestV0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @classdesc Represents a GetCurrentQuorumsInfoRequestV0. + * @implements IGetCurrentQuorumsInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetCurrentQuorumsInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 instance + */ + GetCurrentQuorumsInfoRequestV0.create = function create(properties) { + return new GetCurrentQuorumsInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + */ + GetCurrentQuorumsInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0) + return object; + return new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoRequestV0.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetCurrentQuorumsInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCurrentQuorumsInfoRequestV0; + })(); + + return GetCurrentQuorumsInfoRequest; + })(); + + v0.GetCurrentQuorumsInfoResponse = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetCurrentQuorumsInfoResponse + * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null} [v0] GetCurrentQuorumsInfoResponse v0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetCurrentQuorumsInfoResponse. + * @implements IGetCurrentQuorumsInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + */ + GetCurrentQuorumsInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetCurrentQuorumsInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + */ + Object.defineProperty(GetCurrentQuorumsInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetCurrentQuorumsInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse instance + */ + GetCurrentQuorumsInfoResponse.create = function create(properties) { + return new GetCurrentQuorumsInfoResponse(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + */ + GetCurrentQuorumsInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetCurrentQuorumsInfoResponse.ValidatorV0 = (function() { + + /** + * Properties of a ValidatorV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IValidatorV0 + * @property {Uint8Array|null} [proTxHash] ValidatorV0 proTxHash + * @property {string|null} [nodeIp] ValidatorV0 nodeIp + * @property {boolean|null} [isBanned] ValidatorV0 isBanned + */ + + /** + * Constructs a new ValidatorV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a ValidatorV0. + * @implements IValidatorV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set + */ + function ValidatorV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorV0 proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.proTxHash = $util.newBuffer([]); + + /** + * ValidatorV0 nodeIp. + * @member {string} nodeIp + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.nodeIp = ""; + + /** + * ValidatorV0 isBanned. + * @member {boolean} isBanned + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.isBanned = false; + + /** + * Creates a new ValidatorV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 instance + */ + ValidatorV0.create = function create(properties) { + return new ValidatorV0(properties); + }; + + /** + * Encodes the specified ValidatorV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.nodeIp != null && Object.hasOwnProperty.call(message, "nodeIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIp); + if (message.isBanned != null && Object.hasOwnProperty.call(message, "isBanned")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isBanned); + return writer; + }; + + /** + * Encodes the specified ValidatorV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.nodeIp = reader.string(); + break; + case 3: + message.isBanned = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) + if (!$util.isString(message.nodeIp)) + return "nodeIp: string expected"; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + if (typeof message.isBanned !== "boolean") + return "isBanned: boolean expected"; + return null; + }; + + /** + * Creates a ValidatorV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + */ + ValidatorV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.nodeIp != null) + message.nodeIp = String(object.nodeIp); + if (object.isBanned != null) + message.isBanned = Boolean(object.isBanned); + return message; + }; + + /** + * Creates a plain object from a ValidatorV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} message ValidatorV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + object.nodeIp = ""; + object.isBanned = false; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) + object.nodeIp = message.nodeIp; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + object.isBanned = message.isBanned; + return object; + }; + + /** + * Converts this ValidatorV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + * @returns {Object.} JSON object + */ + ValidatorV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorV0; + })(); + + GetCurrentQuorumsInfoResponse.ValidatorSetV0 = (function() { + + /** + * Properties of a ValidatorSetV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IValidatorSetV0 + * @property {Uint8Array|null} [quorumHash] ValidatorSetV0 quorumHash + * @property {number|null} [coreHeight] ValidatorSetV0 coreHeight + * @property {Array.|null} [members] ValidatorSetV0 members + * @property {Uint8Array|null} [thresholdPublicKey] ValidatorSetV0 thresholdPublicKey + */ + + /** + * Constructs a new ValidatorSetV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a ValidatorSetV0. + * @implements IValidatorSetV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set + */ + function ValidatorSetV0(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSetV0 quorumHash. + * @member {Uint8Array} quorumHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.quorumHash = $util.newBuffer([]); + + /** + * ValidatorSetV0 coreHeight. + * @member {number} coreHeight + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.coreHeight = 0; + + /** + * ValidatorSetV0 members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.members = $util.emptyArray; + + /** + * ValidatorSetV0 thresholdPublicKey. + * @member {Uint8Array} thresholdPublicKey + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.thresholdPublicKey = $util.newBuffer([]); + + /** + * Creates a new ValidatorSetV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 instance + */ + ValidatorSetV0.create = function create(properties) { + return new ValidatorSetV0(properties); + }; + + /** + * Encodes the specified ValidatorSetV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSetV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHash); + if (message.coreHeight != null && Object.hasOwnProperty.call(message, "coreHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreHeight); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.encode(message.members[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.thresholdPublicKey != null && Object.hasOwnProperty.call(message, "thresholdPublicKey")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.thresholdPublicKey); + return writer; + }; + + /** + * Encodes the specified ValidatorSetV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSetV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSetV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSetV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorumHash = reader.bytes(); + break; + case 2: + message.coreHeight = reader.uint32(); + break; + case 3: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.decode(reader, reader.uint32())); + break; + case 4: + message.thresholdPublicKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSetV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSetV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSetV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSetV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) + return "quorumHash: buffer expected"; + if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) + if (!$util.isInteger(message.coreHeight)) + return "coreHeight: integer expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) + if (!(message.thresholdPublicKey && typeof message.thresholdPublicKey.length === "number" || $util.isString(message.thresholdPublicKey))) + return "thresholdPublicKey: buffer expected"; + return null; + }; + + /** + * Creates a ValidatorSetV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + */ + ValidatorSetV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); + if (object.quorumHash != null) + if (typeof object.quorumHash === "string") + $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); + else if (object.quorumHash.length >= 0) + message.quorumHash = object.quorumHash; + if (object.coreHeight != null) + message.coreHeight = object.coreHeight >>> 0; + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.fromObject(object.members[i]); + } + } + if (object.thresholdPublicKey != null) + if (typeof object.thresholdPublicKey === "string") + $util.base64.decode(object.thresholdPublicKey, message.thresholdPublicKey = $util.newBuffer($util.base64.length(object.thresholdPublicKey)), 0); + else if (object.thresholdPublicKey.length >= 0) + message.thresholdPublicKey = object.thresholdPublicKey; + return message; + }; + + /** + * Creates a plain object from a ValidatorSetV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} message ValidatorSetV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSetV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + if (options.bytes === String) + object.quorumHash = ""; + else { + object.quorumHash = []; + if (options.bytes !== Array) + object.quorumHash = $util.newBuffer(object.quorumHash); + } + object.coreHeight = 0; + if (options.bytes === String) + object.thresholdPublicKey = ""; + else { + object.thresholdPublicKey = []; + if (options.bytes !== Array) + object.thresholdPublicKey = $util.newBuffer(object.thresholdPublicKey); + } + } + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; + if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) + object.coreHeight = message.coreHeight; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject(message.members[j], options); + } + if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) + object.thresholdPublicKey = options.bytes === String ? $util.base64.encode(message.thresholdPublicKey, 0, message.thresholdPublicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.thresholdPublicKey) : message.thresholdPublicKey; + return object; + }; + + /** + * Converts this ValidatorSetV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + * @returns {Object.} JSON object + */ + ValidatorSetV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSetV0; + })(); + + GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IGetCurrentQuorumsInfoResponseV0 + * @property {Array.|null} [quorumHashes] GetCurrentQuorumsInfoResponseV0 quorumHashes + * @property {Uint8Array|null} [currentQuorumHash] GetCurrentQuorumsInfoResponseV0 currentQuorumHash + * @property {Array.|null} [validatorSets] GetCurrentQuorumsInfoResponseV0 validatorSets + * @property {Uint8Array|null} [lastBlockProposer] GetCurrentQuorumsInfoResponseV0 lastBlockProposer + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetCurrentQuorumsInfoResponseV0 metadata + */ + + /** + * Constructs a new GetCurrentQuorumsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a GetCurrentQuorumsInfoResponseV0. + * @implements IGetCurrentQuorumsInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoResponseV0(properties) { + this.quorumHashes = []; + this.validatorSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoResponseV0 quorumHashes. + * @member {Array.} quorumHashes + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.quorumHashes = $util.emptyArray; + + /** + * GetCurrentQuorumsInfoResponseV0 currentQuorumHash. + * @member {Uint8Array} currentQuorumHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.currentQuorumHash = $util.newBuffer([]); + + /** + * GetCurrentQuorumsInfoResponseV0 validatorSets. + * @member {Array.} validatorSets + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.validatorSets = $util.emptyArray; + + /** + * GetCurrentQuorumsInfoResponseV0 lastBlockProposer. + * @member {Uint8Array} lastBlockProposer + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.lastBlockProposer = $util.newBuffer([]); + + /** + * GetCurrentQuorumsInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.metadata = null; + + /** + * Creates a new GetCurrentQuorumsInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 instance + */ + GetCurrentQuorumsInfoResponseV0.create = function create(properties) { + return new GetCurrentQuorumsInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumHashes != null && message.quorumHashes.length) + for (var i = 0; i < message.quorumHashes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHashes[i]); + if (message.currentQuorumHash != null && Object.hasOwnProperty.call(message, "currentQuorumHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.currentQuorumHash); + if (message.validatorSets != null && message.validatorSets.length) + for (var i = 0; i < message.validatorSets.length; ++i) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.encode(message.validatorSets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastBlockProposer != null && Object.hasOwnProperty.call(message, "lastBlockProposer")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.lastBlockProposer); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quorumHashes && message.quorumHashes.length)) + message.quorumHashes = []; + message.quorumHashes.push(reader.bytes()); + break; + case 2: + message.currentQuorumHash = reader.bytes(); + break; + case 3: + if (!(message.validatorSets && message.validatorSets.length)) + message.validatorSets = []; + message.validatorSets.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.decode(reader, reader.uint32())); + break; + case 4: + message.lastBlockProposer = reader.bytes(); + break; + case 5: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumHashes != null && message.hasOwnProperty("quorumHashes")) { + if (!Array.isArray(message.quorumHashes)) + return "quorumHashes: array expected"; + for (var i = 0; i < message.quorumHashes.length; ++i) + if (!(message.quorumHashes[i] && typeof message.quorumHashes[i].length === "number" || $util.isString(message.quorumHashes[i]))) + return "quorumHashes: buffer[] expected"; + } + if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) + if (!(message.currentQuorumHash && typeof message.currentQuorumHash.length === "number" || $util.isString(message.currentQuorumHash))) + return "currentQuorumHash: buffer expected"; + if (message.validatorSets != null && message.hasOwnProperty("validatorSets")) { + if (!Array.isArray(message.validatorSets)) + return "validatorSets: array expected"; + for (var i = 0; i < message.validatorSets.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify(message.validatorSets[i]); + if (error) + return "validatorSets." + error; + } + } + if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) + if (!(message.lastBlockProposer && typeof message.lastBlockProposer.length === "number" || $util.isString(message.lastBlockProposer))) + return "lastBlockProposer: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + */ + GetCurrentQuorumsInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); + if (object.quorumHashes) { + if (!Array.isArray(object.quorumHashes)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.quorumHashes: array expected"); + message.quorumHashes = []; + for (var i = 0; i < object.quorumHashes.length; ++i) + if (typeof object.quorumHashes[i] === "string") + $util.base64.decode(object.quorumHashes[i], message.quorumHashes[i] = $util.newBuffer($util.base64.length(object.quorumHashes[i])), 0); + else if (object.quorumHashes[i].length >= 0) + message.quorumHashes[i] = object.quorumHashes[i]; + } + if (object.currentQuorumHash != null) + if (typeof object.currentQuorumHash === "string") + $util.base64.decode(object.currentQuorumHash, message.currentQuorumHash = $util.newBuffer($util.base64.length(object.currentQuorumHash)), 0); + else if (object.currentQuorumHash.length >= 0) + message.currentQuorumHash = object.currentQuorumHash; + if (object.validatorSets) { + if (!Array.isArray(object.validatorSets)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: array expected"); + message.validatorSets = []; + for (var i = 0; i < object.validatorSets.length; ++i) { + if (typeof object.validatorSets[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: object expected"); + message.validatorSets[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.fromObject(object.validatorSets[i]); + } + } + if (object.lastBlockProposer != null) + if (typeof object.lastBlockProposer === "string") + $util.base64.decode(object.lastBlockProposer, message.lastBlockProposer = $util.newBuffer($util.base64.length(object.lastBlockProposer)), 0); + else if (object.lastBlockProposer.length >= 0) + message.lastBlockProposer = object.lastBlockProposer; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quorumHashes = []; + object.validatorSets = []; + } + if (options.defaults) { + if (options.bytes === String) + object.currentQuorumHash = ""; + else { + object.currentQuorumHash = []; + if (options.bytes !== Array) + object.currentQuorumHash = $util.newBuffer(object.currentQuorumHash); + } + if (options.bytes === String) + object.lastBlockProposer = ""; + else { + object.lastBlockProposer = []; + if (options.bytes !== Array) + object.lastBlockProposer = $util.newBuffer(object.lastBlockProposer); + } + object.metadata = null; + } + if (message.quorumHashes && message.quorumHashes.length) { + object.quorumHashes = []; + for (var j = 0; j < message.quorumHashes.length; ++j) + object.quorumHashes[j] = options.bytes === String ? $util.base64.encode(message.quorumHashes[j], 0, message.quorumHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHashes[j]) : message.quorumHashes[j]; + } + if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) + object.currentQuorumHash = options.bytes === String ? $util.base64.encode(message.currentQuorumHash, 0, message.currentQuorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.currentQuorumHash) : message.currentQuorumHash; + if (message.validatorSets && message.validatorSets.length) { + object.validatorSets = []; + for (var j = 0; j < message.validatorSets.length; ++j) + object.validatorSets[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject(message.validatorSets[j], options); + } + if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) + object.lastBlockProposer = options.bytes === String ? $util.base64.encode(message.lastBlockProposer, 0, message.lastBlockProposer.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockProposer) : message.lastBlockProposer; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCurrentQuorumsInfoResponseV0; + })(); + + return GetCurrentQuorumsInfoResponse; + })(); + + v0.GetIdentityTokenBalancesRequest = (function() { + + /** + * Properties of a GetIdentityTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null} [v0] GetIdentityTokenBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentityTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenBalancesRequest. + * @implements IGetIdentityTokenBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set + */ + function GetIdentityTokenBalancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + */ + GetIdentityTokenBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest instance + */ + GetIdentityTokenBalancesRequest.create = function create(properties) { + return new GetIdentityTokenBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + */ + GetIdentityTokenBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentityTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @interface IGetIdentityTokenBalancesRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityTokenBalancesRequestV0 identityId + * @property {Array.|null} [tokenIds] GetIdentityTokenBalancesRequestV0 tokenIds + * @property {boolean|null} [prove] GetIdentityTokenBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentityTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @classdesc Represents a GetIdentityTokenBalancesRequestV0. + * @implements IGetIdentityTokenBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentityTokenBalancesRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenBalancesRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityTokenBalancesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetIdentityTokenBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityTokenBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 instance + */ + GetIdentityTokenBalancesRequestV0.create = function create(properties) { + return new GetIdentityTokenBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + */ + GetIdentityTokenBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityTokenBalancesRequestV0; + })(); + + return GetIdentityTokenBalancesRequest; + })(); + + v0.GetIdentityTokenBalancesResponse = (function() { + + /** + * Properties of a GetIdentityTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null} [v0] GetIdentityTokenBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentityTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenBalancesResponse. + * @implements IGetIdentityTokenBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set + */ + function GetIdentityTokenBalancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + */ + GetIdentityTokenBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse instance + */ + GetIdentityTokenBalancesResponse.create = function create(properties) { + return new GetIdentityTokenBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + */ + GetIdentityTokenBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentityTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @interface IGetIdentityTokenBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null} [tokenBalances] GetIdentityTokenBalancesResponseV0 tokenBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @classdesc Represents a GetIdentityTokenBalancesResponseV0. + * @implements IGetIdentityTokenBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentityTokenBalancesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenBalancesResponseV0 tokenBalances. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null|undefined} tokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.tokenBalances = null; + + /** + * GetIdentityTokenBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentityTokenBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesResponseV0 result. + * @member {"tokenBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 instance + */ + GetIdentityTokenBalancesResponseV0.create = function create(properties) { + return new GetIdentityTokenBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenBalances != null && Object.hasOwnProperty.call(message, "tokenBalances")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.encode(message.tokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify(message.tokenBalances); + if (error) + return "tokenBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + */ + GetIdentityTokenBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); + if (object.tokenBalances != null) { + if (typeof object.tokenBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.tokenBalances: object expected"); + message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.fromObject(object.tokenBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + object.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.toObject(message.tokenBalances, options); + if (options.oneofs) + object.result = "tokenBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesResponseV0.TokenBalanceEntry = (function() { + + /** + * Properties of a TokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @interface ITokenBalanceEntry + * @property {Uint8Array|null} [tokenId] TokenBalanceEntry tokenId + * @property {number|Long|null} [balance] TokenBalanceEntry balance + */ + + /** + * Constructs a new TokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @classdesc Represents a TokenBalanceEntry. + * @implements ITokenBalanceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set + */ + function TokenBalanceEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenBalanceEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + */ + TokenBalanceEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenBalanceEntry balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + */ + TokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenBalanceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry instance + */ + TokenBalanceEntry.create = function create(properties) { + return new TokenBalanceEntry(properties); + }; + + /** + * Encodes the specified TokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalanceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified TokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenBalanceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalanceEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenBalanceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenBalanceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenBalanceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenBalanceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + */ + TokenBalanceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a TokenBalanceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} message TokenBalanceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenBalanceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this TokenBalanceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + * @returns {Object.} JSON object + */ + TokenBalanceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenBalanceEntry; + })(); + + GetIdentityTokenBalancesResponseV0.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] TokenBalances tokenBalances + */ + + /** + * Constructs a new TokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @classdesc Represents a TokenBalances. + * @implements ITokenBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set + */ + function TokenBalances(properties) { + this.tokenBalances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenBalances tokenBalances. + * @member {Array.} tokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenBalances != null && message.tokenBalances.length) + for (var i = 0; i < message.tokenBalances.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.encode(message.tokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenBalances && message.tokenBalances.length)) + message.tokenBalances = []; + message.tokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + if (!Array.isArray(message.tokenBalances)) + return "tokenBalances: array expected"; + for (var i = 0; i < message.tokenBalances.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify(message.tokenBalances[i]); + if (error) + return "tokenBalances." + error; + } + } + return null; + }; + + /** + * Creates a TokenBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + */ + TokenBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); + if (object.tokenBalances) { + if (!Array.isArray(object.tokenBalances)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: array expected"); + message.tokenBalances = []; + for (var i = 0; i < object.tokenBalances.length; ++i) { + if (typeof object.tokenBalances[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: object expected"); + message.tokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.fromObject(object.tokenBalances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} message TokenBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenBalances = []; + if (message.tokenBalances && message.tokenBalances.length) { + object.tokenBalances = []; + for (var j = 0; j < message.tokenBalances.length; ++j) + object.tokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.toObject(message.tokenBalances[j], options); + } + return object; + }; + + /** + * Converts this TokenBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @instance + * @returns {Object.} JSON object + */ + TokenBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenBalances; + })(); + + return GetIdentityTokenBalancesResponseV0; + })(); + + return GetIdentityTokenBalancesResponse; + })(); + + v0.GetIdentitiesTokenBalancesRequest = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null} [v0] GetIdentitiesTokenBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenBalancesRequest. + * @implements IGetIdentitiesTokenBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + */ + GetIdentitiesTokenBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest instance + */ + GetIdentitiesTokenBalancesRequest.create = function create(properties) { + return new GetIdentitiesTokenBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + */ + GetIdentitiesTokenBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @interface IGetIdentitiesTokenBalancesRequestV0 + * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenBalancesRequestV0 tokenId + * @property {Array.|null} [identityIds] GetIdentitiesTokenBalancesRequestV0 identityIds + * @property {boolean|null} [prove] GetIdentitiesTokenBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @classdesc Represents a GetIdentitiesTokenBalancesRequestV0. + * @implements IGetIdentitiesTokenBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesRequestV0(properties) { + this.identityIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenBalancesRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetIdentitiesTokenBalancesRequestV0 identityIds. + * @member {Array.} identityIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.identityIds = $util.emptyArray; + + /** + * GetIdentitiesTokenBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesTokenBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 instance + */ + GetIdentitiesTokenBalancesRequestV0.create = function create(properties) { + return new GetIdentitiesTokenBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.identityIds != null && message.identityIds.length) + for (var i = 0; i < message.identityIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + if (!(message.identityIds && message.identityIds.length)) + message.identityIds = []; + message.identityIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.identityIds != null && message.hasOwnProperty("identityIds")) { + if (!Array.isArray(message.identityIds)) + return "identityIds: array expected"; + for (var i = 0; i < message.identityIds.length; ++i) + if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) + return "identityIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + */ + GetIdentitiesTokenBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.identityIds) { + if (!Array.isArray(object.identityIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.identityIds: array expected"); + message.identityIds = []; + for (var i = 0; i < object.identityIds.length; ++i) + if (typeof object.identityIds[i] === "string") + $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); + else if (object.identityIds[i].length >= 0) + message.identityIds[i] = object.identityIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityIds = []; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.identityIds && message.identityIds.length) { + object.identityIds = []; + for (var j = 0; j < message.identityIds.length; ++j) + object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesTokenBalancesRequestV0; + })(); + + return GetIdentitiesTokenBalancesRequest; + })(); + + v0.GetIdentitiesTokenBalancesResponse = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null} [v0] GetIdentitiesTokenBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenBalancesResponse. + * @implements IGetIdentitiesTokenBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + */ + GetIdentitiesTokenBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse instance + */ + GetIdentitiesTokenBalancesResponse.create = function create(properties) { + return new GetIdentitiesTokenBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + */ + GetIdentitiesTokenBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @interface IGetIdentitiesTokenBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null} [identityTokenBalances] GetIdentitiesTokenBalancesResponseV0 identityTokenBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @classdesc Represents a GetIdentitiesTokenBalancesResponseV0. + * @implements IGetIdentitiesTokenBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenBalancesResponseV0 identityTokenBalances. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null|undefined} identityTokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.identityTokenBalances = null; + + /** + * GetIdentitiesTokenBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentitiesTokenBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesResponseV0 result. + * @member {"identityTokenBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityTokenBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 instance + */ + GetIdentitiesTokenBalancesResponseV0.create = function create(properties) { + return new GetIdentitiesTokenBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenBalances != null && Object.hasOwnProperty.call(message, "identityTokenBalances")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.encode(message.identityTokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify(message.identityTokenBalances); + if (error) + return "identityTokenBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + */ + GetIdentitiesTokenBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); + if (object.identityTokenBalances != null) { + if (typeof object.identityTokenBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.identityTokenBalances: object expected"); + message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.fromObject(object.identityTokenBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + object.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.toObject(message.identityTokenBalances, options); + if (options.oneofs) + object.result = "identityTokenBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry = (function() { + + /** + * Properties of an IdentityTokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @interface IIdentityTokenBalanceEntry + * @property {Uint8Array|null} [identityId] IdentityTokenBalanceEntry identityId + * @property {number|Long|null} [balance] IdentityTokenBalanceEntry balance + */ + + /** + * Constructs a new IdentityTokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @classdesc Represents an IdentityTokenBalanceEntry. + * @implements IIdentityTokenBalanceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set + */ + function IdentityTokenBalanceEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityTokenBalanceEntry identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + */ + IdentityTokenBalanceEntry.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityTokenBalanceEntry balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + */ + IdentityTokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new IdentityTokenBalanceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry instance + */ + IdentityTokenBalanceEntry.create = function create(properties) { + return new IdentityTokenBalanceEntry(properties); + }; + + /** + * Encodes the specified IdentityTokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalanceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified IdentityTokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalanceEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenBalanceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenBalanceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates an IdentityTokenBalanceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + */ + IdentityTokenBalanceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an IdentityTokenBalanceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} message IdentityTokenBalanceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenBalanceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this IdentityTokenBalanceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenBalanceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenBalanceEntry; + })(); + + GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances = (function() { + + /** + * Properties of an IdentityTokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @interface IIdentityTokenBalances + * @property {Array.|null} [identityTokenBalances] IdentityTokenBalances identityTokenBalances + */ + + /** + * Constructs a new IdentityTokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @classdesc Represents an IdentityTokenBalances. + * @implements IIdentityTokenBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set + */ + function IdentityTokenBalances(properties) { + this.identityTokenBalances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityTokenBalances identityTokenBalances. + * @member {Array.} identityTokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @instance + */ + IdentityTokenBalances.prototype.identityTokenBalances = $util.emptyArray; + + /** + * Creates a new IdentityTokenBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances instance + */ + IdentityTokenBalances.create = function create(properties) { + return new IdentityTokenBalances(properties); + }; + + /** + * Encodes the specified IdentityTokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenBalances != null && message.identityTokenBalances.length) + for (var i = 0; i < message.identityTokenBalances.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.encode(message.identityTokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityTokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalances.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identityTokenBalances && message.identityTokenBalances.length)) + message.identityTokenBalances = []; + message.identityTokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + if (!Array.isArray(message.identityTokenBalances)) + return "identityTokenBalances: array expected"; + for (var i = 0; i < message.identityTokenBalances.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify(message.identityTokenBalances[i]); + if (error) + return "identityTokenBalances." + error; + } + } + return null; + }; + + /** + * Creates an IdentityTokenBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + */ + IdentityTokenBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); + if (object.identityTokenBalances) { + if (!Array.isArray(object.identityTokenBalances)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: array expected"); + message.identityTokenBalances = []; + for (var i = 0; i < object.identityTokenBalances.length; ++i) { + if (typeof object.identityTokenBalances[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: object expected"); + message.identityTokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.fromObject(object.identityTokenBalances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityTokenBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} message IdentityTokenBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityTokenBalances = []; + if (message.identityTokenBalances && message.identityTokenBalances.length) { + object.identityTokenBalances = []; + for (var j = 0; j < message.identityTokenBalances.length; ++j) + object.identityTokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.toObject(message.identityTokenBalances[j], options); + } + return object; + }; + + /** + * Converts this IdentityTokenBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenBalances; + })(); + + return GetIdentitiesTokenBalancesResponseV0; + })(); + + return GetIdentitiesTokenBalancesResponse; + })(); + + v0.GetIdentityTokenInfosRequest = (function() { + + /** + * Properties of a GetIdentityTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenInfosRequest + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null} [v0] GetIdentityTokenInfosRequest v0 + */ + + /** + * Constructs a new GetIdentityTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenInfosRequest. + * @implements IGetIdentityTokenInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set + */ + function GetIdentityTokenInfosRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + */ + GetIdentityTokenInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest instance + */ + GetIdentityTokenInfosRequest.create = function create(properties) { + return new GetIdentityTokenInfosRequest(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + */ + GetIdentityTokenInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 = (function() { + + /** + * Properties of a GetIdentityTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @interface IGetIdentityTokenInfosRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityTokenInfosRequestV0 identityId + * @property {Array.|null} [tokenIds] GetIdentityTokenInfosRequestV0 tokenIds + * @property {boolean|null} [prove] GetIdentityTokenInfosRequestV0 prove + */ + + /** + * Constructs a new GetIdentityTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @classdesc Represents a GetIdentityTokenInfosRequestV0. + * @implements IGetIdentityTokenInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set + */ + function GetIdentityTokenInfosRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenInfosRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityTokenInfosRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetIdentityTokenInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityTokenInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 instance + */ + GetIdentityTokenInfosRequestV0.create = function create(properties) { + return new GetIdentityTokenInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + */ + GetIdentityTokenInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityTokenInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityTokenInfosRequestV0; + })(); + + return GetIdentityTokenInfosRequest; + })(); + + v0.GetIdentityTokenInfosResponse = (function() { + + /** + * Properties of a GetIdentityTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenInfosResponse + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null} [v0] GetIdentityTokenInfosResponse v0 + */ + + /** + * Constructs a new GetIdentityTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenInfosResponse. + * @implements IGetIdentityTokenInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set + */ + function GetIdentityTokenInfosResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + */ + GetIdentityTokenInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse instance + */ + GetIdentityTokenInfosResponse.create = function create(properties) { + return new GetIdentityTokenInfosResponse(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + */ + GetIdentityTokenInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 = (function() { + + /** + * Properties of a GetIdentityTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @interface IGetIdentityTokenInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null} [tokenInfos] GetIdentityTokenInfosResponseV0 tokenInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenInfosResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @classdesc Represents a GetIdentityTokenInfosResponseV0. + * @implements IGetIdentityTokenInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set + */ + function GetIdentityTokenInfosResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenInfosResponseV0 tokenInfos. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null|undefined} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.tokenInfos = null; + + /** + * GetIdentityTokenInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.proof = null; + + /** + * GetIdentityTokenInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosResponseV0 result. + * @member {"tokenInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 instance + */ + GetIdentityTokenInfosResponseV0.create = function create(properties) { + return new GetIdentityTokenInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && Object.hasOwnProperty.call(message, "tokenInfos")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.encode(message.tokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify(message.tokenInfos); + if (error) + return "tokenInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + */ + GetIdentityTokenInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); + if (object.tokenInfos != null) { + if (typeof object.tokenInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.tokenInfos: object expected"); + message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.fromObject(object.tokenInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + object.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.toObject(message.tokenInfos, options); + if (options.oneofs) + object.result = "tokenInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityTokenInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { + + /** + * Properties of a TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenIdentityInfoEntry + * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen + */ + + /** + * Constructs a new TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenIdentityInfoEntry. + * @implements ITokenIdentityInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + */ + function TokenIdentityInfoEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenIdentityInfoEntry frozen. + * @member {boolean} frozen + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + */ + TokenIdentityInfoEntry.prototype.frozen = false; + + /** + * Creates a new TokenIdentityInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance + */ + TokenIdentityInfoEntry.create = function create(properties) { + return new TokenIdentityInfoEntry(properties); + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); + return writer; + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozen = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenIdentityInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenIdentityInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozen != null && message.hasOwnProperty("frozen")) + if (typeof message.frozen !== "boolean") + return "frozen: boolean expected"; + return null; + }; + + /** + * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + */ + TokenIdentityInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); + if (object.frozen != null) + message.frozen = Boolean(object.frozen); + return message; + }; + + /** + * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenIdentityInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frozen = false; + if (message.frozen != null && message.hasOwnProperty("frozen")) + object.frozen = message.frozen; + return object; + }; + + /** + * Converts this TokenIdentityInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenIdentityInfoEntry; + })(); + + GetIdentityTokenInfosResponseV0.TokenInfoEntry = (function() { + + /** + * Properties of a TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenInfoEntry + * @property {Uint8Array|null} [tokenId] TokenInfoEntry tokenId + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info + */ + + /** + * Constructs a new TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenInfoEntry. + * @implements ITokenInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + */ + function TokenInfoEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenInfoEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenInfoEntry info. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.info = null; + + /** + * Creates a new TokenInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance + */ + TokenInfoEntry.create = function create(properties) { + return new TokenInfoEntry(properties); + }; + + /** + * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); + if (error) + return "info." + error; + } + return null; + }; + + /** + * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + */ + TokenInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.info: object expected"); + message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); + } + return message; + }; + + /** + * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.info = null; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); + return object; + }; + + /** + * Converts this TokenInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfoEntry; + })(); + + GetIdentityTokenInfosResponseV0.TokenInfos = (function() { + + /** + * Properties of a TokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenInfos + * @property {Array.|null} [tokenInfos] TokenInfos tokenInfos + */ + + /** + * Constructs a new TokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenInfos. + * @implements ITokenInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set + */ + function TokenInfos(properties) { + this.tokenInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenInfos tokenInfos. + * @member {Array.} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @instance + */ + TokenInfos.prototype.tokenInfos = $util.emptyArray; + + /** + * Creates a new TokenInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos instance + */ + TokenInfos.create = function create(properties) { + return new TokenInfos(properties); + }; + + /** + * Encodes the specified TokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && message.tokenInfos.length) + for (var i = 0; i < message.tokenInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfos.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenInfos && message.tokenInfos.length)) + message.tokenInfos = []; + message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + if (!Array.isArray(message.tokenInfos)) + return "tokenInfos: array expected"; + for (var i = 0; i < message.tokenInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); + if (error) + return "tokenInfos." + error; + } + } + return null; + }; + + /** + * Creates a TokenInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + */ + TokenInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); + if (object.tokenInfos) { + if (!Array.isArray(object.tokenInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: array expected"); + message.tokenInfos = []; + for (var i = 0; i < object.tokenInfos.length; ++i) { + if (typeof object.tokenInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: object expected"); + message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} message TokenInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenInfos = []; + if (message.tokenInfos && message.tokenInfos.length) { + object.tokenInfos = []; + for (var j = 0; j < message.tokenInfos.length; ++j) + object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); + } + return object; + }; + + /** + * Converts this TokenInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @instance + * @returns {Object.} JSON object + */ + TokenInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfos; + })(); + + return GetIdentityTokenInfosResponseV0; + })(); + + return GetIdentityTokenInfosResponse; + })(); + + v0.GetIdentitiesTokenInfosRequest = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenInfosRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null} [v0] GetIdentitiesTokenInfosRequest v0 + */ + + /** + * Constructs a new GetIdentitiesTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenInfosRequest. + * @implements IGetIdentitiesTokenInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + */ + GetIdentitiesTokenInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest instance + */ + GetIdentitiesTokenInfosRequest.create = function create(properties) { + return new GetIdentitiesTokenInfosRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + */ + GetIdentitiesTokenInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @interface IGetIdentitiesTokenInfosRequestV0 + * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenInfosRequestV0 tokenId + * @property {Array.|null} [identityIds] GetIdentitiesTokenInfosRequestV0 identityIds + * @property {boolean|null} [prove] GetIdentitiesTokenInfosRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @classdesc Represents a GetIdentitiesTokenInfosRequestV0. + * @implements IGetIdentitiesTokenInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosRequestV0(properties) { + this.identityIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenInfosRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetIdentitiesTokenInfosRequestV0 identityIds. + * @member {Array.} identityIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.identityIds = $util.emptyArray; + + /** + * GetIdentitiesTokenInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesTokenInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 instance + */ + GetIdentitiesTokenInfosRequestV0.create = function create(properties) { + return new GetIdentitiesTokenInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.identityIds != null && message.identityIds.length) + for (var i = 0; i < message.identityIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + if (!(message.identityIds && message.identityIds.length)) + message.identityIds = []; + message.identityIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.identityIds != null && message.hasOwnProperty("identityIds")) { + if (!Array.isArray(message.identityIds)) + return "identityIds: array expected"; + for (var i = 0; i < message.identityIds.length; ++i) + if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) + return "identityIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + */ + GetIdentitiesTokenInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.identityIds) { + if (!Array.isArray(object.identityIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.identityIds: array expected"); + message.identityIds = []; + for (var i = 0; i < object.identityIds.length; ++i) + if (typeof object.identityIds[i] === "string") + $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); + else if (object.identityIds[i].length >= 0) + message.identityIds[i] = object.identityIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityIds = []; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.identityIds && message.identityIds.length) { + object.identityIds = []; + for (var j = 0; j < message.identityIds.length; ++j) + object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesTokenInfosRequestV0; + })(); + + return GetIdentitiesTokenInfosRequest; + })(); + + v0.GetIdentitiesTokenInfosResponse = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenInfosResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null} [v0] GetIdentitiesTokenInfosResponse v0 + */ + + /** + * Constructs a new GetIdentitiesTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenInfosResponse. + * @implements IGetIdentitiesTokenInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + */ + GetIdentitiesTokenInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse instance + */ + GetIdentitiesTokenInfosResponse.create = function create(properties) { + return new GetIdentitiesTokenInfosResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + */ + GetIdentitiesTokenInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @interface IGetIdentitiesTokenInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null} [identityTokenInfos] GetIdentitiesTokenInfosResponseV0 identityTokenInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenInfosResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @classdesc Represents a GetIdentitiesTokenInfosResponseV0. + * @implements IGetIdentitiesTokenInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenInfosResponseV0 identityTokenInfos. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null|undefined} identityTokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.identityTokenInfos = null; + + /** + * GetIdentitiesTokenInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.proof = null; + + /** + * GetIdentitiesTokenInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosResponseV0 result. + * @member {"identityTokenInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityTokenInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 instance + */ + GetIdentitiesTokenInfosResponseV0.create = function create(properties) { + return new GetIdentitiesTokenInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenInfos != null && Object.hasOwnProperty.call(message, "identityTokenInfos")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.encode(message.identityTokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify(message.identityTokenInfos); + if (error) + return "identityTokenInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + */ + GetIdentitiesTokenInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); + if (object.identityTokenInfos != null) { + if (typeof object.identityTokenInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.identityTokenInfos: object expected"); + message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.fromObject(object.identityTokenInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { + object.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.toObject(message.identityTokenInfos, options); + if (options.oneofs) + object.result = "identityTokenInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { + + /** + * Properties of a TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface ITokenIdentityInfoEntry + * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen + */ + + /** + * Constructs a new TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents a TokenIdentityInfoEntry. + * @implements ITokenIdentityInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + */ + function TokenIdentityInfoEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenIdentityInfoEntry frozen. + * @member {boolean} frozen + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + */ + TokenIdentityInfoEntry.prototype.frozen = false; + + /** + * Creates a new TokenIdentityInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance + */ + TokenIdentityInfoEntry.create = function create(properties) { + return new TokenIdentityInfoEntry(properties); + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); + return writer; + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozen = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenIdentityInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenIdentityInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozen != null && message.hasOwnProperty("frozen")) + if (typeof message.frozen !== "boolean") + return "frozen: boolean expected"; + return null; + }; + + /** + * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + */ + TokenIdentityInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); + if (object.frozen != null) + message.frozen = Boolean(object.frozen); + return message; + }; + + /** + * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenIdentityInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frozen = false; + if (message.frozen != null && message.hasOwnProperty("frozen")) + object.frozen = message.frozen; + return object; + }; + + /** + * Converts this TokenIdentityInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenIdentityInfoEntry; + })(); + + GetIdentitiesTokenInfosResponseV0.TokenInfoEntry = (function() { + + /** + * Properties of a TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface ITokenInfoEntry + * @property {Uint8Array|null} [identityId] TokenInfoEntry identityId + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info + */ + + /** + * Constructs a new TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents a TokenInfoEntry. + * @implements ITokenInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + */ + function TokenInfoEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenInfoEntry identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.identityId = $util.newBuffer([]); + + /** + * TokenInfoEntry info. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.info = null; + + /** + * Creates a new TokenInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance + */ + TokenInfoEntry.create = function create(properties) { + return new TokenInfoEntry(properties); + }; + + /** + * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); + if (error) + return "info." + error; + } + return null; + }; + + /** + * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + */ + TokenInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.info: object expected"); + message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); + } + return message; + }; + + /** + * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.info = null; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); + return object; + }; + + /** + * Converts this TokenInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfoEntry; + })(); + + GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos = (function() { + + /** + * Properties of an IdentityTokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface IIdentityTokenInfos + * @property {Array.|null} [tokenInfos] IdentityTokenInfos tokenInfos + */ + + /** + * Constructs a new IdentityTokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents an IdentityTokenInfos. + * @implements IIdentityTokenInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set + */ + function IdentityTokenInfos(properties) { + this.tokenInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityTokenInfos tokenInfos. + * @member {Array.} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @instance + */ + IdentityTokenInfos.prototype.tokenInfos = $util.emptyArray; + + /** + * Creates a new IdentityTokenInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos instance + */ + IdentityTokenInfos.create = function create(properties) { + return new IdentityTokenInfos(properties); + }; + + /** + * Encodes the specified IdentityTokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && message.tokenInfos.length) + for (var i = 0; i < message.tokenInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityTokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenInfos.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenInfos && message.tokenInfos.length)) + message.tokenInfos = []; + message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + if (!Array.isArray(message.tokenInfos)) + return "tokenInfos: array expected"; + for (var i = 0; i < message.tokenInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); + if (error) + return "tokenInfos." + error; + } + } + return null; + }; + + /** + * Creates an IdentityTokenInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + */ + IdentityTokenInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); + if (object.tokenInfos) { + if (!Array.isArray(object.tokenInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: array expected"); + message.tokenInfos = []; + for (var i = 0; i < object.tokenInfos.length; ++i) { + if (typeof object.tokenInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: object expected"); + message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityTokenInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} message IdentityTokenInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenInfos = []; + if (message.tokenInfos && message.tokenInfos.length) { + object.tokenInfos = []; + for (var j = 0; j < message.tokenInfos.length; ++j) + object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); + } + return object; + }; + + /** + * Converts this IdentityTokenInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenInfos; + })(); + + return GetIdentitiesTokenInfosResponseV0; + })(); + + return GetIdentitiesTokenInfosResponse; + })(); + + v0.GetTokenStatusesRequest = (function() { + + /** + * Properties of a GetTokenStatusesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenStatusesRequest + * @property {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null} [v0] GetTokenStatusesRequest v0 + */ + + /** + * Constructs a new GetTokenStatusesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenStatusesRequest. + * @implements IGetTokenStatusesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set + */ + function GetTokenStatusesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenStatusesRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + */ + GetTokenStatusesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + */ + Object.defineProperty(GetTokenStatusesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest instance + */ + GetTokenStatusesRequest.create = function create(properties) { + return new GetTokenStatusesRequest(properties); + }; + + /** + * Encodes the specified GetTokenStatusesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenStatusesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + */ + GetTokenStatusesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest} message GetTokenStatusesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenStatusesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesRequest.GetTokenStatusesRequestV0 = (function() { + + /** + * Properties of a GetTokenStatusesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @interface IGetTokenStatusesRequestV0 + * @property {Array.|null} [tokenIds] GetTokenStatusesRequestV0 tokenIds + * @property {boolean|null} [prove] GetTokenStatusesRequestV0 prove + */ + + /** + * Constructs a new GetTokenStatusesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @classdesc Represents a GetTokenStatusesRequestV0. + * @implements IGetTokenStatusesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set + */ + function GetTokenStatusesRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenStatusesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + */ + GetTokenStatusesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetTokenStatusesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + */ + GetTokenStatusesRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenStatusesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 instance + */ + GetTokenStatusesRequestV0.create = function create(properties) { + return new GetTokenStatusesRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenStatusesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenStatusesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + */ + GetTokenStatusesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) + object.prove = false; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenStatusesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenStatusesRequestV0; + })(); + + return GetTokenStatusesRequest; + })(); + + v0.GetTokenStatusesResponse = (function() { + + /** + * Properties of a GetTokenStatusesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenStatusesResponse + * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null} [v0] GetTokenStatusesResponse v0 + */ + + /** + * Constructs a new GetTokenStatusesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenStatusesResponse. + * @implements IGetTokenStatusesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set + */ + function GetTokenStatusesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenStatusesResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + */ + GetTokenStatusesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + */ + Object.defineProperty(GetTokenStatusesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse instance + */ + GetTokenStatusesResponse.create = function create(properties) { + return new GetTokenStatusesResponse(properties); + }; + + /** + * Encodes the specified GetTokenStatusesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenStatusesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + */ + GetTokenStatusesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} message GetTokenStatusesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenStatusesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesResponse.GetTokenStatusesResponseV0 = (function() { + + /** + * Properties of a GetTokenStatusesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @interface IGetTokenStatusesResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null} [tokenStatuses] GetTokenStatusesResponseV0 tokenStatuses + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenStatusesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenStatusesResponseV0 metadata + */ + + /** + * Constructs a new GetTokenStatusesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @classdesc Represents a GetTokenStatusesResponseV0. + * @implements IGetTokenStatusesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set + */ + function GetTokenStatusesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenStatusesResponseV0 tokenStatuses. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null|undefined} tokenStatuses + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.tokenStatuses = null; + + /** + * GetTokenStatusesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.proof = null; + + /** + * GetTokenStatusesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesResponseV0 result. + * @member {"tokenStatuses"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + Object.defineProperty(GetTokenStatusesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenStatuses", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 instance + */ + GetTokenStatusesResponseV0.create = function create(properties) { + return new GetTokenStatusesResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenStatusesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenStatuses != null && Object.hasOwnProperty.call(message, "tokenStatuses")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.encode(message.tokenStatuses, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify(message.tokenStatuses); + if (error) + return "tokenStatuses." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenStatusesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + */ + GetTokenStatusesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); + if (object.tokenStatuses != null) { + if (typeof object.tokenStatuses !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.tokenStatuses: object expected"); + message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.fromObject(object.tokenStatuses); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + object.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.toObject(message.tokenStatuses, options); + if (options.oneofs) + object.result = "tokenStatuses"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenStatusesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesResponseV0.TokenStatusEntry = (function() { + + /** + * Properties of a TokenStatusEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @interface ITokenStatusEntry + * @property {Uint8Array|null} [tokenId] TokenStatusEntry tokenId + * @property {boolean|null} [paused] TokenStatusEntry paused + */ + + /** + * Constructs a new TokenStatusEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @classdesc Represents a TokenStatusEntry. + * @implements ITokenStatusEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set + */ + function TokenStatusEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenStatusEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + */ + TokenStatusEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenStatusEntry paused. + * @member {boolean} paused + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + */ + TokenStatusEntry.prototype.paused = false; + + /** + * Creates a new TokenStatusEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry instance + */ + TokenStatusEntry.create = function create(properties) { + return new TokenStatusEntry(properties); + }; + + /** + * Encodes the specified TokenStatusEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatusEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.paused != null && Object.hasOwnProperty.call(message, "paused")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.paused); + return writer; + }; + + /** + * Encodes the specified TokenStatusEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatusEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenStatusEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatusEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.paused = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenStatusEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatusEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenStatusEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenStatusEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.paused != null && message.hasOwnProperty("paused")) + if (typeof message.paused !== "boolean") + return "paused: boolean expected"; + return null; + }; + + /** + * Creates a TokenStatusEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + */ + TokenStatusEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.paused != null) + message.paused = Boolean(object.paused); + return message; + }; + + /** + * Creates a plain object from a TokenStatusEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} message TokenStatusEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenStatusEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.paused = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.paused != null && message.hasOwnProperty("paused")) + object.paused = message.paused; + return object; + }; + + /** + * Converts this TokenStatusEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + * @returns {Object.} JSON object + */ + TokenStatusEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenStatusEntry; + })(); + + GetTokenStatusesResponseV0.TokenStatuses = (function() { + + /** + * Properties of a TokenStatuses. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @interface ITokenStatuses + * @property {Array.|null} [tokenStatuses] TokenStatuses tokenStatuses + */ + + /** + * Constructs a new TokenStatuses. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @classdesc Represents a TokenStatuses. + * @implements ITokenStatuses + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set + */ + function TokenStatuses(properties) { + this.tokenStatuses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenStatuses tokenStatuses. + * @member {Array.} tokenStatuses + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @instance + */ + TokenStatuses.prototype.tokenStatuses = $util.emptyArray; + + /** + * Creates a new TokenStatuses instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses instance + */ + TokenStatuses.create = function create(properties) { + return new TokenStatuses(properties); + }; + + /** + * Encodes the specified TokenStatuses message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatuses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenStatuses != null && message.tokenStatuses.length) + for (var i = 0; i < message.tokenStatuses.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.encode(message.tokenStatuses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenStatuses message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatuses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenStatuses message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatuses.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenStatuses && message.tokenStatuses.length)) + message.tokenStatuses = []; + message.tokenStatuses.push($root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenStatuses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatuses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenStatuses message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenStatuses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + if (!Array.isArray(message.tokenStatuses)) + return "tokenStatuses: array expected"; + for (var i = 0; i < message.tokenStatuses.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify(message.tokenStatuses[i]); + if (error) + return "tokenStatuses." + error; + } + } + return null; + }; + + /** + * Creates a TokenStatuses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + */ + TokenStatuses.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); + if (object.tokenStatuses) { + if (!Array.isArray(object.tokenStatuses)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: array expected"); + message.tokenStatuses = []; + for (var i = 0; i < object.tokenStatuses.length; ++i) { + if (typeof object.tokenStatuses[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: object expected"); + message.tokenStatuses[i] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.fromObject(object.tokenStatuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenStatuses message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} message TokenStatuses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenStatuses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenStatuses = []; + if (message.tokenStatuses && message.tokenStatuses.length) { + object.tokenStatuses = []; + for (var j = 0; j < message.tokenStatuses.length; ++j) + object.tokenStatuses[j] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.toObject(message.tokenStatuses[j], options); + } + return object; + }; + + /** + * Converts this TokenStatuses to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @instance + * @returns {Object.} JSON object + */ + TokenStatuses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenStatuses; + })(); + + return GetTokenStatusesResponseV0; + })(); + + return GetTokenStatusesResponse; + })(); + + v0.GetTokenDirectPurchasePricesResponse = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenDirectPurchasePricesResponse + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null} [v0] GetTokenDirectPurchasePricesResponse v0 + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenDirectPurchasePricesResponse. + * @implements IGetTokenDirectPurchasePricesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + */ + GetTokenDirectPurchasePricesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse instance + */ + GetTokenDirectPurchasePricesResponse.create = function create(properties) { + return new GetTokenDirectPurchasePricesResponse(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + */ + GetTokenDirectPurchasePricesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @interface IGetTokenDirectPurchasePricesResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null} [tokenDirectPurchasePrices] GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenDirectPurchasePricesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenDirectPurchasePricesResponseV0 metadata + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @classdesc Represents a GetTokenDirectPurchasePricesResponseV0. + * @implements IGetTokenDirectPurchasePricesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null|undefined} tokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.tokenDirectPurchasePrices = null; + + /** + * GetTokenDirectPurchasePricesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.proof = null; + + /** + * GetTokenDirectPurchasePricesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesResponseV0 result. + * @member {"tokenDirectPurchasePrices"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenDirectPurchasePrices", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 instance + */ + GetTokenDirectPurchasePricesResponseV0.create = function create(properties) { + return new GetTokenDirectPurchasePricesResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDirectPurchasePrices != null && Object.hasOwnProperty.call(message, "tokenDirectPurchasePrices")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.encode(message.tokenDirectPurchasePrices, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify(message.tokenDirectPurchasePrices); + if (error) + return "tokenDirectPurchasePrices." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + */ + GetTokenDirectPurchasePricesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); + if (object.tokenDirectPurchasePrices != null) { + if (typeof object.tokenDirectPurchasePrices !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.tokenDirectPurchasePrices: object expected"); + message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.fromObject(object.tokenDirectPurchasePrices); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { + object.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(message.tokenDirectPurchasePrices, options); + if (options.oneofs) + object.result = "tokenDirectPurchasePrices"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = (function() { + + /** + * Properties of a PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface IPriceForQuantity + * @property {number|Long|null} [quantity] PriceForQuantity quantity + * @property {number|Long|null} [price] PriceForQuantity price + */ + + /** + * Constructs a new PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a PriceForQuantity. + * @implements IPriceForQuantity + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set + */ + function PriceForQuantity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceForQuantity quantity. + * @member {number|Long} quantity + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PriceForQuantity price. + * @member {number|Long} price + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PriceForQuantity instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity instance + */ + PriceForQuantity.create = function create(properties) { + return new PriceForQuantity(properties); + }; + + /** + * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); + return writer; + }; + + /** + * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.uint64(); + break; + case 2: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceForQuantity message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceForQuantity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.price != null && message.hasOwnProperty("price")) + if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) + return "price: integer|Long expected"; + return null; + }; + + /** + * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + */ + PriceForQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + if (object.price != null) + if ($util.Long) + (message.price = $util.Long.fromValue(object.price)).unsigned = true; + else if (typeof object.price === "string") + message.price = parseInt(object.price, 10); + else if (typeof object.price === "number") + message.price = object.price; + else if (typeof object.price === "object") + message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} message PriceForQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceForQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.quantity = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.price = options.longs === String ? "0" : 0; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (message.price != null && message.hasOwnProperty("price")) + if (typeof message.price === "number") + object.price = options.longs === String ? String(message.price) : message.price; + else + object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; + return object; + }; + + /** + * Converts this PriceForQuantity to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + * @returns {Object.} JSON object + */ + PriceForQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceForQuantity; + })(); + + GetTokenDirectPurchasePricesResponseV0.PricingSchedule = (function() { + + /** + * Properties of a PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface IPricingSchedule + * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity + */ + + /** + * Constructs a new PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a PricingSchedule. + * @implements IPricingSchedule + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set + */ + function PricingSchedule(properties) { + this.priceForQuantity = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PricingSchedule priceForQuantity. + * @member {Array.} priceForQuantity + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @instance + */ + PricingSchedule.prototype.priceForQuantity = $util.emptyArray; + + /** + * Creates a new PricingSchedule instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule instance + */ + PricingSchedule.create = function create(properties) { + return new PricingSchedule(properties); + }; + + /** + * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priceForQuantity != null && message.priceForQuantity.length) + for (var i = 0; i < message.priceForQuantity.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.priceForQuantity && message.priceForQuantity.length)) + message.priceForQuantity = []; + message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PricingSchedule message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PricingSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { + if (!Array.isArray(message.priceForQuantity)) + return "priceForQuantity: array expected"; + for (var i = 0; i < message.priceForQuantity.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify(message.priceForQuantity[i]); + if (error) + return "priceForQuantity." + error; + } + } + return null; + }; + + /** + * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + */ + PricingSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); + if (object.priceForQuantity) { + if (!Array.isArray(object.priceForQuantity)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: array expected"); + message.priceForQuantity = []; + for (var i = 0; i < object.priceForQuantity.length; ++i) { + if (typeof object.priceForQuantity[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: object expected"); + message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.fromObject(object.priceForQuantity[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} message PricingSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PricingSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.priceForQuantity = []; + if (message.priceForQuantity && message.priceForQuantity.length) { + object.priceForQuantity = []; + for (var j = 0; j < message.priceForQuantity.length; ++j) + object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject(message.priceForQuantity[j], options); + } + return object; + }; + + /** + * Converts this PricingSchedule to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @instance + * @returns {Object.} JSON object + */ + PricingSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PricingSchedule; + })(); + + GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = (function() { + + /** + * Properties of a TokenDirectPurchasePriceEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface ITokenDirectPurchasePriceEntry + * @property {Uint8Array|null} [tokenId] TokenDirectPurchasePriceEntry tokenId + * @property {number|Long|null} [fixedPrice] TokenDirectPurchasePriceEntry fixedPrice + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null} [variablePrice] TokenDirectPurchasePriceEntry variablePrice + */ + + /** + * Constructs a new TokenDirectPurchasePriceEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a TokenDirectPurchasePriceEntry. + * @implements ITokenDirectPurchasePriceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set + */ + function TokenDirectPurchasePriceEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDirectPurchasePriceEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + TokenDirectPurchasePriceEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenDirectPurchasePriceEntry fixedPrice. + * @member {number|Long} fixedPrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + TokenDirectPurchasePriceEntry.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TokenDirectPurchasePriceEntry variablePrice. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null|undefined} variablePrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + TokenDirectPurchasePriceEntry.prototype.variablePrice = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TokenDirectPurchasePriceEntry price. + * @member {"fixedPrice"|"variablePrice"|undefined} price + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + Object.defineProperty(TokenDirectPurchasePriceEntry.prototype, "price", { + get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TokenDirectPurchasePriceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry instance + */ + TokenDirectPurchasePriceEntry.create = function create(properties) { + return new TokenDirectPurchasePriceEntry(properties); + }; + + /** + * Encodes the specified TokenDirectPurchasePriceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePriceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.fixedPrice); + if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDirectPurchasePriceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePriceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePriceEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.fixedPrice = reader.uint64(); + break; + case 3: + message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePriceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDirectPurchasePriceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDirectPurchasePriceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + properties.price = 1; + if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) + return "fixedPrice: integer|Long expected"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + if (properties.price === 1) + return "price: multiple values"; + properties.price = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify(message.variablePrice); + if (error) + return "variablePrice." + error; + } + } + return null; + }; + + /** + * Creates a TokenDirectPurchasePriceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + */ + TokenDirectPurchasePriceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.fixedPrice != null) + if ($util.Long) + (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; + else if (typeof object.fixedPrice === "string") + message.fixedPrice = parseInt(object.fixedPrice, 10); + else if (typeof object.fixedPrice === "number") + message.fixedPrice = object.fixedPrice; + else if (typeof object.fixedPrice === "object") + message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); + if (object.variablePrice != null) { + if (typeof object.variablePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.variablePrice: object expected"); + message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.fromObject(object.variablePrice); + } + return message; + }; + + /** + * Creates a plain object from a TokenDirectPurchasePriceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDirectPurchasePriceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + if (typeof message.fixedPrice === "number") + object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; + else + object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; + if (options.oneofs) + object.price = "fixedPrice"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + object.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(message.variablePrice, options); + if (options.oneofs) + object.price = "variablePrice"; + } + return object; + }; + + /** + * Converts this TokenDirectPurchasePriceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + * @returns {Object.} JSON object + */ + TokenDirectPurchasePriceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDirectPurchasePriceEntry; + })(); + + GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = (function() { + + /** + * Properties of a TokenDirectPurchasePrices. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface ITokenDirectPurchasePrices + * @property {Array.|null} [tokenDirectPurchasePrice] TokenDirectPurchasePrices tokenDirectPurchasePrice + */ + + /** + * Constructs a new TokenDirectPurchasePrices. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a TokenDirectPurchasePrices. + * @implements ITokenDirectPurchasePrices + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set + */ + function TokenDirectPurchasePrices(properties) { + this.tokenDirectPurchasePrice = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDirectPurchasePrices tokenDirectPurchasePrice. + * @member {Array.} tokenDirectPurchasePrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @instance + */ + TokenDirectPurchasePrices.prototype.tokenDirectPurchasePrice = $util.emptyArray; + + /** + * Creates a new TokenDirectPurchasePrices instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices instance + */ + TokenDirectPurchasePrices.create = function create(properties) { + return new TokenDirectPurchasePrices(properties); + }; + + /** + * Encodes the specified TokenDirectPurchasePrices message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePrices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDirectPurchasePrice != null && message.tokenDirectPurchasePrice.length) + for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.encode(message.tokenDirectPurchasePrice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDirectPurchasePrices message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePrices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePrices.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length)) + message.tokenDirectPurchasePrice = []; + message.tokenDirectPurchasePrice.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePrices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDirectPurchasePrices message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDirectPurchasePrices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenDirectPurchasePrice != null && message.hasOwnProperty("tokenDirectPurchasePrice")) { + if (!Array.isArray(message.tokenDirectPurchasePrice)) + return "tokenDirectPurchasePrice: array expected"; + for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify(message.tokenDirectPurchasePrice[i]); + if (error) + return "tokenDirectPurchasePrice." + error; + } + } + return null; + }; + + /** + * Creates a TokenDirectPurchasePrices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + */ + TokenDirectPurchasePrices.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); + if (object.tokenDirectPurchasePrice) { + if (!Array.isArray(object.tokenDirectPurchasePrice)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: array expected"); + message.tokenDirectPurchasePrice = []; + for (var i = 0; i < object.tokenDirectPurchasePrice.length; ++i) { + if (typeof object.tokenDirectPurchasePrice[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: object expected"); + message.tokenDirectPurchasePrice[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.fromObject(object.tokenDirectPurchasePrice[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenDirectPurchasePrices message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} message TokenDirectPurchasePrices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDirectPurchasePrices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenDirectPurchasePrice = []; + if (message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length) { + object.tokenDirectPurchasePrice = []; + for (var j = 0; j < message.tokenDirectPurchasePrice.length; ++j) + object.tokenDirectPurchasePrice[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject(message.tokenDirectPurchasePrice[j], options); + } + return object; + }; + + /** + * Converts this TokenDirectPurchasePrices to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @instance + * @returns {Object.} JSON object + */ + TokenDirectPurchasePrices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDirectPurchasePrices; + })(); + + return GetTokenDirectPurchasePricesResponseV0; + })(); + + return GetTokenDirectPurchasePricesResponse; + })(); + + v0.GetTokenDirectPurchasePricesRequest = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenDirectPurchasePricesRequest + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null} [v0] GetTokenDirectPurchasePricesRequest v0 + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenDirectPurchasePricesRequest. + * @implements IGetTokenDirectPurchasePricesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + */ + GetTokenDirectPurchasePricesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest instance + */ + GetTokenDirectPurchasePricesRequest.create = function create(properties) { + return new GetTokenDirectPurchasePricesRequest(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + */ + GetTokenDirectPurchasePricesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @interface IGetTokenDirectPurchasePricesRequestV0 + * @property {Array.|null} [tokenIds] GetTokenDirectPurchasePricesRequestV0 tokenIds + * @property {boolean|null} [prove] GetTokenDirectPurchasePricesRequestV0 prove + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @classdesc Represents a GetTokenDirectPurchasePricesRequestV0. + * @implements IGetTokenDirectPurchasePricesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + */ + GetTokenDirectPurchasePricesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetTokenDirectPurchasePricesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + */ + GetTokenDirectPurchasePricesRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenDirectPurchasePricesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 instance + */ + GetTokenDirectPurchasePricesRequestV0.create = function create(properties) { + return new GetTokenDirectPurchasePricesRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + */ + GetTokenDirectPurchasePricesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) + object.prove = false; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenDirectPurchasePricesRequestV0; + })(); + + return GetTokenDirectPurchasePricesRequest; + })(); + + v0.GetTokenPreProgrammedDistributionsRequest = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenPreProgrammedDistributionsRequest + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null} [v0] GetTokenPreProgrammedDistributionsRequest v0 + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenPreProgrammedDistributionsRequest. + * @implements IGetTokenPreProgrammedDistributionsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenPreProgrammedDistributionsRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + */ + GetTokenPreProgrammedDistributionsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest instance + */ + GetTokenPreProgrammedDistributionsRequest.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsRequest(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + */ + GetTokenPreProgrammedDistributionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @interface IGetTokenPreProgrammedDistributionsRequestV0 + * @property {Uint8Array|null} [tokenId] GetTokenPreProgrammedDistributionsRequestV0 tokenId + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null} [startAtInfo] GetTokenPreProgrammedDistributionsRequestV0 startAtInfo + * @property {number|null} [limit] GetTokenPreProgrammedDistributionsRequestV0 limit + * @property {boolean|null} [prove] GetTokenPreProgrammedDistributionsRequestV0 prove + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @classdesc Represents a GetTokenPreProgrammedDistributionsRequestV0. + * @implements IGetTokenPreProgrammedDistributionsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenPreProgrammedDistributionsRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetTokenPreProgrammedDistributionsRequestV0 startAtInfo. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null|undefined} startAtInfo + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.startAtInfo = null; + + /** + * GetTokenPreProgrammedDistributionsRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.limit = 0; + + /** + * GetTokenPreProgrammedDistributionsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenPreProgrammedDistributionsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 instance + */ + GetTokenPreProgrammedDistributionsRequestV0.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.startAtInfo != null && Object.hasOwnProperty.call(message, "startAtInfo")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.encode(message.startAtInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.decode(reader, reader.uint32()); + break; + case 3: + message.limit = reader.uint32(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify(message.startAtInfo); + if (error) + return "startAtInfo." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + */ + GetTokenPreProgrammedDistributionsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.startAtInfo != null) { + if (typeof object.startAtInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.startAtInfo: object expected"); + message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.fromObject(object.startAtInfo); + } + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.startAtInfo = null; + object.limit = 0; + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) + object.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.toObject(message.startAtInfo, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo = (function() { + + /** + * Properties of a StartAtInfo. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @interface IStartAtInfo + * @property {number|Long|null} [startTimeMs] StartAtInfo startTimeMs + * @property {Uint8Array|null} [startRecipient] StartAtInfo startRecipient + * @property {boolean|null} [startRecipientIncluded] StartAtInfo startRecipientIncluded + */ + + /** + * Constructs a new StartAtInfo. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @classdesc Represents a StartAtInfo. + * @implements IStartAtInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set + */ + function StartAtInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtInfo startTimeMs. + * @member {number|Long} startTimeMs + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StartAtInfo startRecipient. + * @member {Uint8Array} startRecipient + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startRecipient = $util.newBuffer([]); + + /** + * StartAtInfo startRecipientIncluded. + * @member {boolean} startRecipientIncluded + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startRecipientIncluded = false; + + /** + * Creates a new StartAtInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo instance + */ + StartAtInfo.create = function create(properties) { + return new StartAtInfo(properties); + }; + + /** + * Encodes the specified StartAtInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); + if (message.startRecipient != null && Object.hasOwnProperty.call(message, "startRecipient")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startRecipient); + if (message.startRecipientIncluded != null && Object.hasOwnProperty.call(message, "startRecipientIncluded")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.startRecipientIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeMs = reader.uint64(); + break; + case 2: + message.startRecipient = reader.bytes(); + break; + case 3: + message.startRecipientIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) + return "startTimeMs: integer|Long expected"; + if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) + if (!(message.startRecipient && typeof message.startRecipient.length === "number" || $util.isString(message.startRecipient))) + return "startRecipient: buffer expected"; + if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) + if (typeof message.startRecipientIncluded !== "boolean") + return "startRecipientIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + */ + StartAtInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); + if (object.startTimeMs != null) + if ($util.Long) + (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; + else if (typeof object.startTimeMs === "string") + message.startTimeMs = parseInt(object.startTimeMs, 10); + else if (typeof object.startTimeMs === "number") + message.startTimeMs = object.startTimeMs; + else if (typeof object.startTimeMs === "object") + message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); + if (object.startRecipient != null) + if (typeof object.startRecipient === "string") + $util.base64.decode(object.startRecipient, message.startRecipient = $util.newBuffer($util.base64.length(object.startRecipient)), 0); + else if (object.startRecipient.length >= 0) + message.startRecipient = object.startRecipient; + if (object.startRecipientIncluded != null) + message.startRecipientIncluded = Boolean(object.startRecipientIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} message StartAtInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTimeMs = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.startRecipient = ""; + else { + object.startRecipient = []; + if (options.bytes !== Array) + object.startRecipient = $util.newBuffer(object.startRecipient); + } + object.startRecipientIncluded = false; + } + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (typeof message.startTimeMs === "number") + object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; + else + object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; + if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) + object.startRecipient = options.bytes === String ? $util.base64.encode(message.startRecipient, 0, message.startRecipient.length) : options.bytes === Array ? Array.prototype.slice.call(message.startRecipient) : message.startRecipient; + if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) + object.startRecipientIncluded = message.startRecipientIncluded; + return object; + }; + + /** + * Converts this StartAtInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtInfo; + })(); + + return GetTokenPreProgrammedDistributionsRequestV0; + })(); + + return GetTokenPreProgrammedDistributionsRequest; + })(); + + v0.GetTokenPreProgrammedDistributionsResponse = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenPreProgrammedDistributionsResponse + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null} [v0] GetTokenPreProgrammedDistributionsResponse v0 + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenPreProgrammedDistributionsResponse. + * @implements IGetTokenPreProgrammedDistributionsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenPreProgrammedDistributionsResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + */ + GetTokenPreProgrammedDistributionsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse instance + */ + GetTokenPreProgrammedDistributionsResponse.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsResponse(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + */ + GetTokenPreProgrammedDistributionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @interface IGetTokenPreProgrammedDistributionsResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null} [tokenDistributions] GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenPreProgrammedDistributionsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenPreProgrammedDistributionsResponseV0 metadata + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @classdesc Represents a GetTokenPreProgrammedDistributionsResponseV0. + * @implements IGetTokenPreProgrammedDistributionsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null|undefined} tokenDistributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.tokenDistributions = null; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.proof = null; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 result. + * @member {"tokenDistributions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenDistributions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 instance + */ + GetTokenPreProgrammedDistributionsResponseV0.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDistributions != null && Object.hasOwnProperty.call(message, "tokenDistributions")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.encode(message.tokenDistributions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify(message.tokenDistributions); + if (error) + return "tokenDistributions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + */ + GetTokenPreProgrammedDistributionsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); + if (object.tokenDistributions != null) { + if (typeof object.tokenDistributions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.tokenDistributions: object expected"); + message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.fromObject(object.tokenDistributions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + object.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.toObject(message.tokenDistributions, options); + if (options.oneofs) + object.result = "tokenDistributions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry = (function() { + + /** + * Properties of a TokenDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenDistributionEntry + * @property {Uint8Array|null} [recipientId] TokenDistributionEntry recipientId + * @property {number|Long|null} [amount] TokenDistributionEntry amount + */ + + /** + * Constructs a new TokenDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenDistributionEntry. + * @implements ITokenDistributionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set + */ + function TokenDistributionEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDistributionEntry recipientId. + * @member {Uint8Array} recipientId + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + */ + TokenDistributionEntry.prototype.recipientId = $util.newBuffer([]); + + /** + * TokenDistributionEntry amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + */ + TokenDistributionEntry.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenDistributionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry instance + */ + TokenDistributionEntry.create = function create(properties) { + return new TokenDistributionEntry(properties); + }; + + /** + * Encodes the specified TokenDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.recipientId); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); + return writer; + }; + + /** + * Encodes the specified TokenDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDistributionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributionEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recipientId = reader.bytes(); + break; + case 2: + message.amount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDistributionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDistributionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDistributionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) + return "recipientId: buffer expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenDistributionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + */ + TokenDistributionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); + if (object.recipientId != null) + if (typeof object.recipientId === "string") + $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); + else if (object.recipientId.length >= 0) + message.recipientId = object.recipientId; + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a TokenDistributionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} message TokenDistributionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDistributionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.recipientId = ""; + else { + object.recipientId = []; + if (options.bytes !== Array) + object.recipientId = $util.newBuffer(object.recipientId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + } + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + return object; + }; + + /** + * Converts this TokenDistributionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + * @returns {Object.} JSON object + */ + TokenDistributionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDistributionEntry; + })(); + + GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry = (function() { + + /** + * Properties of a TokenTimedDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenTimedDistributionEntry + * @property {number|Long|null} [timestamp] TokenTimedDistributionEntry timestamp + * @property {Array.|null} [distributions] TokenTimedDistributionEntry distributions + */ + + /** + * Constructs a new TokenTimedDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenTimedDistributionEntry. + * @implements ITokenTimedDistributionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set + */ + function TokenTimedDistributionEntry(properties) { + this.distributions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenTimedDistributionEntry timestamp. + * @member {number|Long} timestamp + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + */ + TokenTimedDistributionEntry.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TokenTimedDistributionEntry distributions. + * @member {Array.} distributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + */ + TokenTimedDistributionEntry.prototype.distributions = $util.emptyArray; + + /** + * Creates a new TokenTimedDistributionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry instance + */ + TokenTimedDistributionEntry.create = function create(properties) { + return new TokenTimedDistributionEntry(properties); + }; + + /** + * Encodes the specified TokenTimedDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTimedDistributionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); + if (message.distributions != null && message.distributions.length) + for (var i = 0; i < message.distributions.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.encode(message.distributions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenTimedDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTimedDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTimedDistributionEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + if (!(message.distributions && message.distributions.length)) + message.distributions = []; + message.distributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTimedDistributionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenTimedDistributionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenTimedDistributionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.distributions != null && message.hasOwnProperty("distributions")) { + if (!Array.isArray(message.distributions)) + return "distributions: array expected"; + for (var i = 0; i < message.distributions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify(message.distributions[i]); + if (error) + return "distributions." + error; + } + } + return null; + }; + + /** + * Creates a TokenTimedDistributionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + */ + TokenTimedDistributionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.distributions) { + if (!Array.isArray(object.distributions)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: array expected"); + message.distributions = []; + for (var i = 0; i < object.distributions.length; ++i) { + if (typeof object.distributions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: object expected"); + message.distributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.fromObject(object.distributions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenTimedDistributionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} message TokenTimedDistributionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenTimedDistributionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.distributions = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.distributions && message.distributions.length) { + object.distributions = []; + for (var j = 0; j < message.distributions.length; ++j) + object.distributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.toObject(message.distributions[j], options); + } + return object; + }; + + /** + * Converts this TokenTimedDistributionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + * @returns {Object.} JSON object + */ + TokenTimedDistributionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenTimedDistributionEntry; + })(); + + GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions = (function() { + + /** + * Properties of a TokenDistributions. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenDistributions + * @property {Array.|null} [tokenDistributions] TokenDistributions tokenDistributions + */ + + /** + * Constructs a new TokenDistributions. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenDistributions. + * @implements ITokenDistributions + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set + */ + function TokenDistributions(properties) { + this.tokenDistributions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDistributions tokenDistributions. + * @member {Array.} tokenDistributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @instance + */ + TokenDistributions.prototype.tokenDistributions = $util.emptyArray; + + /** + * Creates a new TokenDistributions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions instance + */ + TokenDistributions.create = function create(properties) { + return new TokenDistributions(properties); + }; + + /** + * Encodes the specified TokenDistributions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDistributions != null && message.tokenDistributions.length) + for (var i = 0; i < message.tokenDistributions.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.encode(message.tokenDistributions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDistributions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDistributions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenDistributions && message.tokenDistributions.length)) + message.tokenDistributions = []; + message.tokenDistributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDistributions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDistributions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDistributions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + if (!Array.isArray(message.tokenDistributions)) + return "tokenDistributions: array expected"; + for (var i = 0; i < message.tokenDistributions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify(message.tokenDistributions[i]); + if (error) + return "tokenDistributions." + error; + } + } + return null; + }; + + /** + * Creates a TokenDistributions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + */ + TokenDistributions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); + if (object.tokenDistributions) { + if (!Array.isArray(object.tokenDistributions)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: array expected"); + message.tokenDistributions = []; + for (var i = 0; i < object.tokenDistributions.length; ++i) { + if (typeof object.tokenDistributions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: object expected"); + message.tokenDistributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.fromObject(object.tokenDistributions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenDistributions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} message TokenDistributions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDistributions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenDistributions = []; + if (message.tokenDistributions && message.tokenDistributions.length) { + object.tokenDistributions = []; + for (var j = 0; j < message.tokenDistributions.length; ++j) + object.tokenDistributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.toObject(message.tokenDistributions[j], options); + } + return object; + }; + + /** + * Converts this TokenDistributions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @instance + * @returns {Object.} JSON object + */ + TokenDistributions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDistributions; + })(); + + return GetTokenPreProgrammedDistributionsResponseV0; + })(); + + return GetTokenPreProgrammedDistributionsResponse; + })(); + + v0.GetTokenTotalSupplyRequest = (function() { + + /** + * Properties of a GetTokenTotalSupplyRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenTotalSupplyRequest + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null} [v0] GetTokenTotalSupplyRequest v0 + */ + + /** + * Constructs a new GetTokenTotalSupplyRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenTotalSupplyRequest. + * @implements IGetTokenTotalSupplyRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set + */ + function GetTokenTotalSupplyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenTotalSupplyRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + */ + GetTokenTotalSupplyRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest instance + */ + GetTokenTotalSupplyRequest.create = function create(properties) { + return new GetTokenTotalSupplyRequest(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + */ + GetTokenTotalSupplyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenTotalSupplyRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 = (function() { + + /** + * Properties of a GetTokenTotalSupplyRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @interface IGetTokenTotalSupplyRequestV0 + * @property {Uint8Array|null} [tokenId] GetTokenTotalSupplyRequestV0 tokenId + * @property {boolean|null} [prove] GetTokenTotalSupplyRequestV0 prove + */ + + /** + * Constructs a new GetTokenTotalSupplyRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @classdesc Represents a GetTokenTotalSupplyRequestV0. + * @implements IGetTokenTotalSupplyRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set + */ + function GetTokenTotalSupplyRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenTotalSupplyRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + */ + GetTokenTotalSupplyRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetTokenTotalSupplyRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + */ + GetTokenTotalSupplyRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenTotalSupplyRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 instance + */ + GetTokenTotalSupplyRequestV0.create = function create(properties) { + return new GetTokenTotalSupplyRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenTotalSupplyRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + */ + GetTokenTotalSupplyRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenTotalSupplyRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenTotalSupplyRequestV0; + })(); + + return GetTokenTotalSupplyRequest; + })(); + + v0.GetTokenTotalSupplyResponse = (function() { + + /** + * Properties of a GetTokenTotalSupplyResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenTotalSupplyResponse + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null} [v0] GetTokenTotalSupplyResponse v0 + */ + + /** + * Constructs a new GetTokenTotalSupplyResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenTotalSupplyResponse. + * @implements IGetTokenTotalSupplyResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set + */ + function GetTokenTotalSupplyResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenTotalSupplyResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + */ + GetTokenTotalSupplyResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse instance + */ + GetTokenTotalSupplyResponse.create = function create(properties) { + return new GetTokenTotalSupplyResponse(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + */ + GetTokenTotalSupplyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenTotalSupplyResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 = (function() { + + /** + * Properties of a GetTokenTotalSupplyResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @interface IGetTokenTotalSupplyResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null} [tokenTotalSupply] GetTokenTotalSupplyResponseV0 tokenTotalSupply + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenTotalSupplyResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenTotalSupplyResponseV0 metadata + */ + + /** + * Constructs a new GetTokenTotalSupplyResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @classdesc Represents a GetTokenTotalSupplyResponseV0. + * @implements IGetTokenTotalSupplyResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set + */ + function GetTokenTotalSupplyResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenTotalSupplyResponseV0 tokenTotalSupply. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null|undefined} tokenTotalSupply + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.tokenTotalSupply = null; + + /** + * GetTokenTotalSupplyResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.proof = null; + + /** + * GetTokenTotalSupplyResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyResponseV0 result. + * @member {"tokenTotalSupply"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenTotalSupply", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 instance + */ + GetTokenTotalSupplyResponseV0.create = function create(properties) { + return new GetTokenTotalSupplyResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenTotalSupply != null && Object.hasOwnProperty.call(message, "tokenTotalSupply")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.encode(message.tokenTotalSupply, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify(message.tokenTotalSupply); + if (error) + return "tokenTotalSupply." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + */ + GetTokenTotalSupplyResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); + if (object.tokenTotalSupply != null) { + if (typeof object.tokenTotalSupply !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.tokenTotalSupply: object expected"); + message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.fromObject(object.tokenTotalSupply); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { + object.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.toObject(message.tokenTotalSupply, options); + if (options.oneofs) + object.result = "tokenTotalSupply"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenTotalSupplyResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry = (function() { + + /** + * Properties of a TokenTotalSupplyEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @interface ITokenTotalSupplyEntry + * @property {Uint8Array|null} [tokenId] TokenTotalSupplyEntry tokenId + * @property {number|Long|null} [totalAggregatedAmountInUserAccounts] TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts + * @property {number|Long|null} [totalSystemAmount] TokenTotalSupplyEntry totalSystemAmount + */ + + /** + * Constructs a new TokenTotalSupplyEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @classdesc Represents a TokenTotalSupplyEntry. + * @implements ITokenTotalSupplyEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set + */ + function TokenTotalSupplyEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenTotalSupplyEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts. + * @member {number|Long} totalAggregatedAmountInUserAccounts + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.totalAggregatedAmountInUserAccounts = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TokenTotalSupplyEntry totalSystemAmount. + * @member {number|Long} totalSystemAmount + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.totalSystemAmount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenTotalSupplyEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry instance + */ + TokenTotalSupplyEntry.create = function create(properties) { + return new TokenTotalSupplyEntry(properties); + }; + + /** + * Encodes the specified TokenTotalSupplyEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTotalSupplyEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.totalAggregatedAmountInUserAccounts != null && Object.hasOwnProperty.call(message, "totalAggregatedAmountInUserAccounts")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.totalAggregatedAmountInUserAccounts); + if (message.totalSystemAmount != null && Object.hasOwnProperty.call(message, "totalSystemAmount")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.totalSystemAmount); + return writer; + }; + + /** + * Encodes the specified TokenTotalSupplyEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTotalSupplyEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTotalSupplyEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.totalAggregatedAmountInUserAccounts = reader.uint64(); + break; + case 3: + message.totalSystemAmount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTotalSupplyEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenTotalSupplyEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenTotalSupplyEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) + if (!$util.isInteger(message.totalAggregatedAmountInUserAccounts) && !(message.totalAggregatedAmountInUserAccounts && $util.isInteger(message.totalAggregatedAmountInUserAccounts.low) && $util.isInteger(message.totalAggregatedAmountInUserAccounts.high))) + return "totalAggregatedAmountInUserAccounts: integer|Long expected"; + if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) + if (!$util.isInteger(message.totalSystemAmount) && !(message.totalSystemAmount && $util.isInteger(message.totalSystemAmount.low) && $util.isInteger(message.totalSystemAmount.high))) + return "totalSystemAmount: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenTotalSupplyEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + */ + TokenTotalSupplyEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.totalAggregatedAmountInUserAccounts != null) + if ($util.Long) + (message.totalAggregatedAmountInUserAccounts = $util.Long.fromValue(object.totalAggregatedAmountInUserAccounts)).unsigned = true; + else if (typeof object.totalAggregatedAmountInUserAccounts === "string") + message.totalAggregatedAmountInUserAccounts = parseInt(object.totalAggregatedAmountInUserAccounts, 10); + else if (typeof object.totalAggregatedAmountInUserAccounts === "number") + message.totalAggregatedAmountInUserAccounts = object.totalAggregatedAmountInUserAccounts; + else if (typeof object.totalAggregatedAmountInUserAccounts === "object") + message.totalAggregatedAmountInUserAccounts = new $util.LongBits(object.totalAggregatedAmountInUserAccounts.low >>> 0, object.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true); + if (object.totalSystemAmount != null) + if ($util.Long) + (message.totalSystemAmount = $util.Long.fromValue(object.totalSystemAmount)).unsigned = true; + else if (typeof object.totalSystemAmount === "string") + message.totalSystemAmount = parseInt(object.totalSystemAmount, 10); + else if (typeof object.totalSystemAmount === "number") + message.totalSystemAmount = object.totalSystemAmount; + else if (typeof object.totalSystemAmount === "object") + message.totalSystemAmount = new $util.LongBits(object.totalSystemAmount.low >>> 0, object.totalSystemAmount.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a TokenTotalSupplyEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} message TokenTotalSupplyEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenTotalSupplyEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalAggregatedAmountInUserAccounts = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalAggregatedAmountInUserAccounts = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalSystemAmount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalSystemAmount = options.longs === String ? "0" : 0; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) + if (typeof message.totalAggregatedAmountInUserAccounts === "number") + object.totalAggregatedAmountInUserAccounts = options.longs === String ? String(message.totalAggregatedAmountInUserAccounts) : message.totalAggregatedAmountInUserAccounts; + else + object.totalAggregatedAmountInUserAccounts = options.longs === String ? $util.Long.prototype.toString.call(message.totalAggregatedAmountInUserAccounts) : options.longs === Number ? new $util.LongBits(message.totalAggregatedAmountInUserAccounts.low >>> 0, message.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true) : message.totalAggregatedAmountInUserAccounts; + if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) + if (typeof message.totalSystemAmount === "number") + object.totalSystemAmount = options.longs === String ? String(message.totalSystemAmount) : message.totalSystemAmount; + else + object.totalSystemAmount = options.longs === String ? $util.Long.prototype.toString.call(message.totalSystemAmount) : options.longs === Number ? new $util.LongBits(message.totalSystemAmount.low >>> 0, message.totalSystemAmount.high >>> 0).toNumber(true) : message.totalSystemAmount; + return object; + }; + + /** + * Converts this TokenTotalSupplyEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + * @returns {Object.} JSON object + */ + TokenTotalSupplyEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenTotalSupplyEntry; + })(); + + return GetTokenTotalSupplyResponseV0; + })(); + + return GetTokenTotalSupplyResponse; + })(); + + v0.GetGroupInfoRequest = (function() { + + /** + * Properties of a GetGroupInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfoRequest + * @property {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null} [v0] GetGroupInfoRequest v0 + */ + + /** + * Constructs a new GetGroupInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfoRequest. + * @implements IGetGroupInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set + */ + function GetGroupInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + */ + GetGroupInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + */ + Object.defineProperty(GetGroupInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest instance + */ + GetGroupInfoRequest.create = function create(properties) { + return new GetGroupInfoRequest(properties); + }; + + /** + * Encodes the specified GetGroupInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + */ + GetGroupInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest} message GetGroupInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoRequest.GetGroupInfoRequestV0 = (function() { + + /** + * Properties of a GetGroupInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @interface IGetGroupInfoRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupInfoRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupInfoRequestV0 groupContractPosition + * @property {boolean|null} [prove] GetGroupInfoRequestV0 prove + */ + + /** + * Constructs a new GetGroupInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @classdesc Represents a GetGroupInfoRequestV0. + * @implements IGetGroupInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set + */ + function GetGroupInfoRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfoRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupInfoRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupInfoRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 instance + */ + GetGroupInfoRequestV0.create = function create(properties) { + return new GetGroupInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + */ + GetGroupInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} message GetGroupInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupInfoRequestV0; + })(); + + return GetGroupInfoRequest; + })(); + + v0.GetGroupInfoResponse = (function() { + + /** + * Properties of a GetGroupInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfoResponse + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null} [v0] GetGroupInfoResponse v0 + */ + + /** + * Constructs a new GetGroupInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfoResponse. + * @implements IGetGroupInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set + */ + function GetGroupInfoResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + */ + GetGroupInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + */ + Object.defineProperty(GetGroupInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse instance + */ + GetGroupInfoResponse.create = function create(properties) { + return new GetGroupInfoResponse(properties); + }; + + /** + * Encodes the specified GetGroupInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + */ + GetGroupInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} message GetGroupInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoResponse.GetGroupInfoResponseV0 = (function() { + + /** + * Properties of a GetGroupInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @interface IGetGroupInfoResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null} [groupInfo] GetGroupInfoResponseV0 groupInfo + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfoResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfoResponseV0 metadata + */ + + /** + * Constructs a new GetGroupInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @classdesc Represents a GetGroupInfoResponseV0. + * @implements IGetGroupInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set + */ + function GetGroupInfoResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfoResponseV0 groupInfo. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null|undefined} groupInfo + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.groupInfo = null; + + /** + * GetGroupInfoResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.proof = null; + + /** + * GetGroupInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoResponseV0 result. + * @member {"groupInfo"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + Object.defineProperty(GetGroupInfoResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupInfo", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 instance + */ + GetGroupInfoResponseV0.create = function create(properties) { + return new GetGroupInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 4: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify(message.groupInfo); + if (error) + return "groupInfo." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + */ + GetGroupInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); + if (object.groupInfo != null) { + if (typeof object.groupInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.groupInfo: object expected"); + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.fromObject(object.groupInfo); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} message GetGroupInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.toObject(message.groupInfo, options); + if (options.oneofs) + object.result = "groupInfo"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoResponseV0.GroupMemberEntry = (function() { + + /** + * Properties of a GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupMemberEntry + * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId + * @property {number|null} [power] GroupMemberEntry power + */ + + /** + * Constructs a new GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupMemberEntry. + * @implements IGroupMemberEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set + */ + function GroupMemberEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMemberEntry memberId. + * @member {Uint8Array} memberId + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.memberId = $util.newBuffer([]); + + /** + * GroupMemberEntry power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.power = 0; + + /** + * Creates a new GroupMemberEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry instance + */ + GroupMemberEntry.create = function create(properties) { + return new GroupMemberEntry(properties); + }; + + /** + * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.memberId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMemberEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMemberEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberId != null && message.hasOwnProperty("memberId")) + if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) + return "memberId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + */ + GroupMemberEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); + if (object.memberId != null) + if (typeof object.memberId === "string") + $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); + else if (object.memberId.length >= 0) + message.memberId = object.memberId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} message GroupMemberEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMemberEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.memberId = ""; + else { + object.memberId = []; + if (options.bytes !== Array) + object.memberId = $util.newBuffer(object.memberId); + } + object.power = 0; + } + if (message.memberId != null && message.hasOwnProperty("memberId")) + object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupMemberEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + * @returns {Object.} JSON object + */ + GroupMemberEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupMemberEntry; + })(); + + GetGroupInfoResponseV0.GroupInfoEntry = (function() { + + /** + * Properties of a GroupInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupInfoEntry + * @property {Array.|null} [members] GroupInfoEntry members + * @property {number|null} [groupRequiredPower] GroupInfoEntry groupRequiredPower + */ + + /** + * Constructs a new GroupInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupInfoEntry. + * @implements IGroupInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set + */ + function GroupInfoEntry(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupInfoEntry members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + */ + GroupInfoEntry.prototype.members = $util.emptyArray; + + /** + * GroupInfoEntry groupRequiredPower. + * @member {number} groupRequiredPower + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + */ + GroupInfoEntry.prototype.groupRequiredPower = 0; + + /** + * Creates a new GroupInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry instance + */ + GroupInfoEntry.create = function create(properties) { + return new GroupInfoEntry(properties); + }; + + /** + * Encodes the specified GroupInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupRequiredPower); + return writer; + }; + + /** + * Encodes the specified GroupInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); + break; + case 2: + message.groupRequiredPower = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + if (!$util.isInteger(message.groupRequiredPower)) + return "groupRequiredPower: integer expected"; + return null; + }; + + /** + * Creates a GroupInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + */ + GroupInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.fromObject(object.members[i]); + } + } + if (object.groupRequiredPower != null) + message.groupRequiredPower = object.groupRequiredPower >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} message GroupInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) + object.groupRequiredPower = 0; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.toObject(message.members[j], options); + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + object.groupRequiredPower = message.groupRequiredPower; + return object; + }; + + /** + * Converts this GroupInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + * @returns {Object.} JSON object + */ + GroupInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfoEntry; + })(); + + GetGroupInfoResponseV0.GroupInfo = (function() { + + /** + * Properties of a GroupInfo. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupInfo + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null} [groupInfo] GroupInfo groupInfo + */ + + /** + * Constructs a new GroupInfo. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupInfo. + * @implements IGroupInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set + */ + function GroupInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupInfo groupInfo. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null|undefined} groupInfo + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @instance + */ + GroupInfo.prototype.groupInfo = null; + + /** + * Creates a new GroupInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo instance + */ + GroupInfo.create = function create(properties) { + return new GroupInfo(properties); + }; + + /** + * Encodes the specified GroupInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify(message.groupInfo); + if (error) + return "groupInfo." + error; + } + return null; + }; + + /** + * Creates a GroupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + */ + GroupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); + if (object.groupInfo != null) { + if (typeof object.groupInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.groupInfo: object expected"); + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.fromObject(object.groupInfo); + } + return message; + }; + + /** + * Creates a plain object from a GroupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} message GroupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.groupInfo = null; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) + object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.toObject(message.groupInfo, options); + return object; + }; + + /** + * Converts this GroupInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @instance + * @returns {Object.} JSON object + */ + GroupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfo; + })(); + + return GetGroupInfoResponseV0; + })(); + + return GetGroupInfoResponse; + })(); + + v0.GetGroupInfosRequest = (function() { + + /** + * Properties of a GetGroupInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfosRequest + * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null} [v0] GetGroupInfosRequest v0 + */ + + /** + * Constructs a new GetGroupInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfosRequest. + * @implements IGetGroupInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set + */ + function GetGroupInfosRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + */ + GetGroupInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + */ + Object.defineProperty(GetGroupInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest instance + */ + GetGroupInfosRequest.create = function create(properties) { + return new GetGroupInfosRequest(properties); + }; + + /** + * Encodes the specified GetGroupInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + */ + GetGroupInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest} message GetGroupInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosRequest.StartAtGroupContractPosition = (function() { + + /** + * Properties of a StartAtGroupContractPosition. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @interface IStartAtGroupContractPosition + * @property {number|null} [startGroupContractPosition] StartAtGroupContractPosition startGroupContractPosition + * @property {boolean|null} [startGroupContractPositionIncluded] StartAtGroupContractPosition startGroupContractPositionIncluded + */ + + /** + * Constructs a new StartAtGroupContractPosition. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @classdesc Represents a StartAtGroupContractPosition. + * @implements IStartAtGroupContractPosition + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set + */ + function StartAtGroupContractPosition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtGroupContractPosition startGroupContractPosition. + * @member {number} startGroupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + */ + StartAtGroupContractPosition.prototype.startGroupContractPosition = 0; + + /** + * StartAtGroupContractPosition startGroupContractPositionIncluded. + * @member {boolean} startGroupContractPositionIncluded + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + */ + StartAtGroupContractPosition.prototype.startGroupContractPositionIncluded = false; + + /** + * Creates a new StartAtGroupContractPosition instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition instance + */ + StartAtGroupContractPosition.create = function create(properties) { + return new StartAtGroupContractPosition(properties); + }; + + /** + * Encodes the specified StartAtGroupContractPosition message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtGroupContractPosition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startGroupContractPosition != null && Object.hasOwnProperty.call(message, "startGroupContractPosition")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.startGroupContractPosition); + if (message.startGroupContractPositionIncluded != null && Object.hasOwnProperty.call(message, "startGroupContractPositionIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startGroupContractPositionIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtGroupContractPosition message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtGroupContractPosition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtGroupContractPosition message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtGroupContractPosition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startGroupContractPosition = reader.uint32(); + break; + case 2: + message.startGroupContractPositionIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtGroupContractPosition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtGroupContractPosition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtGroupContractPosition message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtGroupContractPosition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) + if (!$util.isInteger(message.startGroupContractPosition)) + return "startGroupContractPosition: integer expected"; + if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) + if (typeof message.startGroupContractPositionIncluded !== "boolean") + return "startGroupContractPositionIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtGroupContractPosition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + */ + StartAtGroupContractPosition.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); + if (object.startGroupContractPosition != null) + message.startGroupContractPosition = object.startGroupContractPosition >>> 0; + if (object.startGroupContractPositionIncluded != null) + message.startGroupContractPositionIncluded = Boolean(object.startGroupContractPositionIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtGroupContractPosition message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} message StartAtGroupContractPosition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtGroupContractPosition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startGroupContractPosition = 0; + object.startGroupContractPositionIncluded = false; + } + if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) + object.startGroupContractPosition = message.startGroupContractPosition; + if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) + object.startGroupContractPositionIncluded = message.startGroupContractPositionIncluded; + return object; + }; + + /** + * Converts this StartAtGroupContractPosition to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + * @returns {Object.} JSON object + */ + StartAtGroupContractPosition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtGroupContractPosition; + })(); + + GetGroupInfosRequest.GetGroupInfosRequestV0 = (function() { + + /** + * Properties of a GetGroupInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @interface IGetGroupInfosRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupInfosRequestV0 contractId + * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null} [startAtGroupContractPosition] GetGroupInfosRequestV0 startAtGroupContractPosition + * @property {number|null} [count] GetGroupInfosRequestV0 count + * @property {boolean|null} [prove] GetGroupInfosRequestV0 prove + */ + + /** + * Constructs a new GetGroupInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @classdesc Represents a GetGroupInfosRequestV0. + * @implements IGetGroupInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set + */ + function GetGroupInfosRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfosRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupInfosRequestV0 startAtGroupContractPosition. + * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null|undefined} startAtGroupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.startAtGroupContractPosition = null; + + /** + * GetGroupInfosRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.count = 0; + + /** + * GetGroupInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 instance + */ + GetGroupInfosRequestV0.create = function create(properties) { + return new GetGroupInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.startAtGroupContractPosition != null && Object.hasOwnProperty.call(message, "startAtGroupContractPosition")) + $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.encode(message.startAtGroupContractPosition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.decode(reader, reader.uint32()); + break; + case 3: + message.count = reader.uint32(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify(message.startAtGroupContractPosition); + if (error) + return "startAtGroupContractPosition." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + */ + GetGroupInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.startAtGroupContractPosition != null) { + if (typeof object.startAtGroupContractPosition !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.startAtGroupContractPosition: object expected"); + message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.fromObject(object.startAtGroupContractPosition); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} message GetGroupInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.startAtGroupContractPosition = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) + object.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.toObject(message.startAtGroupContractPosition, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupInfosRequestV0; + })(); + + return GetGroupInfosRequest; + })(); + + v0.GetGroupInfosResponse = (function() { + + /** + * Properties of a GetGroupInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfosResponse + * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null} [v0] GetGroupInfosResponse v0 + */ + + /** + * Constructs a new GetGroupInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfosResponse. + * @implements IGetGroupInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set + */ + function GetGroupInfosResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + */ + GetGroupInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + */ + Object.defineProperty(GetGroupInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse instance + */ + GetGroupInfosResponse.create = function create(properties) { + return new GetGroupInfosResponse(properties); + }; + + /** + * Encodes the specified GetGroupInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + */ + GetGroupInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} message GetGroupInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosResponse.GetGroupInfosResponseV0 = (function() { + + /** + * Properties of a GetGroupInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @interface IGetGroupInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null} [groupInfos] GetGroupInfosResponseV0 groupInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfosResponseV0 metadata + */ + + /** + * Constructs a new GetGroupInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @classdesc Represents a GetGroupInfosResponseV0. + * @implements IGetGroupInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set + */ + function GetGroupInfosResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfosResponseV0 groupInfos. + * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null|undefined} groupInfos + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.groupInfos = null; + + /** + * GetGroupInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.proof = null; + + /** + * GetGroupInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosResponseV0 result. + * @member {"groupInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + Object.defineProperty(GetGroupInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 instance + */ + GetGroupInfosResponseV0.create = function create(properties) { + return new GetGroupInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfos != null && Object.hasOwnProperty.call(message, "groupInfos")) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.encode(message.groupInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 4: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify(message.groupInfos); + if (error) + return "groupInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + */ + GetGroupInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); + if (object.groupInfos != null) { + if (typeof object.groupInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.groupInfos: object expected"); + message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.fromObject(object.groupInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} message GetGroupInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + object.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.toObject(message.groupInfos, options); + if (options.oneofs) + object.result = "groupInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosResponseV0.GroupMemberEntry = (function() { + + /** + * Properties of a GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupMemberEntry + * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId + * @property {number|null} [power] GroupMemberEntry power + */ + + /** + * Constructs a new GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupMemberEntry. + * @implements IGroupMemberEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set + */ + function GroupMemberEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMemberEntry memberId. + * @member {Uint8Array} memberId + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.memberId = $util.newBuffer([]); + + /** + * GroupMemberEntry power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.power = 0; + + /** + * Creates a new GroupMemberEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry instance + */ + GroupMemberEntry.create = function create(properties) { + return new GroupMemberEntry(properties); + }; + + /** + * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.memberId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMemberEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMemberEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberId != null && message.hasOwnProperty("memberId")) + if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) + return "memberId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + */ + GroupMemberEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); + if (object.memberId != null) + if (typeof object.memberId === "string") + $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); + else if (object.memberId.length >= 0) + message.memberId = object.memberId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} message GroupMemberEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMemberEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.memberId = ""; + else { + object.memberId = []; + if (options.bytes !== Array) + object.memberId = $util.newBuffer(object.memberId); + } + object.power = 0; + } + if (message.memberId != null && message.hasOwnProperty("memberId")) + object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupMemberEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + * @returns {Object.} JSON object + */ + GroupMemberEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupMemberEntry; + })(); + + GetGroupInfosResponseV0.GroupPositionInfoEntry = (function() { + + /** + * Properties of a GroupPositionInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupPositionInfoEntry + * @property {number|null} [groupContractPosition] GroupPositionInfoEntry groupContractPosition + * @property {Array.|null} [members] GroupPositionInfoEntry members + * @property {number|null} [groupRequiredPower] GroupPositionInfoEntry groupRequiredPower + */ + + /** + * Constructs a new GroupPositionInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupPositionInfoEntry. + * @implements IGroupPositionInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set + */ + function GroupPositionInfoEntry(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupPositionInfoEntry groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.groupContractPosition = 0; + + /** + * GroupPositionInfoEntry members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.members = $util.emptyArray; + + /** + * GroupPositionInfoEntry groupRequiredPower. + * @member {number} groupRequiredPower + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.groupRequiredPower = 0; + + /** + * Creates a new GroupPositionInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry instance + */ + GroupPositionInfoEntry.create = function create(properties) { + return new GroupPositionInfoEntry(properties); + }; + + /** + * Encodes the specified GroupPositionInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupPositionInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.groupContractPosition); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.groupRequiredPower); + return writer; + }; + + /** + * Encodes the specified GroupPositionInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupPositionInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupPositionInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupPositionInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupContractPosition = reader.uint32(); + break; + case 2: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); + break; + case 3: + message.groupRequiredPower = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupPositionInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupPositionInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupPositionInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupPositionInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + if (!$util.isInteger(message.groupRequiredPower)) + return "groupRequiredPower: integer expected"; + return null; + }; + + /** + * Creates a GroupPositionInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + */ + GroupPositionInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.fromObject(object.members[i]); + } + } + if (object.groupRequiredPower != null) + message.groupRequiredPower = object.groupRequiredPower >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupPositionInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} message GroupPositionInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupPositionInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.groupContractPosition = 0; + object.groupRequiredPower = 0; + } + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.toObject(message.members[j], options); + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + object.groupRequiredPower = message.groupRequiredPower; + return object; + }; + + /** + * Converts this GroupPositionInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + * @returns {Object.} JSON object + */ + GroupPositionInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupPositionInfoEntry; + })(); + + GetGroupInfosResponseV0.GroupInfos = (function() { + + /** + * Properties of a GroupInfos. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupInfos + * @property {Array.|null} [groupInfos] GroupInfos groupInfos + */ + + /** + * Constructs a new GroupInfos. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupInfos. + * @implements IGroupInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set + */ + function GroupInfos(properties) { + this.groupInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupInfos groupInfos. + * @member {Array.} groupInfos + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @instance + */ + GroupInfos.prototype.groupInfos = $util.emptyArray; + + /** + * Creates a new GroupInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos instance + */ + GroupInfos.create = function create(properties) { + return new GroupInfos(properties); + }; + + /** + * Encodes the specified GroupInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfos != null && message.groupInfos.length) + for (var i = 0; i < message.groupInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.encode(message.groupInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfos.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupInfos && message.groupInfos.length)) + message.groupInfos = []; + message.groupInfos.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + if (!Array.isArray(message.groupInfos)) + return "groupInfos: array expected"; + for (var i = 0; i < message.groupInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify(message.groupInfos[i]); + if (error) + return "groupInfos." + error; + } + } + return null; + }; + + /** + * Creates a GroupInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + */ + GroupInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); + if (object.groupInfos) { + if (!Array.isArray(object.groupInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: array expected"); + message.groupInfos = []; + for (var i = 0; i < object.groupInfos.length; ++i) { + if (typeof object.groupInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: object expected"); + message.groupInfos[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.fromObject(object.groupInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} message GroupInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupInfos = []; + if (message.groupInfos && message.groupInfos.length) { + object.groupInfos = []; + for (var j = 0; j < message.groupInfos.length; ++j) + object.groupInfos[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.toObject(message.groupInfos[j], options); + } + return object; + }; + + /** + * Converts this GroupInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @instance + * @returns {Object.} JSON object + */ + GroupInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfos; + })(); + + return GetGroupInfosResponseV0; + })(); + + return GetGroupInfosResponse; + })(); + + v0.GetGroupActionsRequest = (function() { + + /** + * Properties of a GetGroupActionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionsRequest + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null} [v0] GetGroupActionsRequest v0 + */ + + /** + * Constructs a new GetGroupActionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionsRequest. + * @implements IGetGroupActionsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set + */ + function GetGroupActionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionsRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + */ + GetGroupActionsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + */ + Object.defineProperty(GetGroupActionsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest instance + */ + GetGroupActionsRequest.create = function create(properties) { + return new GetGroupActionsRequest(properties); + }; + + /** + * Encodes the specified GetGroupActionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + */ + GetGroupActionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest} message GetGroupActionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionStatus enum. + * @name org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus + * @enum {number} + * @property {number} ACTIVE=0 ACTIVE value + * @property {number} CLOSED=1 CLOSED value + */ + GetGroupActionsRequest.ActionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVE"] = 0; + values[valuesById[1] = "CLOSED"] = 1; + return values; + })(); + + GetGroupActionsRequest.StartAtActionId = (function() { + + /** + * Properties of a StartAtActionId. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @interface IStartAtActionId + * @property {Uint8Array|null} [startActionId] StartAtActionId startActionId + * @property {boolean|null} [startActionIdIncluded] StartAtActionId startActionIdIncluded + */ + + /** + * Constructs a new StartAtActionId. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @classdesc Represents a StartAtActionId. + * @implements IStartAtActionId + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set + */ + function StartAtActionId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtActionId startActionId. + * @member {Uint8Array} startActionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + */ + StartAtActionId.prototype.startActionId = $util.newBuffer([]); + + /** + * StartAtActionId startActionIdIncluded. + * @member {boolean} startActionIdIncluded + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + */ + StartAtActionId.prototype.startActionIdIncluded = false; + + /** + * Creates a new StartAtActionId instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId instance + */ + StartAtActionId.create = function create(properties) { + return new StartAtActionId(properties); + }; + + /** + * Encodes the specified StartAtActionId message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtActionId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startActionId != null && Object.hasOwnProperty.call(message, "startActionId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startActionId); + if (message.startActionIdIncluded != null && Object.hasOwnProperty.call(message, "startActionIdIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startActionIdIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtActionId message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtActionId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtActionId message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtActionId.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startActionId = reader.bytes(); + break; + case 2: + message.startActionIdIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtActionId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtActionId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtActionId message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtActionId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startActionId != null && message.hasOwnProperty("startActionId")) + if (!(message.startActionId && typeof message.startActionId.length === "number" || $util.isString(message.startActionId))) + return "startActionId: buffer expected"; + if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) + if (typeof message.startActionIdIncluded !== "boolean") + return "startActionIdIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtActionId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + */ + StartAtActionId.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); + if (object.startActionId != null) + if (typeof object.startActionId === "string") + $util.base64.decode(object.startActionId, message.startActionId = $util.newBuffer($util.base64.length(object.startActionId)), 0); + else if (object.startActionId.length >= 0) + message.startActionId = object.startActionId; + if (object.startActionIdIncluded != null) + message.startActionIdIncluded = Boolean(object.startActionIdIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtActionId message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} message StartAtActionId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtActionId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startActionId = ""; + else { + object.startActionId = []; + if (options.bytes !== Array) + object.startActionId = $util.newBuffer(object.startActionId); + } + object.startActionIdIncluded = false; + } + if (message.startActionId != null && message.hasOwnProperty("startActionId")) + object.startActionId = options.bytes === String ? $util.base64.encode(message.startActionId, 0, message.startActionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.startActionId) : message.startActionId; + if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) + object.startActionIdIncluded = message.startActionIdIncluded; + return object; + }; + + /** + * Converts this StartAtActionId to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + * @returns {Object.} JSON object + */ + StartAtActionId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtActionId; + })(); + + GetGroupActionsRequest.GetGroupActionsRequestV0 = (function() { + + /** + * Properties of a GetGroupActionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @interface IGetGroupActionsRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupActionsRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupActionsRequestV0 groupContractPosition + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus|null} [status] GetGroupActionsRequestV0 status + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null} [startAtActionId] GetGroupActionsRequestV0 startAtActionId + * @property {number|null} [count] GetGroupActionsRequestV0 count + * @property {boolean|null} [prove] GetGroupActionsRequestV0 prove + */ + + /** + * Constructs a new GetGroupActionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @classdesc Represents a GetGroupActionsRequestV0. + * @implements IGetGroupActionsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set + */ + function GetGroupActionsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionsRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupActionsRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupActionsRequestV0 status. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus} status + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.status = 0; + + /** + * GetGroupActionsRequestV0 startAtActionId. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null|undefined} startAtActionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.startAtActionId = null; + + /** + * GetGroupActionsRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.count = 0; + + /** + * GetGroupActionsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupActionsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 instance + */ + GetGroupActionsRequestV0.create = function create(properties) { + return new GetGroupActionsRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupActionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.startAtActionId != null && Object.hasOwnProperty.call(message, "startAtActionId")) + $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.encode(message.startAtActionId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.decode(reader, reader.uint32()); + break; + case 5: + message.count = reader.uint32(); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + break; + } + if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify(message.startAtActionId); + if (error) + return "startAtActionId." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupActionsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + */ + GetGroupActionsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + switch (object.status) { + case "ACTIVE": + case 0: + message.status = 0; + break; + case "CLOSED": + case 1: + message.status = 1; + break; + } + if (object.startAtActionId != null) { + if (typeof object.startAtActionId !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.startAtActionId: object expected"); + message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.fromObject(object.startAtActionId); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} message GetGroupActionsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.status = options.enums === String ? "ACTIVE" : 0; + object.startAtActionId = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus[message.status] : message.status; + if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) + object.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.toObject(message.startAtActionId, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupActionsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupActionsRequestV0; + })(); + + return GetGroupActionsRequest; + })(); + + v0.GetGroupActionsResponse = (function() { + + /** + * Properties of a GetGroupActionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionsResponse + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null} [v0] GetGroupActionsResponse v0 + */ + + /** + * Constructs a new GetGroupActionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionsResponse. + * @implements IGetGroupActionsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set + */ + function GetGroupActionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionsResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + */ + GetGroupActionsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + */ + Object.defineProperty(GetGroupActionsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse instance + */ + GetGroupActionsResponse.create = function create(properties) { + return new GetGroupActionsResponse(properties); + }; + + /** + * Encodes the specified GetGroupActionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + */ + GetGroupActionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} message GetGroupActionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionsResponse.GetGroupActionsResponseV0 = (function() { + + /** + * Properties of a GetGroupActionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @interface IGetGroupActionsResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null} [groupActions] GetGroupActionsResponseV0 groupActions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionsResponseV0 metadata + */ + + /** + * Constructs a new GetGroupActionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @classdesc Represents a GetGroupActionsResponseV0. + * @implements IGetGroupActionsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set + */ + function GetGroupActionsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionsResponseV0 groupActions. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null|undefined} groupActions + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.groupActions = null; + + /** + * GetGroupActionsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.proof = null; + + /** + * GetGroupActionsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsResponseV0 result. + * @member {"groupActions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + Object.defineProperty(GetGroupActionsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupActions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 instance + */ + GetGroupActionsResponseV0.create = function create(properties) { + return new GetGroupActionsResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupActionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActions != null && Object.hasOwnProperty.call(message, "groupActions")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.encode(message.groupActions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify(message.groupActions); + if (error) + return "groupActions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupActionsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + */ + GetGroupActionsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); + if (object.groupActions != null) { + if (typeof object.groupActions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.groupActions: object expected"); + message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.fromObject(object.groupActions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} message GetGroupActionsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + object.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.toObject(message.groupActions, options); + if (options.oneofs) + object.result = "groupActions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupActionsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionsResponseV0.MintEvent = (function() { + + /** + * Properties of a MintEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IMintEvent + * @property {number|Long|null} [amount] MintEvent amount + * @property {Uint8Array|null} [recipientId] MintEvent recipientId + * @property {string|null} [publicNote] MintEvent publicNote + */ + + /** + * Constructs a new MintEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a MintEvent. + * @implements IMintEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set + */ + function MintEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MintEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MintEvent recipientId. + * @member {Uint8Array} recipientId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.recipientId = $util.newBuffer([]); + + /** + * MintEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.publicNote = ""; + + /** + * Creates a new MintEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent instance + */ + MintEvent.create = function create(properties) { + return new MintEvent(properties); + }; + + /** + * Encodes the specified MintEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MintEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); + if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.recipientId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified MintEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MintEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MintEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MintEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + case 2: + message.recipientId = reader.bytes(); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MintEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MintEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MintEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MintEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) + return "recipientId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a MintEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + */ + MintEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + if (object.recipientId != null) + if (typeof object.recipientId === "string") + $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); + else if (object.recipientId.length >= 0) + message.recipientId = object.recipientId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a MintEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} message MintEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MintEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.recipientId = ""; + else { + object.recipientId = []; + if (options.bytes !== Array) + object.recipientId = $util.newBuffer(object.recipientId); + } + object.publicNote = ""; + } + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this MintEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + * @returns {Object.} JSON object + */ + MintEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MintEvent; + })(); + + GetGroupActionsResponseV0.BurnEvent = (function() { + + /** + * Properties of a BurnEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IBurnEvent + * @property {number|Long|null} [amount] BurnEvent amount + * @property {string|null} [publicNote] BurnEvent publicNote + */ + + /** + * Constructs a new BurnEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a BurnEvent. + * @implements IBurnEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set + */ + function BurnEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BurnEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + */ + BurnEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BurnEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + */ + BurnEvent.prototype.publicNote = ""; + + /** + * Creates a new BurnEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent instance + */ + BurnEvent.create = function create(properties) { + return new BurnEvent(properties); + }; + + /** + * Encodes the specified BurnEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BurnEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified BurnEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BurnEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BurnEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BurnEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BurnEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BurnEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BurnEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BurnEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a BurnEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + */ + BurnEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a BurnEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} message BurnEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BurnEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + object.publicNote = ""; + } + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this BurnEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + * @returns {Object.} JSON object + */ + BurnEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BurnEvent; + })(); + + GetGroupActionsResponseV0.FreezeEvent = (function() { + + /** + * Properties of a FreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IFreezeEvent + * @property {Uint8Array|null} [frozenId] FreezeEvent frozenId + * @property {string|null} [publicNote] FreezeEvent publicNote + */ + + /** + * Constructs a new FreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a FreezeEvent. + * @implements IFreezeEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set + */ + function FreezeEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FreezeEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + */ + FreezeEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * FreezeEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + */ + FreezeEvent.prototype.publicNote = ""; + + /** + * Creates a new FreezeEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent instance + */ + FreezeEvent.create = function create(properties) { + return new FreezeEvent(properties); + }; + + /** + * Encodes the specified FreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreezeEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified FreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FreezeEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreezeEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FreezeEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreezeEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FreezeEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FreezeEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a FreezeEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + */ + FreezeEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a FreezeEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} message FreezeEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FreezeEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + object.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this FreezeEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + * @returns {Object.} JSON object + */ + FreezeEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FreezeEvent; + })(); + + GetGroupActionsResponseV0.UnfreezeEvent = (function() { + + /** + * Properties of an UnfreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IUnfreezeEvent + * @property {Uint8Array|null} [frozenId] UnfreezeEvent frozenId + * @property {string|null} [publicNote] UnfreezeEvent publicNote + */ + + /** + * Constructs a new UnfreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an UnfreezeEvent. + * @implements IUnfreezeEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set + */ + function UnfreezeEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnfreezeEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + */ + UnfreezeEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * UnfreezeEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + */ + UnfreezeEvent.prototype.publicNote = ""; + + /** + * Creates a new UnfreezeEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent instance + */ + UnfreezeEvent.create = function create(properties) { + return new UnfreezeEvent(properties); + }; + + /** + * Encodes the specified UnfreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnfreezeEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified UnfreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnfreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnfreezeEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnfreezeEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnfreezeEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnfreezeEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnfreezeEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnfreezeEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an UnfreezeEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + */ + UnfreezeEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an UnfreezeEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} message UnfreezeEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnfreezeEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + object.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this UnfreezeEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + * @returns {Object.} JSON object + */ + UnfreezeEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnfreezeEvent; + })(); + + GetGroupActionsResponseV0.DestroyFrozenFundsEvent = (function() { + + /** + * Properties of a DestroyFrozenFundsEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDestroyFrozenFundsEvent + * @property {Uint8Array|null} [frozenId] DestroyFrozenFundsEvent frozenId + * @property {number|Long|null} [amount] DestroyFrozenFundsEvent amount + * @property {string|null} [publicNote] DestroyFrozenFundsEvent publicNote + */ + + /** + * Constructs a new DestroyFrozenFundsEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DestroyFrozenFundsEvent. + * @implements IDestroyFrozenFundsEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set + */ + function DestroyFrozenFundsEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DestroyFrozenFundsEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * DestroyFrozenFundsEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DestroyFrozenFundsEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.publicNote = ""; + + /** + * Creates a new DestroyFrozenFundsEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent instance + */ + DestroyFrozenFundsEvent.create = function create(properties) { + return new DestroyFrozenFundsEvent(properties); + }; + + /** + * Encodes the specified DestroyFrozenFundsEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroyFrozenFundsEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified DestroyFrozenFundsEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroyFrozenFundsEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroyFrozenFundsEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.amount = reader.uint64(); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroyFrozenFundsEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestroyFrozenFundsEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestroyFrozenFundsEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a DestroyFrozenFundsEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + */ + DestroyFrozenFundsEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a DestroyFrozenFundsEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} message DestroyFrozenFundsEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestroyFrozenFundsEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + object.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this DestroyFrozenFundsEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + * @returns {Object.} JSON object + */ + DestroyFrozenFundsEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DestroyFrozenFundsEvent; + })(); + + GetGroupActionsResponseV0.SharedEncryptedNote = (function() { + + /** + * Properties of a SharedEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ISharedEncryptedNote + * @property {number|null} [senderKeyIndex] SharedEncryptedNote senderKeyIndex + * @property {number|null} [recipientKeyIndex] SharedEncryptedNote recipientKeyIndex + * @property {Uint8Array|null} [encryptedData] SharedEncryptedNote encryptedData + */ + + /** + * Constructs a new SharedEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a SharedEncryptedNote. + * @implements ISharedEncryptedNote + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set + */ + function SharedEncryptedNote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SharedEncryptedNote senderKeyIndex. + * @member {number} senderKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.senderKeyIndex = 0; + + /** + * SharedEncryptedNote recipientKeyIndex. + * @member {number} recipientKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.recipientKeyIndex = 0; + + /** + * SharedEncryptedNote encryptedData. + * @member {Uint8Array} encryptedData + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.encryptedData = $util.newBuffer([]); + + /** + * Creates a new SharedEncryptedNote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote instance + */ + SharedEncryptedNote.create = function create(properties) { + return new SharedEncryptedNote(properties); + }; + + /** + * Encodes the specified SharedEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SharedEncryptedNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.senderKeyIndex != null && Object.hasOwnProperty.call(message, "senderKeyIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.senderKeyIndex); + if (message.recipientKeyIndex != null && Object.hasOwnProperty.call(message, "recipientKeyIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.recipientKeyIndex); + if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); + return writer; + }; + + /** + * Encodes the specified SharedEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SharedEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SharedEncryptedNote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SharedEncryptedNote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.senderKeyIndex = reader.uint32(); + break; + case 2: + message.recipientKeyIndex = reader.uint32(); + break; + case 3: + message.encryptedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SharedEncryptedNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SharedEncryptedNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SharedEncryptedNote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SharedEncryptedNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) + if (!$util.isInteger(message.senderKeyIndex)) + return "senderKeyIndex: integer expected"; + if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) + if (!$util.isInteger(message.recipientKeyIndex)) + return "recipientKeyIndex: integer expected"; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) + return "encryptedData: buffer expected"; + return null; + }; + + /** + * Creates a SharedEncryptedNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + */ + SharedEncryptedNote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); + if (object.senderKeyIndex != null) + message.senderKeyIndex = object.senderKeyIndex >>> 0; + if (object.recipientKeyIndex != null) + message.recipientKeyIndex = object.recipientKeyIndex >>> 0; + if (object.encryptedData != null) + if (typeof object.encryptedData === "string") + $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); + else if (object.encryptedData.length >= 0) + message.encryptedData = object.encryptedData; + return message; + }; + + /** + * Creates a plain object from a SharedEncryptedNote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} message SharedEncryptedNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SharedEncryptedNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.senderKeyIndex = 0; + object.recipientKeyIndex = 0; + if (options.bytes === String) + object.encryptedData = ""; + else { + object.encryptedData = []; + if (options.bytes !== Array) + object.encryptedData = $util.newBuffer(object.encryptedData); + } + } + if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) + object.senderKeyIndex = message.senderKeyIndex; + if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) + object.recipientKeyIndex = message.recipientKeyIndex; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; + return object; + }; + + /** + * Converts this SharedEncryptedNote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + * @returns {Object.} JSON object + */ + SharedEncryptedNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SharedEncryptedNote; + })(); + + GetGroupActionsResponseV0.PersonalEncryptedNote = (function() { + + /** + * Properties of a PersonalEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IPersonalEncryptedNote + * @property {number|null} [rootEncryptionKeyIndex] PersonalEncryptedNote rootEncryptionKeyIndex + * @property {number|null} [derivationEncryptionKeyIndex] PersonalEncryptedNote derivationEncryptionKeyIndex + * @property {Uint8Array|null} [encryptedData] PersonalEncryptedNote encryptedData + */ + + /** + * Constructs a new PersonalEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a PersonalEncryptedNote. + * @implements IPersonalEncryptedNote + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set + */ + function PersonalEncryptedNote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonalEncryptedNote rootEncryptionKeyIndex. + * @member {number} rootEncryptionKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.rootEncryptionKeyIndex = 0; + + /** + * PersonalEncryptedNote derivationEncryptionKeyIndex. + * @member {number} derivationEncryptionKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.derivationEncryptionKeyIndex = 0; + + /** + * PersonalEncryptedNote encryptedData. + * @member {Uint8Array} encryptedData + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.encryptedData = $util.newBuffer([]); + + /** + * Creates a new PersonalEncryptedNote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote instance + */ + PersonalEncryptedNote.create = function create(properties) { + return new PersonalEncryptedNote(properties); + }; + + /** + * Encodes the specified PersonalEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalEncryptedNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "rootEncryptionKeyIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rootEncryptionKeyIndex); + if (message.derivationEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "derivationEncryptionKeyIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.derivationEncryptionKeyIndex); + if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); + return writer; + }; + + /** + * Encodes the specified PersonalEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalEncryptedNote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalEncryptedNote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootEncryptionKeyIndex = reader.uint32(); + break; + case 2: + message.derivationEncryptionKeyIndex = reader.uint32(); + break; + case 3: + message.encryptedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalEncryptedNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalEncryptedNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalEncryptedNote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalEncryptedNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) + if (!$util.isInteger(message.rootEncryptionKeyIndex)) + return "rootEncryptionKeyIndex: integer expected"; + if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) + if (!$util.isInteger(message.derivationEncryptionKeyIndex)) + return "derivationEncryptionKeyIndex: integer expected"; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) + return "encryptedData: buffer expected"; + return null; + }; + + /** + * Creates a PersonalEncryptedNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + */ + PersonalEncryptedNote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); + if (object.rootEncryptionKeyIndex != null) + message.rootEncryptionKeyIndex = object.rootEncryptionKeyIndex >>> 0; + if (object.derivationEncryptionKeyIndex != null) + message.derivationEncryptionKeyIndex = object.derivationEncryptionKeyIndex >>> 0; + if (object.encryptedData != null) + if (typeof object.encryptedData === "string") + $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); + else if (object.encryptedData.length >= 0) + message.encryptedData = object.encryptedData; + return message; + }; + + /** + * Creates a plain object from a PersonalEncryptedNote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} message PersonalEncryptedNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalEncryptedNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rootEncryptionKeyIndex = 0; + object.derivationEncryptionKeyIndex = 0; + if (options.bytes === String) + object.encryptedData = ""; + else { + object.encryptedData = []; + if (options.bytes !== Array) + object.encryptedData = $util.newBuffer(object.encryptedData); + } + } + if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) + object.rootEncryptionKeyIndex = message.rootEncryptionKeyIndex; + if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) + object.derivationEncryptionKeyIndex = message.derivationEncryptionKeyIndex; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; + return object; + }; + + /** + * Converts this PersonalEncryptedNote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + * @returns {Object.} JSON object + */ + PersonalEncryptedNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PersonalEncryptedNote; + })(); + + GetGroupActionsResponseV0.EmergencyActionEvent = (function() { + + /** + * Properties of an EmergencyActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IEmergencyActionEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType|null} [actionType] EmergencyActionEvent actionType + * @property {string|null} [publicNote] EmergencyActionEvent publicNote + */ + + /** + * Constructs a new EmergencyActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an EmergencyActionEvent. + * @implements IEmergencyActionEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set + */ + function EmergencyActionEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmergencyActionEvent actionType. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType} actionType + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + */ + EmergencyActionEvent.prototype.actionType = 0; + + /** + * EmergencyActionEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + */ + EmergencyActionEvent.prototype.publicNote = ""; + + /** + * Creates a new EmergencyActionEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent instance + */ + EmergencyActionEvent.create = function create(properties) { + return new EmergencyActionEvent(properties); + }; + + /** + * Encodes the specified EmergencyActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmergencyActionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionType != null && Object.hasOwnProperty.call(message, "actionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionType); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified EmergencyActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmergencyActionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmergencyActionEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmergencyActionEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.actionType = reader.int32(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmergencyActionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmergencyActionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmergencyActionEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmergencyActionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionType != null && message.hasOwnProperty("actionType")) + switch (message.actionType) { + default: + return "actionType: enum value expected"; + case 0: + case 1: + break; + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an EmergencyActionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + */ + EmergencyActionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); + switch (object.actionType) { + case "PAUSE": + case 0: + message.actionType = 0; + break; + case "RESUME": + case 1: + message.actionType = 1; + break; + } + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an EmergencyActionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} message EmergencyActionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmergencyActionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionType = options.enums === String ? "PAUSE" : 0; + object.publicNote = ""; + } + if (message.actionType != null && message.hasOwnProperty("actionType")) + object.actionType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType[message.actionType] : message.actionType; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this EmergencyActionEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + * @returns {Object.} JSON object + */ + EmergencyActionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionType enum. + * @name org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType + * @enum {number} + * @property {number} PAUSE=0 PAUSE value + * @property {number} RESUME=1 RESUME value + */ + EmergencyActionEvent.ActionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PAUSE"] = 0; + values[valuesById[1] = "RESUME"] = 1; + return values; + })(); + + return EmergencyActionEvent; + })(); + + GetGroupActionsResponseV0.TokenConfigUpdateEvent = (function() { + + /** + * Properties of a TokenConfigUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ITokenConfigUpdateEvent + * @property {Uint8Array|null} [tokenConfigUpdateItem] TokenConfigUpdateEvent tokenConfigUpdateItem + * @property {string|null} [publicNote] TokenConfigUpdateEvent publicNote + */ + + /** + * Constructs a new TokenConfigUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a TokenConfigUpdateEvent. + * @implements ITokenConfigUpdateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set + */ + function TokenConfigUpdateEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenConfigUpdateEvent tokenConfigUpdateItem. + * @member {Uint8Array} tokenConfigUpdateItem + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + */ + TokenConfigUpdateEvent.prototype.tokenConfigUpdateItem = $util.newBuffer([]); + + /** + * TokenConfigUpdateEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + */ + TokenConfigUpdateEvent.prototype.publicNote = ""; + + /** + * Creates a new TokenConfigUpdateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent instance + */ + TokenConfigUpdateEvent.create = function create(properties) { + return new TokenConfigUpdateEvent(properties); + }; + + /** + * Encodes the specified TokenConfigUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenConfigUpdateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenConfigUpdateItem != null && Object.hasOwnProperty.call(message, "tokenConfigUpdateItem")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenConfigUpdateItem); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified TokenConfigUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenConfigUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenConfigUpdateEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenConfigUpdateItem = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenConfigUpdateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenConfigUpdateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenConfigUpdateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) + if (!(message.tokenConfigUpdateItem && typeof message.tokenConfigUpdateItem.length === "number" || $util.isString(message.tokenConfigUpdateItem))) + return "tokenConfigUpdateItem: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a TokenConfigUpdateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + */ + TokenConfigUpdateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); + if (object.tokenConfigUpdateItem != null) + if (typeof object.tokenConfigUpdateItem === "string") + $util.base64.decode(object.tokenConfigUpdateItem, message.tokenConfigUpdateItem = $util.newBuffer($util.base64.length(object.tokenConfigUpdateItem)), 0); + else if (object.tokenConfigUpdateItem.length >= 0) + message.tokenConfigUpdateItem = object.tokenConfigUpdateItem; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a TokenConfigUpdateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} message TokenConfigUpdateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenConfigUpdateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenConfigUpdateItem = ""; + else { + object.tokenConfigUpdateItem = []; + if (options.bytes !== Array) + object.tokenConfigUpdateItem = $util.newBuffer(object.tokenConfigUpdateItem); + } + object.publicNote = ""; + } + if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) + object.tokenConfigUpdateItem = options.bytes === String ? $util.base64.encode(message.tokenConfigUpdateItem, 0, message.tokenConfigUpdateItem.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenConfigUpdateItem) : message.tokenConfigUpdateItem; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this TokenConfigUpdateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + * @returns {Object.} JSON object + */ + TokenConfigUpdateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenConfigUpdateEvent; + })(); + + GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent = (function() { + + /** + * Properties of an UpdateDirectPurchasePriceEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IUpdateDirectPurchasePriceEvent + * @property {number|Long|null} [fixedPrice] UpdateDirectPurchasePriceEvent fixedPrice + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null} [variablePrice] UpdateDirectPurchasePriceEvent variablePrice + * @property {string|null} [publicNote] UpdateDirectPurchasePriceEvent publicNote + */ + + /** + * Constructs a new UpdateDirectPurchasePriceEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an UpdateDirectPurchasePriceEvent. + * @implements IUpdateDirectPurchasePriceEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set + */ + function UpdateDirectPurchasePriceEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDirectPurchasePriceEvent fixedPrice. + * @member {number|Long} fixedPrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UpdateDirectPurchasePriceEvent variablePrice. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null|undefined} variablePrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.variablePrice = null; + + /** + * UpdateDirectPurchasePriceEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.publicNote = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateDirectPurchasePriceEvent price. + * @member {"fixedPrice"|"variablePrice"|undefined} price + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + Object.defineProperty(UpdateDirectPurchasePriceEvent.prototype, "price", { + get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateDirectPurchasePriceEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent instance + */ + UpdateDirectPurchasePriceEvent.create = function create(properties) { + return new UpdateDirectPurchasePriceEvent(properties); + }; + + /** + * Encodes the specified UpdateDirectPurchasePriceEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDirectPurchasePriceEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.fixedPrice); + if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified UpdateDirectPurchasePriceEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDirectPurchasePriceEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDirectPurchasePriceEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fixedPrice = reader.uint64(); + break; + case 2: + message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.decode(reader, reader.uint32()); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDirectPurchasePriceEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDirectPurchasePriceEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDirectPurchasePriceEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + properties.price = 1; + if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) + return "fixedPrice: integer|Long expected"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + if (properties.price === 1) + return "price: multiple values"; + properties.price = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify(message.variablePrice); + if (error) + return "variablePrice." + error; + } + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an UpdateDirectPurchasePriceEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + */ + UpdateDirectPurchasePriceEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); + if (object.fixedPrice != null) + if ($util.Long) + (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; + else if (typeof object.fixedPrice === "string") + message.fixedPrice = parseInt(object.fixedPrice, 10); + else if (typeof object.fixedPrice === "number") + message.fixedPrice = object.fixedPrice; + else if (typeof object.fixedPrice === "object") + message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); + if (object.variablePrice != null) { + if (typeof object.variablePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.variablePrice: object expected"); + message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.fromObject(object.variablePrice); + } + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an UpdateDirectPurchasePriceEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDirectPurchasePriceEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.publicNote = ""; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + if (typeof message.fixedPrice === "number") + object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; + else + object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; + if (options.oneofs) + object.price = "fixedPrice"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + object.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(message.variablePrice, options); + if (options.oneofs) + object.price = "variablePrice"; + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this UpdateDirectPurchasePriceEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + * @returns {Object.} JSON object + */ + UpdateDirectPurchasePriceEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UpdateDirectPurchasePriceEvent.PriceForQuantity = (function() { + + /** + * Properties of a PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @interface IPriceForQuantity + * @property {number|Long|null} [quantity] PriceForQuantity quantity + * @property {number|Long|null} [price] PriceForQuantity price + */ + + /** + * Constructs a new PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @classdesc Represents a PriceForQuantity. + * @implements IPriceForQuantity + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set + */ + function PriceForQuantity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceForQuantity quantity. + * @member {number|Long} quantity + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PriceForQuantity price. + * @member {number|Long} price + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PriceForQuantity instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity instance + */ + PriceForQuantity.create = function create(properties) { + return new PriceForQuantity(properties); + }; + + /** + * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); + return writer; + }; + + /** + * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.uint64(); + break; + case 2: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceForQuantity message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceForQuantity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.price != null && message.hasOwnProperty("price")) + if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) + return "price: integer|Long expected"; + return null; + }; + + /** + * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + */ + PriceForQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + if (object.price != null) + if ($util.Long) + (message.price = $util.Long.fromValue(object.price)).unsigned = true; + else if (typeof object.price === "string") + message.price = parseInt(object.price, 10); + else if (typeof object.price === "number") + message.price = object.price; + else if (typeof object.price === "object") + message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} message PriceForQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceForQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.quantity = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.price = options.longs === String ? "0" : 0; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (message.price != null && message.hasOwnProperty("price")) + if (typeof message.price === "number") + object.price = options.longs === String ? String(message.price) : message.price; + else + object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; + return object; + }; + + /** + * Converts this PriceForQuantity to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + * @returns {Object.} JSON object + */ + PriceForQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceForQuantity; + })(); + + UpdateDirectPurchasePriceEvent.PricingSchedule = (function() { + + /** + * Properties of a PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @interface IPricingSchedule + * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity + */ + + /** + * Constructs a new PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @classdesc Represents a PricingSchedule. + * @implements IPricingSchedule + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set + */ + function PricingSchedule(properties) { + this.priceForQuantity = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PricingSchedule priceForQuantity. + * @member {Array.} priceForQuantity + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @instance + */ + PricingSchedule.prototype.priceForQuantity = $util.emptyArray; + + /** + * Creates a new PricingSchedule instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule instance + */ + PricingSchedule.create = function create(properties) { + return new PricingSchedule(properties); + }; + + /** + * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priceForQuantity != null && message.priceForQuantity.length) + for (var i = 0; i < message.priceForQuantity.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.priceForQuantity && message.priceForQuantity.length)) + message.priceForQuantity = []; + message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PricingSchedule message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PricingSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { + if (!Array.isArray(message.priceForQuantity)) + return "priceForQuantity: array expected"; + for (var i = 0; i < message.priceForQuantity.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify(message.priceForQuantity[i]); + if (error) + return "priceForQuantity." + error; + } + } + return null; + }; + + /** + * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + */ + PricingSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); + if (object.priceForQuantity) { + if (!Array.isArray(object.priceForQuantity)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: array expected"); + message.priceForQuantity = []; + for (var i = 0; i < object.priceForQuantity.length; ++i) { + if (typeof object.priceForQuantity[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: object expected"); + message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.fromObject(object.priceForQuantity[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} message PricingSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PricingSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.priceForQuantity = []; + if (message.priceForQuantity && message.priceForQuantity.length) { + object.priceForQuantity = []; + for (var j = 0; j < message.priceForQuantity.length; ++j) + object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject(message.priceForQuantity[j], options); + } + return object; + }; + + /** + * Converts this PricingSchedule to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @instance + * @returns {Object.} JSON object + */ + PricingSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PricingSchedule; + })(); + + return UpdateDirectPurchasePriceEvent; + })(); + + GetGroupActionsResponseV0.GroupActionEvent = (function() { + + /** + * Properties of a GroupActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActionEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null} [tokenEvent] GroupActionEvent tokenEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null} [documentEvent] GroupActionEvent documentEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null} [contractEvent] GroupActionEvent contractEvent + */ + + /** + * Constructs a new GroupActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActionEvent. + * @implements IGroupActionEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set + */ + function GroupActionEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActionEvent tokenEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null|undefined} tokenEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.tokenEvent = null; + + /** + * GroupActionEvent documentEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null|undefined} documentEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.documentEvent = null; + + /** + * GroupActionEvent contractEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null|undefined} contractEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.contractEvent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GroupActionEvent eventType. + * @member {"tokenEvent"|"documentEvent"|"contractEvent"|undefined} eventType + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + Object.defineProperty(GroupActionEvent.prototype, "eventType", { + get: $util.oneOfGetter($oneOfFields = ["tokenEvent", "documentEvent", "contractEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroupActionEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent instance + */ + GroupActionEvent.create = function create(properties) { + return new GroupActionEvent(properties); + }; + + /** + * Encodes the specified GroupActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenEvent != null && Object.hasOwnProperty.call(message, "tokenEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.encode(message.tokenEvent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentEvent != null && Object.hasOwnProperty.call(message, "documentEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.encode(message.documentEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contractEvent != null && Object.hasOwnProperty.call(message, "contractEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.encode(message.contractEvent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.decode(reader, reader.uint32()); + break; + case 2: + message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.decode(reader, reader.uint32()); + break; + case 3: + message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify(message.tokenEvent); + if (error) + return "tokenEvent." + error; + } + } + if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { + if (properties.eventType === 1) + return "eventType: multiple values"; + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify(message.documentEvent); + if (error) + return "documentEvent." + error; + } + } + if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { + if (properties.eventType === 1) + return "eventType: multiple values"; + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify(message.contractEvent); + if (error) + return "contractEvent." + error; + } + } + return null; + }; + + /** + * Creates a GroupActionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + */ + GroupActionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); + if (object.tokenEvent != null) { + if (typeof object.tokenEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.tokenEvent: object expected"); + message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.fromObject(object.tokenEvent); + } + if (object.documentEvent != null) { + if (typeof object.documentEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.documentEvent: object expected"); + message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.fromObject(object.documentEvent); + } + if (object.contractEvent != null) { + if (typeof object.contractEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.contractEvent: object expected"); + message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.fromObject(object.contractEvent); + } + return message; + }; + + /** + * Creates a plain object from a GroupActionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} message GroupActionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { + object.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.toObject(message.tokenEvent, options); + if (options.oneofs) + object.eventType = "tokenEvent"; + } + if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { + object.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.toObject(message.documentEvent, options); + if (options.oneofs) + object.eventType = "documentEvent"; + } + if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { + object.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.toObject(message.contractEvent, options); + if (options.oneofs) + object.eventType = "contractEvent"; + } + return object; + }; + + /** + * Converts this GroupActionEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + * @returns {Object.} JSON object + */ + GroupActionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionEvent; + })(); + + GetGroupActionsResponseV0.DocumentEvent = (function() { + + /** + * Properties of a DocumentEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDocumentEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null} [create] DocumentEvent create + */ + + /** + * Constructs a new DocumentEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DocumentEvent. + * @implements IDocumentEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set + */ + function DocumentEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentEvent create. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null|undefined} create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + */ + DocumentEvent.prototype.create = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DocumentEvent type. + * @member {"create"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + */ + Object.defineProperty(DocumentEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["create"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent instance + */ + DocumentEvent.create = function create(properties) { + return new DocumentEvent(properties); + }; + + /** + * Encodes the specified DocumentEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.create != null && Object.hasOwnProperty.call(message, "create")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.encode(message.create, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.create != null && message.hasOwnProperty("create")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify(message.create); + if (error) + return "create." + error; + } + } + return null; + }; + + /** + * Creates a DocumentEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + */ + DocumentEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); + if (object.create != null) { + if (typeof object.create !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.create: object expected"); + message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.fromObject(object.create); + } + return message; + }; + + /** + * Creates a plain object from a DocumentEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} message DocumentEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.create != null && message.hasOwnProperty("create")) { + object.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.toObject(message.create, options); + if (options.oneofs) + object.type = "create"; + } + return object; + }; + + /** + * Converts this DocumentEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + * @returns {Object.} JSON object + */ + DocumentEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentEvent; + })(); + + GetGroupActionsResponseV0.DocumentCreateEvent = (function() { + + /** + * Properties of a DocumentCreateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDocumentCreateEvent + * @property {Uint8Array|null} [createdDocument] DocumentCreateEvent createdDocument + */ + + /** + * Constructs a new DocumentCreateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DocumentCreateEvent. + * @implements IDocumentCreateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set + */ + function DocumentCreateEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentCreateEvent createdDocument. + * @member {Uint8Array} createdDocument + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @instance + */ + DocumentCreateEvent.prototype.createdDocument = $util.newBuffer([]); + + /** + * Creates a new DocumentCreateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent instance + */ + DocumentCreateEvent.create = function create(properties) { + return new DocumentCreateEvent(properties); + }; + + /** + * Encodes the specified DocumentCreateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentCreateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createdDocument != null && Object.hasOwnProperty.call(message, "createdDocument")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.createdDocument); + return writer; + }; + + /** + * Encodes the specified DocumentCreateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentCreateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentCreateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentCreateEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createdDocument = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentCreateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentCreateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentCreateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentCreateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) + if (!(message.createdDocument && typeof message.createdDocument.length === "number" || $util.isString(message.createdDocument))) + return "createdDocument: buffer expected"; + return null; + }; + + /** + * Creates a DocumentCreateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + */ + DocumentCreateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); + if (object.createdDocument != null) + if (typeof object.createdDocument === "string") + $util.base64.decode(object.createdDocument, message.createdDocument = $util.newBuffer($util.base64.length(object.createdDocument)), 0); + else if (object.createdDocument.length >= 0) + message.createdDocument = object.createdDocument; + return message; + }; + + /** + * Creates a plain object from a DocumentCreateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} message DocumentCreateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentCreateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.createdDocument = ""; + else { + object.createdDocument = []; + if (options.bytes !== Array) + object.createdDocument = $util.newBuffer(object.createdDocument); + } + if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) + object.createdDocument = options.bytes === String ? $util.base64.encode(message.createdDocument, 0, message.createdDocument.length) : options.bytes === Array ? Array.prototype.slice.call(message.createdDocument) : message.createdDocument; + return object; + }; + + /** + * Converts this DocumentCreateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @instance + * @returns {Object.} JSON object + */ + DocumentCreateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentCreateEvent; + })(); + + GetGroupActionsResponseV0.ContractUpdateEvent = (function() { + + /** + * Properties of a ContractUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IContractUpdateEvent + * @property {Uint8Array|null} [updatedContract] ContractUpdateEvent updatedContract + */ + + /** + * Constructs a new ContractUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a ContractUpdateEvent. + * @implements IContractUpdateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set + */ + function ContractUpdateEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContractUpdateEvent updatedContract. + * @member {Uint8Array} updatedContract + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @instance + */ + ContractUpdateEvent.prototype.updatedContract = $util.newBuffer([]); + + /** + * Creates a new ContractUpdateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent instance + */ + ContractUpdateEvent.create = function create(properties) { + return new ContractUpdateEvent(properties); + }; + + /** + * Encodes the specified ContractUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractUpdateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updatedContract != null && Object.hasOwnProperty.call(message, "updatedContract")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.updatedContract); + return writer; + }; + + /** + * Encodes the specified ContractUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractUpdateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractUpdateEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updatedContract = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractUpdateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractUpdateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractUpdateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractUpdateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) + if (!(message.updatedContract && typeof message.updatedContract.length === "number" || $util.isString(message.updatedContract))) + return "updatedContract: buffer expected"; + return null; + }; + + /** + * Creates a ContractUpdateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + */ + ContractUpdateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); + if (object.updatedContract != null) + if (typeof object.updatedContract === "string") + $util.base64.decode(object.updatedContract, message.updatedContract = $util.newBuffer($util.base64.length(object.updatedContract)), 0); + else if (object.updatedContract.length >= 0) + message.updatedContract = object.updatedContract; + return message; + }; + + /** + * Creates a plain object from a ContractUpdateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} message ContractUpdateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractUpdateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.updatedContract = ""; + else { + object.updatedContract = []; + if (options.bytes !== Array) + object.updatedContract = $util.newBuffer(object.updatedContract); + } + if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) + object.updatedContract = options.bytes === String ? $util.base64.encode(message.updatedContract, 0, message.updatedContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.updatedContract) : message.updatedContract; + return object; + }; + + /** + * Converts this ContractUpdateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @instance + * @returns {Object.} JSON object + */ + ContractUpdateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractUpdateEvent; + })(); + + GetGroupActionsResponseV0.ContractEvent = (function() { + + /** + * Properties of a ContractEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IContractEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null} [update] ContractEvent update + */ + + /** + * Constructs a new ContractEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a ContractEvent. + * @implements IContractEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set + */ + function ContractEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContractEvent update. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null|undefined} update + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + */ + ContractEvent.prototype.update = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContractEvent type. + * @member {"update"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + */ + Object.defineProperty(ContractEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["update"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent instance + */ + ContractEvent.create = function create(properties) { + return new ContractEvent(properties); + }; + + /** + * Encodes the specified ContractEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContractEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.update != null && message.hasOwnProperty("update")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify(message.update); + if (error) + return "update." + error; + } + } + return null; + }; + + /** + * Creates a ContractEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + */ + ContractEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.update: object expected"); + message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.fromObject(object.update); + } + return message; + }; + + /** + * Creates a plain object from a ContractEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} message ContractEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.toObject(message.update, options); + if (options.oneofs) + object.type = "update"; + } + return object; + }; + + /** + * Converts this ContractEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + * @returns {Object.} JSON object + */ + ContractEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractEvent; + })(); + + GetGroupActionsResponseV0.TokenEvent = (function() { + + /** + * Properties of a TokenEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ITokenEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null} [mint] TokenEvent mint + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null} [burn] TokenEvent burn + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null} [freeze] TokenEvent freeze + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null} [unfreeze] TokenEvent unfreeze + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null} [destroyFrozenFunds] TokenEvent destroyFrozenFunds + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null} [emergencyAction] TokenEvent emergencyAction + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null} [tokenConfigUpdate] TokenEvent tokenConfigUpdate + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null} [updatePrice] TokenEvent updatePrice + */ + + /** + * Constructs a new TokenEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a TokenEvent. + * @implements ITokenEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set + */ + function TokenEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenEvent mint. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null|undefined} mint + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.mint = null; + + /** + * TokenEvent burn. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null|undefined} burn + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.burn = null; + + /** + * TokenEvent freeze. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null|undefined} freeze + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.freeze = null; + + /** + * TokenEvent unfreeze. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null|undefined} unfreeze + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.unfreeze = null; + + /** + * TokenEvent destroyFrozenFunds. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null|undefined} destroyFrozenFunds + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.destroyFrozenFunds = null; + + /** + * TokenEvent emergencyAction. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null|undefined} emergencyAction + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.emergencyAction = null; + + /** + * TokenEvent tokenConfigUpdate. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null|undefined} tokenConfigUpdate + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.tokenConfigUpdate = null; + + /** + * TokenEvent updatePrice. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null|undefined} updatePrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.updatePrice = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TokenEvent type. + * @member {"mint"|"burn"|"freeze"|"unfreeze"|"destroyFrozenFunds"|"emergencyAction"|"tokenConfigUpdate"|"updatePrice"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + Object.defineProperty(TokenEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["mint", "burn", "freeze", "unfreeze", "destroyFrozenFunds", "emergencyAction", "tokenConfigUpdate", "updatePrice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TokenEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent instance + */ + TokenEvent.create = function create(properties) { + return new TokenEvent(properties); + }; + + /** + * Encodes the specified TokenEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mint != null && Object.hasOwnProperty.call(message, "mint")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.encode(message.mint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.burn != null && Object.hasOwnProperty.call(message, "burn")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.encode(message.burn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.freeze != null && Object.hasOwnProperty.call(message, "freeze")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.encode(message.freeze, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.unfreeze != null && Object.hasOwnProperty.call(message, "unfreeze")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.encode(message.unfreeze, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.destroyFrozenFunds != null && Object.hasOwnProperty.call(message, "destroyFrozenFunds")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.encode(message.destroyFrozenFunds, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.emergencyAction != null && Object.hasOwnProperty.call(message, "emergencyAction")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.encode(message.emergencyAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tokenConfigUpdate != null && Object.hasOwnProperty.call(message, "tokenConfigUpdate")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.encode(message.tokenConfigUpdate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updatePrice != null && Object.hasOwnProperty.call(message, "updatePrice")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.encode(message.updatePrice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.decode(reader, reader.uint32()); + break; + case 2: + message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.decode(reader, reader.uint32()); + break; + case 3: + message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.decode(reader, reader.uint32()); + break; + case 4: + message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.decode(reader, reader.uint32()); + break; + case 5: + message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.decode(reader, reader.uint32()); + break; + case 6: + message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.decode(reader, reader.uint32()); + break; + case 7: + message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.decode(reader, reader.uint32()); + break; + case 8: + message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mint != null && message.hasOwnProperty("mint")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify(message.mint); + if (error) + return "mint." + error; + } + } + if (message.burn != null && message.hasOwnProperty("burn")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify(message.burn); + if (error) + return "burn." + error; + } + } + if (message.freeze != null && message.hasOwnProperty("freeze")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify(message.freeze); + if (error) + return "freeze." + error; + } + } + if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify(message.unfreeze); + if (error) + return "unfreeze." + error; + } + } + if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify(message.destroyFrozenFunds); + if (error) + return "destroyFrozenFunds." + error; + } + } + if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify(message.emergencyAction); + if (error) + return "emergencyAction." + error; + } + } + if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify(message.tokenConfigUpdate); + if (error) + return "tokenConfigUpdate." + error; + } + } + if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify(message.updatePrice); + if (error) + return "updatePrice." + error; + } + } + return null; + }; + + /** + * Creates a TokenEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + */ + TokenEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); + if (object.mint != null) { + if (typeof object.mint !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.mint: object expected"); + message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.fromObject(object.mint); + } + if (object.burn != null) { + if (typeof object.burn !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.burn: object expected"); + message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.fromObject(object.burn); + } + if (object.freeze != null) { + if (typeof object.freeze !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.freeze: object expected"); + message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.fromObject(object.freeze); + } + if (object.unfreeze != null) { + if (typeof object.unfreeze !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.unfreeze: object expected"); + message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.fromObject(object.unfreeze); + } + if (object.destroyFrozenFunds != null) { + if (typeof object.destroyFrozenFunds !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.destroyFrozenFunds: object expected"); + message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.fromObject(object.destroyFrozenFunds); + } + if (object.emergencyAction != null) { + if (typeof object.emergencyAction !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.emergencyAction: object expected"); + message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.fromObject(object.emergencyAction); + } + if (object.tokenConfigUpdate != null) { + if (typeof object.tokenConfigUpdate !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.tokenConfigUpdate: object expected"); + message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.fromObject(object.tokenConfigUpdate); + } + if (object.updatePrice != null) { + if (typeof object.updatePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.updatePrice: object expected"); + message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.fromObject(object.updatePrice); + } + return message; + }; + + /** + * Creates a plain object from a TokenEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} message TokenEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.mint != null && message.hasOwnProperty("mint")) { + object.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.toObject(message.mint, options); + if (options.oneofs) + object.type = "mint"; + } + if (message.burn != null && message.hasOwnProperty("burn")) { + object.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.toObject(message.burn, options); + if (options.oneofs) + object.type = "burn"; + } + if (message.freeze != null && message.hasOwnProperty("freeze")) { + object.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.toObject(message.freeze, options); + if (options.oneofs) + object.type = "freeze"; + } + if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { + object.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.toObject(message.unfreeze, options); + if (options.oneofs) + object.type = "unfreeze"; + } + if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { + object.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.toObject(message.destroyFrozenFunds, options); + if (options.oneofs) + object.type = "destroyFrozenFunds"; + } + if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { + object.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.toObject(message.emergencyAction, options); + if (options.oneofs) + object.type = "emergencyAction"; + } + if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { + object.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(message.tokenConfigUpdate, options); + if (options.oneofs) + object.type = "tokenConfigUpdate"; + } + if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { + object.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(message.updatePrice, options); + if (options.oneofs) + object.type = "updatePrice"; + } + return object; + }; + + /** + * Converts this TokenEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + * @returns {Object.} JSON object + */ + TokenEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenEvent; + })(); + + GetGroupActionsResponseV0.GroupActionEntry = (function() { + + /** + * Properties of a GroupActionEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActionEntry + * @property {Uint8Array|null} [actionId] GroupActionEntry actionId + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null} [event] GroupActionEntry event + */ + + /** + * Constructs a new GroupActionEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActionEntry. + * @implements IGroupActionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set + */ + function GroupActionEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActionEntry actionId. + * @member {Uint8Array} actionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + */ + GroupActionEntry.prototype.actionId = $util.newBuffer([]); + + /** + * GroupActionEntry event. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null|undefined} event + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + */ + GroupActionEntry.prototype.event = null; + + /** + * Creates a new GroupActionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry instance + */ + GroupActionEntry.create = function create(properties) { + return new GroupActionEntry(properties); + }; + + /** + * Encodes the specified GroupActionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.actionId); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.actionId = reader.bytes(); + break; + case 2: + message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) + return "actionId: buffer expected"; + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify(message.event); + if (error) + return "event." + error; + } + return null; + }; + + /** + * Creates a GroupActionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + */ + GroupActionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); + if (object.actionId != null) + if (typeof object.actionId === "string") + $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); + else if (object.actionId.length >= 0) + message.actionId = object.actionId; + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.event: object expected"); + message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.fromObject(object.event); + } + return message; + }; + + /** + * Creates a plain object from a GroupActionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} message GroupActionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.actionId = ""; + else { + object.actionId = []; + if (options.bytes !== Array) + object.actionId = $util.newBuffer(object.actionId); + } + object.event = null; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.toObject(message.event, options); + return object; + }; + + /** + * Converts this GroupActionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + * @returns {Object.} JSON object + */ + GroupActionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionEntry; + })(); + + GetGroupActionsResponseV0.GroupActions = (function() { + + /** + * Properties of a GroupActions. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActions + * @property {Array.|null} [groupActions] GroupActions groupActions + */ + + /** + * Constructs a new GroupActions. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActions. + * @implements IGroupActions + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set + */ + function GroupActions(properties) { + this.groupActions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActions groupActions. + * @member {Array.} groupActions + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @instance + */ + GroupActions.prototype.groupActions = $util.emptyArray; + + /** + * Creates a new GroupActions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions instance + */ + GroupActions.create = function create(properties) { + return new GroupActions(properties); + }; + + /** + * Encodes the specified GroupActions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActions != null && message.groupActions.length) + for (var i = 0; i < message.groupActions.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.encode(message.groupActions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupActions && message.groupActions.length)) + message.groupActions = []; + message.groupActions.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + if (!Array.isArray(message.groupActions)) + return "groupActions: array expected"; + for (var i = 0; i < message.groupActions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify(message.groupActions[i]); + if (error) + return "groupActions." + error; + } + } + return null; + }; + + /** + * Creates a GroupActions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + */ + GroupActions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); + if (object.groupActions) { + if (!Array.isArray(object.groupActions)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: array expected"); + message.groupActions = []; + for (var i = 0; i < object.groupActions.length; ++i) { + if (typeof object.groupActions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: object expected"); + message.groupActions[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.fromObject(object.groupActions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupActions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} message GroupActions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupActions = []; + if (message.groupActions && message.groupActions.length) { + object.groupActions = []; + for (var j = 0; j < message.groupActions.length; ++j) + object.groupActions[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.toObject(message.groupActions[j], options); + } + return object; + }; + + /** + * Converts this GroupActions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @instance + * @returns {Object.} JSON object + */ + GroupActions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActions; + })(); + + return GetGroupActionsResponseV0; + })(); + + return GetGroupActionsResponse; + })(); + + v0.GetGroupActionSignersRequest = (function() { + + /** + * Properties of a GetGroupActionSignersRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionSignersRequest + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null} [v0] GetGroupActionSignersRequest v0 + */ + + /** + * Constructs a new GetGroupActionSignersRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionSignersRequest. + * @implements IGetGroupActionSignersRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set + */ + function GetGroupActionSignersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionSignersRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + */ + GetGroupActionSignersRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + */ + Object.defineProperty(GetGroupActionSignersRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest instance + */ + GetGroupActionSignersRequest.create = function create(properties) { + return new GetGroupActionSignersRequest(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionSignersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + */ + GetGroupActionSignersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} message GetGroupActionSignersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionSignersRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionStatus enum. + * @name org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus + * @enum {number} + * @property {number} ACTIVE=0 ACTIVE value + * @property {number} CLOSED=1 CLOSED value + */ + GetGroupActionSignersRequest.ActionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVE"] = 0; + values[valuesById[1] = "CLOSED"] = 1; + return values; + })(); + + GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 = (function() { + + /** + * Properties of a GetGroupActionSignersRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @interface IGetGroupActionSignersRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupActionSignersRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupActionSignersRequestV0 groupContractPosition + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus|null} [status] GetGroupActionSignersRequestV0 status + * @property {Uint8Array|null} [actionId] GetGroupActionSignersRequestV0 actionId + * @property {boolean|null} [prove] GetGroupActionSignersRequestV0 prove + */ + + /** + * Constructs a new GetGroupActionSignersRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @classdesc Represents a GetGroupActionSignersRequestV0. + * @implements IGetGroupActionSignersRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set + */ + function GetGroupActionSignersRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionSignersRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupActionSignersRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupActionSignersRequestV0 status. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus} status + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.status = 0; + + /** + * GetGroupActionSignersRequestV0 actionId. + * @member {Uint8Array} actionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.actionId = $util.newBuffer([]); + + /** + * GetGroupActionSignersRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupActionSignersRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 instance + */ + GetGroupActionSignersRequestV0.create = function create(properties) { + return new GetGroupActionSignersRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.actionId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.actionId = reader.bytes(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + break; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) + return "actionId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupActionSignersRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + */ + GetGroupActionSignersRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + switch (object.status) { + case "ACTIVE": + case 0: + message.status = 0; + break; + case "CLOSED": + case 1: + message.status = 1; + break; + } + if (object.actionId != null) + if (typeof object.actionId === "string") + $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); + else if (object.actionId.length >= 0) + message.actionId = object.actionId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.status = options.enums === String ? "ACTIVE" : 0; + if (options.bytes === String) + object.actionId = ""; + else { + object.actionId = []; + if (options.bytes !== Array) + object.actionId = $util.newBuffer(object.actionId); + } + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus[message.status] : message.status; + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupActionSignersRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupActionSignersRequestV0; + })(); + + return GetGroupActionSignersRequest; + })(); + + v0.GetGroupActionSignersResponse = (function() { + + /** + * Properties of a GetGroupActionSignersResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionSignersResponse + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null} [v0] GetGroupActionSignersResponse v0 + */ + + /** + * Constructs a new GetGroupActionSignersResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionSignersResponse. + * @implements IGetGroupActionSignersResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set + */ + function GetGroupActionSignersResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionSignersResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + */ + GetGroupActionSignersResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + */ + Object.defineProperty(GetGroupActionSignersResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse instance + */ + GetGroupActionSignersResponse.create = function create(properties) { + return new GetGroupActionSignersResponse(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionSignersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + */ + GetGroupActionSignersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} message GetGroupActionSignersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionSignersResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 = (function() { + + /** + * Properties of a GetGroupActionSignersResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @interface IGetGroupActionSignersResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null} [groupActionSigners] GetGroupActionSignersResponseV0 groupActionSigners + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionSignersResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionSignersResponseV0 metadata + */ + + /** + * Constructs a new GetGroupActionSignersResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @classdesc Represents a GetGroupActionSignersResponseV0. + * @implements IGetGroupActionSignersResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set + */ + function GetGroupActionSignersResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionSignersResponseV0 groupActionSigners. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null|undefined} groupActionSigners + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.groupActionSigners = null; + + /** + * GetGroupActionSignersResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.proof = null; + + /** + * GetGroupActionSignersResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersResponseV0 result. + * @member {"groupActionSigners"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + Object.defineProperty(GetGroupActionSignersResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupActionSigners", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 instance + */ + GetGroupActionSignersResponseV0.create = function create(properties) { + return new GetGroupActionSignersResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActionSigners != null && Object.hasOwnProperty.call(message, "groupActionSigners")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.encode(message.groupActionSigners, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify(message.groupActionSigners); + if (error) + return "groupActionSigners." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupActionSignersResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + */ + GetGroupActionSignersResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); + if (object.groupActionSigners != null) { + if (typeof object.groupActionSigners !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.groupActionSigners: object expected"); + message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.fromObject(object.groupActionSigners); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { + object.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.toObject(message.groupActionSigners, options); + if (options.oneofs) + object.result = "groupActionSigners"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupActionSignersResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionSignersResponseV0.GroupActionSigner = (function() { + + /** + * Properties of a GroupActionSigner. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @interface IGroupActionSigner + * @property {Uint8Array|null} [signerId] GroupActionSigner signerId + * @property {number|null} [power] GroupActionSigner power + */ + + /** + * Constructs a new GroupActionSigner. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @classdesc Represents a GroupActionSigner. + * @implements IGroupActionSigner + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set + */ + function GroupActionSigner(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActionSigner signerId. + * @member {Uint8Array} signerId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + */ + GroupActionSigner.prototype.signerId = $util.newBuffer([]); + + /** + * GroupActionSigner power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + */ + GroupActionSigner.prototype.power = 0; + + /** + * Creates a new GroupActionSigner instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner instance + */ + GroupActionSigner.create = function create(properties) { + return new GroupActionSigner(properties); + }; + + /** + * Encodes the specified GroupActionSigner message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigner.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signerId != null && Object.hasOwnProperty.call(message, "signerId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signerId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupActionSigner message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigner.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionSigner message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigner.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionSigner message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigner.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionSigner message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionSigner.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signerId != null && message.hasOwnProperty("signerId")) + if (!(message.signerId && typeof message.signerId.length === "number" || $util.isString(message.signerId))) + return "signerId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupActionSigner message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + */ + GroupActionSigner.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); + if (object.signerId != null) + if (typeof object.signerId === "string") + $util.base64.decode(object.signerId, message.signerId = $util.newBuffer($util.base64.length(object.signerId)), 0); + else if (object.signerId.length >= 0) + message.signerId = object.signerId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupActionSigner message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} message GroupActionSigner + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionSigner.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.signerId = ""; + else { + object.signerId = []; + if (options.bytes !== Array) + object.signerId = $util.newBuffer(object.signerId); + } + object.power = 0; + } + if (message.signerId != null && message.hasOwnProperty("signerId")) + object.signerId = options.bytes === String ? $util.base64.encode(message.signerId, 0, message.signerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.signerId) : message.signerId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupActionSigner to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + * @returns {Object.} JSON object + */ + GroupActionSigner.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionSigner; + })(); + + GetGroupActionSignersResponseV0.GroupActionSigners = (function() { + + /** + * Properties of a GroupActionSigners. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @interface IGroupActionSigners + * @property {Array.|null} [signers] GroupActionSigners signers + */ + + /** + * Constructs a new GroupActionSigners. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @classdesc Represents a GroupActionSigners. + * @implements IGroupActionSigners + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set + */ + function GroupActionSigners(properties) { + this.signers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActionSigners signers. + * @member {Array.} signers + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @instance + */ + GroupActionSigners.prototype.signers = $util.emptyArray; + + /** + * Creates a new GroupActionSigners instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners instance + */ + GroupActionSigners.create = function create(properties) { + return new GroupActionSigners(properties); + }; + + /** + * Encodes the specified GroupActionSigners message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigners.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signers != null && message.signers.length) + for (var i = 0; i < message.signers.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.encode(message.signers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionSigners message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigners.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionSigners message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigners.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signers && message.signers.length)) + message.signers = []; + message.signers.push($root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionSigners message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigners.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionSigners message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionSigners.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signers != null && message.hasOwnProperty("signers")) { + if (!Array.isArray(message.signers)) + return "signers: array expected"; + for (var i = 0; i < message.signers.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify(message.signers[i]); + if (error) + return "signers." + error; + } + } + return null; + }; + + /** + * Creates a GroupActionSigners message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + */ + GroupActionSigners.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); + if (object.signers) { + if (!Array.isArray(object.signers)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: array expected"); + message.signers = []; + for (var i = 0; i < object.signers.length; ++i) { + if (typeof object.signers[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: object expected"); + message.signers[i] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.fromObject(object.signers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupActionSigners message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} message GroupActionSigners + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionSigners.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signers = []; + if (message.signers && message.signers.length) { + object.signers = []; + for (var j = 0; j < message.signers.length; ++j) + object.signers[j] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.toObject(message.signers[j], options); + } + return object; + }; + + /** + * Converts this GroupActionSigners to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @instance + * @returns {Object.} JSON object + */ + GroupActionSigners.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionSigners; + })(); + + return GetGroupActionSignersResponseV0; + })(); + + return GetGroupActionSignersResponse; + })(); + + return v0; + })(); + + return dapi; + })(); + + return platform; + })(); + + return dash; + })(); + + return org; +})(); + +$root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BytesValue; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = 0; + + /** + * Value numberValue. + * @member {number} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = 0; + + /** + * Value stringValue. + * @member {string} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = ""; + + /** + * Value boolValue. + * @member {boolean} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = false; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nullValue = reader.int32(); + break; + case 2: + message.numberValue = reader.double(); + break; + case 3: + message.stringValue = reader.string(); + break; + case 4: + message.boolValue = reader.bool(); + break; + case 5: + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 6: + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + return google; +})(); + module.exports = $root; diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js index dfbcb436b02..cfe37816bda 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -9,4 +9,70610 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut // Exported root namespace var $root = $protobuf.roots.platform_root || ($protobuf.roots.platform_root = {}); +$root.org = (function() { + + /** + * Namespace org. + * @exports org + * @namespace + */ + var org = {}; + + org.dash = (function() { + + /** + * Namespace dash. + * @memberof org + * @namespace + */ + var dash = {}; + + dash.platform = (function() { + + /** + * Namespace platform. + * @memberof org.dash + * @namespace + */ + var platform = {}; + + platform.dapi = (function() { + + /** + * Namespace dapi. + * @memberof org.dash.platform + * @namespace + */ + var dapi = {}; + + dapi.v0 = (function() { + + /** + * Namespace v0. + * @memberof org.dash.platform.dapi + * @namespace + */ + var v0 = {}; + + v0.Platform = (function() { + + /** + * Constructs a new Platform service. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a Platform + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Platform(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Platform.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Platform; + + /** + * Creates new Platform service using the specified rpc implementation. + * @function create + * @memberof org.dash.platform.dapi.v0.Platform + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Platform} RPC service. Useful where requests and/or responses are streamed. + */ + Platform.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#broadcastStateTransition}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef broadcastStateTransitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} [response] BroadcastStateTransitionResponse + */ + + /** + * Calls broadcastStateTransition. + * @function broadcastStateTransition + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.broadcastStateTransitionCallback} callback Node-style callback called with the error, if any, and BroadcastStateTransitionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.broadcastStateTransition = function broadcastStateTransition(request, callback) { + return this.rpcCall(broadcastStateTransition, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest, $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse, request, callback); + }, "name", { value: "broadcastStateTransition" }); + + /** + * Calls broadcastStateTransition. + * @function broadcastStateTransition + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} request BroadcastStateTransitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentity}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityResponse} [response] GetIdentityResponse + */ + + /** + * Calls getIdentity. + * @function getIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityCallback} callback Node-style callback called with the error, if any, and GetIdentityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentity = function getIdentity(request, callback) { + return this.rpcCall(getIdentity, $root.org.dash.platform.dapi.v0.GetIdentityRequest, $root.org.dash.platform.dapi.v0.GetIdentityResponse, request, callback); + }, "name", { value: "getIdentity" }); + + /** + * Calls getIdentity. + * @function getIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityKeys}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} [response] GetIdentityKeysResponse + */ + + /** + * Calls getIdentityKeys. + * @function getIdentityKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityKeysCallback} callback Node-style callback called with the error, if any, and GetIdentityKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityKeys = function getIdentityKeys(request, callback) { + return this.rpcCall(getIdentityKeys, $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse, request, callback); + }, "name", { value: "getIdentityKeys" }); + + /** + * Calls getIdentityKeys. + * @function getIdentityKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesContractKeys}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesContractKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} [response] GetIdentitiesContractKeysResponse + */ + + /** + * Calls getIdentitiesContractKeys. + * @function getIdentitiesContractKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesContractKeysCallback} callback Node-style callback called with the error, if any, and GetIdentitiesContractKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesContractKeys = function getIdentitiesContractKeys(request, callback) { + return this.rpcCall(getIdentitiesContractKeys, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse, request, callback); + }, "name", { value: "getIdentitiesContractKeys" }); + + /** + * Calls getIdentitiesContractKeys. + * @function getIdentitiesContractKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} request GetIdentitiesContractKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityNonce}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityNonceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} [response] GetIdentityNonceResponse + */ + + /** + * Calls getIdentityNonce. + * @function getIdentityNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityNonceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityNonce = function getIdentityNonce(request, callback) { + return this.rpcCall(getIdentityNonce, $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse, request, callback); + }, "name", { value: "getIdentityNonce" }); + + /** + * Calls getIdentityNonce. + * @function getIdentityNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} request GetIdentityNonceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityContractNonce}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityContractNonceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} [response] GetIdentityContractNonceResponse + */ + + /** + * Calls getIdentityContractNonce. + * @function getIdentityContractNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityContractNonceCallback} callback Node-style callback called with the error, if any, and GetIdentityContractNonceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityContractNonce = function getIdentityContractNonce(request, callback) { + return this.rpcCall(getIdentityContractNonce, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest, $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse, request, callback); + }, "name", { value: "getIdentityContractNonce" }); + + /** + * Calls getIdentityContractNonce. + * @function getIdentityContractNonce + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} request GetIdentityContractNonceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalance}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityBalanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} [response] GetIdentityBalanceResponse + */ + + /** + * Calls getIdentityBalance. + * @function getIdentityBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityBalance = function getIdentityBalance(request, callback) { + return this.rpcCall(getIdentityBalance, $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse, request, callback); + }, "name", { value: "getIdentityBalance" }); + + /** + * Calls getIdentityBalance. + * @function getIdentityBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} request GetIdentityBalanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} [response] GetIdentitiesBalancesResponse + */ + + /** + * Calls getIdentitiesBalances. + * @function getIdentitiesBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesBalances = function getIdentitiesBalances(request, callback) { + return this.rpcCall(getIdentitiesBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse, request, callback); + }, "name", { value: "getIdentitiesBalances" }); + + /** + * Calls getIdentitiesBalances. + * @function getIdentitiesBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} request GetIdentitiesBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalanceAndRevision}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityBalanceAndRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} [response] GetIdentityBalanceAndRevisionResponse + */ + + /** + * Calls getIdentityBalanceAndRevision. + * @function getIdentityBalanceAndRevision + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceAndRevisionCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceAndRevisionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(request, callback) { + return this.rpcCall(getIdentityBalanceAndRevision, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse, request, callback); + }, "name", { value: "getIdentityBalanceAndRevision" }); + + /** + * Calls getIdentityBalanceAndRevision. + * @function getIdentityBalanceAndRevision + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} request GetIdentityBalanceAndRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByIds}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEvonodesProposedEpochBlocksByIdsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse + */ + + /** + * Calls getEvonodesProposedEpochBlocksByIds. + * @function getEvonodesProposedEpochBlocksByIds + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByIdsCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByIds = function getEvonodesProposedEpochBlocksByIds(request, callback) { + return this.rpcCall(getEvonodesProposedEpochBlocksByIds, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); + }, "name", { value: "getEvonodesProposedEpochBlocksByIds" }); + + /** + * Calls getEvonodesProposedEpochBlocksByIds. + * @function getEvonodesProposedEpochBlocksByIds + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} request GetEvonodesProposedEpochBlocksByIdsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEvonodesProposedEpochBlocksByRange}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEvonodesProposedEpochBlocksByRangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} [response] GetEvonodesProposedEpochBlocksResponse + */ + + /** + * Calls getEvonodesProposedEpochBlocksByRange. + * @function getEvonodesProposedEpochBlocksByRange + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEvonodesProposedEpochBlocksByRangeCallback} callback Node-style callback called with the error, if any, and GetEvonodesProposedEpochBlocksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEvonodesProposedEpochBlocksByRange = function getEvonodesProposedEpochBlocksByRange(request, callback) { + return this.rpcCall(getEvonodesProposedEpochBlocksByRange, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest, $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse, request, callback); + }, "name", { value: "getEvonodesProposedEpochBlocksByRange" }); + + /** + * Calls getEvonodesProposedEpochBlocksByRange. + * @function getEvonodesProposedEpochBlocksByRange + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} request GetEvonodesProposedEpochBlocksByRangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContract}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractResponse} [response] GetDataContractResponse + */ + + /** + * Calls getDataContract. + * @function getDataContract + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractCallback} callback Node-style callback called with the error, if any, and GetDataContractResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContract = function getDataContract(request, callback) { + return this.rpcCall(getDataContract, $root.org.dash.platform.dapi.v0.GetDataContractRequest, $root.org.dash.platform.dapi.v0.GetDataContractResponse, request, callback); + }, "name", { value: "getDataContract" }); + + /** + * Calls getDataContract. + * @function getDataContract + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} request GetDataContractRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContractHistory}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} [response] GetDataContractHistoryResponse + */ + + /** + * Calls getDataContractHistory. + * @function getDataContractHistory + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractHistoryCallback} callback Node-style callback called with the error, if any, and GetDataContractHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContractHistory = function getDataContractHistory(request, callback) { + return this.rpcCall(getDataContractHistory, $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest, $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse, request, callback); + }, "name", { value: "getDataContractHistory" }); + + /** + * Calls getDataContractHistory. + * @function getDataContractHistory + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} request GetDataContractHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContracts}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} [response] GetDataContractsResponse + */ + + /** + * Calls getDataContracts. + * @function getDataContracts + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractsCallback} callback Node-style callback called with the error, if any, and GetDataContractsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContracts = function getDataContracts(request, callback) { + return this.rpcCall(getDataContracts, $root.org.dash.platform.dapi.v0.GetDataContractsRequest, $root.org.dash.platform.dapi.v0.GetDataContractsResponse, request, callback); + }, "name", { value: "getDataContracts" }); + + /** + * Calls getDataContracts. + * @function getDataContracts + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDocuments}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} [response] GetDocumentsResponse + */ + + /** + * Calls getDocuments. + * @function getDocuments + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDocumentsCallback} callback Node-style callback called with the error, if any, and GetDocumentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDocuments = function getDocuments(request, callback) { + return this.rpcCall(getDocuments, $root.org.dash.platform.dapi.v0.GetDocumentsRequest, $root.org.dash.platform.dapi.v0.GetDocumentsResponse, request, callback); + }, "name", { value: "getDocuments" }); + + /** + * Calls getDocuments. + * @function getDocuments + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} request GetDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityByPublicKeyHash}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityByPublicKeyHashCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} [response] GetIdentityByPublicKeyHashResponse + */ + + /** + * Calls getIdentityByPublicKeyHash. + * @function getIdentityByPublicKeyHash + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHashCallback} callback Node-style callback called with the error, if any, and GetIdentityByPublicKeyHashResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityByPublicKeyHash = function getIdentityByPublicKeyHash(request, callback) { + return this.rpcCall(getIdentityByPublicKeyHash, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse, request, callback); + }, "name", { value: "getIdentityByPublicKeyHash" }); + + /** + * Calls getIdentityByPublicKeyHash. + * @function getIdentityByPublicKeyHash + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} request GetIdentityByPublicKeyHashRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#waitForStateTransitionResult}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef waitForStateTransitionResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} [response] WaitForStateTransitionResultResponse + */ + + /** + * Calls waitForStateTransitionResult. + * @function waitForStateTransitionResult + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.waitForStateTransitionResultCallback} callback Node-style callback called with the error, if any, and WaitForStateTransitionResultResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.waitForStateTransitionResult = function waitForStateTransitionResult(request, callback) { + return this.rpcCall(waitForStateTransitionResult, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, request, callback); + }, "name", { value: "waitForStateTransitionResult" }); + + /** + * Calls waitForStateTransitionResult. + * @function waitForStateTransitionResult + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} request WaitForStateTransitionResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getConsensusParams}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getConsensusParamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} [response] GetConsensusParamsResponse + */ + + /** + * Calls getConsensusParams. + * @function getConsensusParams + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getConsensusParamsCallback} callback Node-style callback called with the error, if any, and GetConsensusParamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getConsensusParams = function getConsensusParams(request, callback) { + return this.rpcCall(getConsensusParams, $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest, $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse, request, callback); + }, "name", { value: "getConsensusParams" }); + + /** + * Calls getConsensusParams. + * @function getConsensusParams + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} request GetConsensusParamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeState}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getProtocolVersionUpgradeStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} [response] GetProtocolVersionUpgradeStateResponse + */ + + /** + * Calls getProtocolVersionUpgradeState. + * @function getProtocolVersionUpgradeState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeStateCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeState = function getProtocolVersionUpgradeState(request, callback) { + return this.rpcCall(getProtocolVersionUpgradeState, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse, request, callback); + }, "name", { value: "getProtocolVersionUpgradeState" }); + + /** + * Calls getProtocolVersionUpgradeState. + * @function getProtocolVersionUpgradeState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} request GetProtocolVersionUpgradeStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getProtocolVersionUpgradeVoteStatus}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getProtocolVersionUpgradeVoteStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} [response] GetProtocolVersionUpgradeVoteStatusResponse + */ + + /** + * Calls getProtocolVersionUpgradeVoteStatus. + * @function getProtocolVersionUpgradeVoteStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getProtocolVersionUpgradeVoteStatusCallback} callback Node-style callback called with the error, if any, and GetProtocolVersionUpgradeVoteStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getProtocolVersionUpgradeVoteStatus = function getProtocolVersionUpgradeVoteStatus(request, callback) { + return this.rpcCall(getProtocolVersionUpgradeVoteStatus, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest, $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse, request, callback); + }, "name", { value: "getProtocolVersionUpgradeVoteStatus" }); + + /** + * Calls getProtocolVersionUpgradeVoteStatus. + * @function getProtocolVersionUpgradeVoteStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} request GetProtocolVersionUpgradeVoteStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getEpochsInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getEpochsInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} [response] GetEpochsInfoResponse + */ + + /** + * Calls getEpochsInfo. + * @function getEpochsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getEpochsInfoCallback} callback Node-style callback called with the error, if any, and GetEpochsInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getEpochsInfo = function getEpochsInfo(request, callback) { + return this.rpcCall(getEpochsInfo, $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest, $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse, request, callback); + }, "name", { value: "getEpochsInfo" }); + + /** + * Calls getEpochsInfo. + * @function getEpochsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} request GetEpochsInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResources}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} [response] GetContestedResourcesResponse + */ + + /** + * Calls getContestedResources. + * @function getContestedResources + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourcesCallback} callback Node-style callback called with the error, if any, and GetContestedResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResources = function getContestedResources(request, callback) { + return this.rpcCall(getContestedResources, $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse, request, callback); + }, "name", { value: "getContestedResources" }); + + /** + * Calls getContestedResources. + * @function getContestedResources + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} request GetContestedResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVoteState}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceVoteStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} [response] GetContestedResourceVoteStateResponse + */ + + /** + * Calls getContestedResourceVoteState. + * @function getContestedResourceVoteState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVoteStateCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVoteStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceVoteState = function getContestedResourceVoteState(request, callback) { + return this.rpcCall(getContestedResourceVoteState, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse, request, callback); + }, "name", { value: "getContestedResourceVoteState" }); + + /** + * Calls getContestedResourceVoteState. + * @function getContestedResourceVoteState + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} request GetContestedResourceVoteStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceVotersForIdentity}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceVotersForIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} [response] GetContestedResourceVotersForIdentityResponse + */ + + /** + * Calls getContestedResourceVotersForIdentity. + * @function getContestedResourceVotersForIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceVotersForIdentityCallback} callback Node-style callback called with the error, if any, and GetContestedResourceVotersForIdentityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceVotersForIdentity = function getContestedResourceVotersForIdentity(request, callback) { + return this.rpcCall(getContestedResourceVotersForIdentity, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse, request, callback); + }, "name", { value: "getContestedResourceVotersForIdentity" }); + + /** + * Calls getContestedResourceVotersForIdentity. + * @function getContestedResourceVotersForIdentity + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} request GetContestedResourceVotersForIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getContestedResourceIdentityVotes}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getContestedResourceIdentityVotesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} [response] GetContestedResourceIdentityVotesResponse + */ + + /** + * Calls getContestedResourceIdentityVotes. + * @function getContestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getContestedResourceIdentityVotesCallback} callback Node-style callback called with the error, if any, and GetContestedResourceIdentityVotesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getContestedResourceIdentityVotes = function getContestedResourceIdentityVotes(request, callback) { + return this.rpcCall(getContestedResourceIdentityVotes, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest, $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse, request, callback); + }, "name", { value: "getContestedResourceIdentityVotes" }); + + /** + * Calls getContestedResourceIdentityVotes. + * @function getContestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} request GetContestedResourceIdentityVotesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getVotePollsByEndDate}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getVotePollsByEndDateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} [response] GetVotePollsByEndDateResponse + */ + + /** + * Calls getVotePollsByEndDate. + * @function getVotePollsByEndDate + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getVotePollsByEndDateCallback} callback Node-style callback called with the error, if any, and GetVotePollsByEndDateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getVotePollsByEndDate = function getVotePollsByEndDate(request, callback) { + return this.rpcCall(getVotePollsByEndDate, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest, $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse, request, callback); + }, "name", { value: "getVotePollsByEndDate" }); + + /** + * Calls getVotePollsByEndDate. + * @function getVotePollsByEndDate + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} request GetVotePollsByEndDateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPrefundedSpecializedBalance}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getPrefundedSpecializedBalanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} [response] GetPrefundedSpecializedBalanceResponse + */ + + /** + * Calls getPrefundedSpecializedBalance. + * @function getPrefundedSpecializedBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getPrefundedSpecializedBalanceCallback} callback Node-style callback called with the error, if any, and GetPrefundedSpecializedBalanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getPrefundedSpecializedBalance = function getPrefundedSpecializedBalance(request, callback) { + return this.rpcCall(getPrefundedSpecializedBalance, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest, $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse, request, callback); + }, "name", { value: "getPrefundedSpecializedBalance" }); + + /** + * Calls getPrefundedSpecializedBalance. + * @function getPrefundedSpecializedBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} request GetPrefundedSpecializedBalanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTotalCreditsInPlatform}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTotalCreditsInPlatformCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} [response] GetTotalCreditsInPlatformResponse + */ + + /** + * Calls getTotalCreditsInPlatform. + * @function getTotalCreditsInPlatform + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTotalCreditsInPlatformCallback} callback Node-style callback called with the error, if any, and GetTotalCreditsInPlatformResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTotalCreditsInPlatform = function getTotalCreditsInPlatform(request, callback) { + return this.rpcCall(getTotalCreditsInPlatform, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest, $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse, request, callback); + }, "name", { value: "getTotalCreditsInPlatform" }); + + /** + * Calls getTotalCreditsInPlatform. + * @function getTotalCreditsInPlatform + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} request GetTotalCreditsInPlatformRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getPathElements}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getPathElementsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} [response] GetPathElementsResponse + */ + + /** + * Calls getPathElements. + * @function getPathElements + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getPathElementsCallback} callback Node-style callback called with the error, if any, and GetPathElementsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getPathElements = function getPathElements(request, callback) { + return this.rpcCall(getPathElements, $root.org.dash.platform.dapi.v0.GetPathElementsRequest, $root.org.dash.platform.dapi.v0.GetPathElementsResponse, request, callback); + }, "name", { value: "getPathElements" }); + + /** + * Calls getPathElements. + * @function getPathElements + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} request GetPathElementsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getStatus}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetStatusResponse} [response] GetStatusResponse + */ + + /** + * Calls getStatus. + * @function getStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getStatusCallback} callback Node-style callback called with the error, if any, and GetStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getStatus = function getStatus(request, callback) { + return this.rpcCall(getStatus, $root.org.dash.platform.dapi.v0.GetStatusRequest, $root.org.dash.platform.dapi.v0.GetStatusResponse, request, callback); + }, "name", { value: "getStatus" }); + + /** + * Calls getStatus. + * @function getStatus + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} request GetStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getCurrentQuorumsInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getCurrentQuorumsInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} [response] GetCurrentQuorumsInfoResponse + */ + + /** + * Calls getCurrentQuorumsInfo. + * @function getCurrentQuorumsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getCurrentQuorumsInfoCallback} callback Node-style callback called with the error, if any, and GetCurrentQuorumsInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(request, callback) { + return this.rpcCall(getCurrentQuorumsInfo, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest, $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse, request, callback); + }, "name", { value: "getCurrentQuorumsInfo" }); + + /** + * Calls getCurrentQuorumsInfo. + * @function getCurrentQuorumsInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} request GetCurrentQuorumsInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityTokenBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} [response] GetIdentityTokenBalancesResponse + */ + + /** + * Calls getIdentityTokenBalances. + * @function getIdentityTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityTokenBalances = function getIdentityTokenBalances(request, callback) { + return this.rpcCall(getIdentityTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse, request, callback); + }, "name", { value: "getIdentityTokenBalances" }); + + /** + * Calls getIdentityTokenBalances. + * @function getIdentityTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} request GetIdentityTokenBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenBalances}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesTokenBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} [response] GetIdentitiesTokenBalancesResponse + */ + + /** + * Calls getIdentitiesTokenBalances. + * @function getIdentitiesTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenBalancesCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesTokenBalances = function getIdentitiesTokenBalances(request, callback) { + return this.rpcCall(getIdentitiesTokenBalances, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse, request, callback); + }, "name", { value: "getIdentitiesTokenBalances" }); + + /** + * Calls getIdentitiesTokenBalances. + * @function getIdentitiesTokenBalances + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} request GetIdentitiesTokenBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityTokenInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityTokenInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} [response] GetIdentityTokenInfosResponse + */ + + /** + * Calls getIdentityTokenInfos. + * @function getIdentityTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentityTokenInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityTokenInfos = function getIdentityTokenInfos(request, callback) { + return this.rpcCall(getIdentityTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse, request, callback); + }, "name", { value: "getIdentityTokenInfos" }); + + /** + * Calls getIdentityTokenInfos. + * @function getIdentityTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} request GetIdentityTokenInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentitiesTokenInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentitiesTokenInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} [response] GetIdentitiesTokenInfosResponse + */ + + /** + * Calls getIdentitiesTokenInfos. + * @function getIdentitiesTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentitiesTokenInfosCallback} callback Node-style callback called with the error, if any, and GetIdentitiesTokenInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentitiesTokenInfos = function getIdentitiesTokenInfos(request, callback) { + return this.rpcCall(getIdentitiesTokenInfos, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest, $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse, request, callback); + }, "name", { value: "getIdentitiesTokenInfos" }); + + /** + * Calls getIdentitiesTokenInfos. + * @function getIdentitiesTokenInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} request GetIdentitiesTokenInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenStatuses}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenStatusesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} [response] GetTokenStatusesResponse + */ + + /** + * Calls getTokenStatuses. + * @function getTokenStatuses + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenStatusesCallback} callback Node-style callback called with the error, if any, and GetTokenStatusesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenStatuses = function getTokenStatuses(request, callback) { + return this.rpcCall(getTokenStatuses, $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest, $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse, request, callback); + }, "name", { value: "getTokenStatuses" }); + + /** + * Calls getTokenStatuses. + * @function getTokenStatuses + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} request GetTokenStatusesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenDirectPurchasePrices}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenDirectPurchasePricesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} [response] GetTokenDirectPurchasePricesResponse + */ + + /** + * Calls getTokenDirectPurchasePrices. + * @function getTokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenDirectPurchasePricesCallback} callback Node-style callback called with the error, if any, and GetTokenDirectPurchasePricesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenDirectPurchasePrices = function getTokenDirectPurchasePrices(request, callback) { + return this.rpcCall(getTokenDirectPurchasePrices, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest, $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse, request, callback); + }, "name", { value: "getTokenDirectPurchasePrices" }); + + /** + * Calls getTokenDirectPurchasePrices. + * @function getTokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} request GetTokenDirectPurchasePricesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenPreProgrammedDistributions}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenPreProgrammedDistributionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} [response] GetTokenPreProgrammedDistributionsResponse + */ + + /** + * Calls getTokenPreProgrammedDistributions. + * @function getTokenPreProgrammedDistributions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenPreProgrammedDistributionsCallback} callback Node-style callback called with the error, if any, and GetTokenPreProgrammedDistributionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenPreProgrammedDistributions = function getTokenPreProgrammedDistributions(request, callback) { + return this.rpcCall(getTokenPreProgrammedDistributions, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest, $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse, request, callback); + }, "name", { value: "getTokenPreProgrammedDistributions" }); + + /** + * Calls getTokenPreProgrammedDistributions. + * @function getTokenPreProgrammedDistributions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} request GetTokenPreProgrammedDistributionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getTokenTotalSupply}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getTokenTotalSupplyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} [response] GetTokenTotalSupplyResponse + */ + + /** + * Calls getTokenTotalSupply. + * @function getTokenTotalSupply + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getTokenTotalSupplyCallback} callback Node-style callback called with the error, if any, and GetTokenTotalSupplyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getTokenTotalSupply = function getTokenTotalSupply(request, callback) { + return this.rpcCall(getTokenTotalSupply, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest, $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse, request, callback); + }, "name", { value: "getTokenTotalSupply" }); + + /** + * Calls getTokenTotalSupply. + * @function getTokenTotalSupply + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} request GetTokenTotalSupplyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfo}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} [response] GetGroupInfoResponse + */ + + /** + * Calls getGroupInfo. + * @function getGroupInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupInfoCallback} callback Node-style callback called with the error, if any, and GetGroupInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupInfo = function getGroupInfo(request, callback) { + return this.rpcCall(getGroupInfo, $root.org.dash.platform.dapi.v0.GetGroupInfoRequest, $root.org.dash.platform.dapi.v0.GetGroupInfoResponse, request, callback); + }, "name", { value: "getGroupInfo" }); + + /** + * Calls getGroupInfo. + * @function getGroupInfo + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} request GetGroupInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupInfos}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} [response] GetGroupInfosResponse + */ + + /** + * Calls getGroupInfos. + * @function getGroupInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupInfosCallback} callback Node-style callback called with the error, if any, and GetGroupInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupInfos = function getGroupInfos(request, callback) { + return this.rpcCall(getGroupInfos, $root.org.dash.platform.dapi.v0.GetGroupInfosRequest, $root.org.dash.platform.dapi.v0.GetGroupInfosResponse, request, callback); + }, "name", { value: "getGroupInfos" }); + + /** + * Calls getGroupInfos. + * @function getGroupInfos + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} request GetGroupInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActions}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupActionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} [response] GetGroupActionsResponse + */ + + /** + * Calls getGroupActions. + * @function getGroupActions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupActionsCallback} callback Node-style callback called with the error, if any, and GetGroupActionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupActions = function getGroupActions(request, callback) { + return this.rpcCall(getGroupActions, $root.org.dash.platform.dapi.v0.GetGroupActionsRequest, $root.org.dash.platform.dapi.v0.GetGroupActionsResponse, request, callback); + }, "name", { value: "getGroupActions" }); + + /** + * Calls getGroupActions. + * @function getGroupActions + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} request GetGroupActionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getGroupActionSigners}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getGroupActionSignersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} [response] GetGroupActionSignersResponse + */ + + /** + * Calls getGroupActionSigners. + * @function getGroupActionSigners + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getGroupActionSignersCallback} callback Node-style callback called with the error, if any, and GetGroupActionSignersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getGroupActionSigners = function getGroupActionSigners(request, callback) { + return this.rpcCall(getGroupActionSigners, $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest, $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse, request, callback); + }, "name", { value: "getGroupActionSigners" }); + + /** + * Calls getGroupActionSigners. + * @function getGroupActionSigners + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} request GetGroupActionSignersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Platform; + })(); + + v0.Proof = (function() { + + /** + * Properties of a Proof. + * @memberof org.dash.platform.dapi.v0 + * @interface IProof + * @property {Uint8Array|null} [grovedbProof] Proof grovedbProof + * @property {Uint8Array|null} [quorumHash] Proof quorumHash + * @property {Uint8Array|null} [signature] Proof signature + * @property {number|null} [round] Proof round + * @property {Uint8Array|null} [blockIdHash] Proof blockIdHash + * @property {number|null} [quorumType] Proof quorumType + */ + + /** + * Constructs a new Proof. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a Proof. + * @implements IProof + * @constructor + * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set + */ + function Proof(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Proof grovedbProof. + * @member {Uint8Array} grovedbProof + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.grovedbProof = $util.newBuffer([]); + + /** + * Proof quorumHash. + * @member {Uint8Array} quorumHash + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.quorumHash = $util.newBuffer([]); + + /** + * Proof signature. + * @member {Uint8Array} signature + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.signature = $util.newBuffer([]); + + /** + * Proof round. + * @member {number} round + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.round = 0; + + /** + * Proof blockIdHash. + * @member {Uint8Array} blockIdHash + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.blockIdHash = $util.newBuffer([]); + + /** + * Proof quorumType. + * @member {number} quorumType + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + */ + Proof.prototype.quorumType = 0; + + /** + * Creates a new Proof instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.Proof} Proof instance + */ + Proof.create = function create(properties) { + return new Proof(properties); + }; + + /** + * Encodes the specified Proof message. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.grovedbProof != null && Object.hasOwnProperty.call(message, "grovedbProof")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.grovedbProof); + if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.quorumHash); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); + if (message.round != null && Object.hasOwnProperty.call(message, "round")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.round); + if (message.blockIdHash != null && Object.hasOwnProperty.call(message, "blockIdHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.blockIdHash); + if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.quorumType); + return writer; + }; + + /** + * Encodes the specified Proof message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.Proof.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.IProof} message Proof message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Proof.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Proof message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.Proof(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grovedbProof = reader.bytes(); + break; + case 2: + message.quorumHash = reader.bytes(); + break; + case 3: + message.signature = reader.bytes(); + break; + case 4: + message.round = reader.uint32(); + break; + case 5: + message.blockIdHash = reader.bytes(); + break; + case 6: + message.quorumType = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Proof message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.Proof} Proof + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Proof.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Proof message. + * @function verify + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Proof.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) + if (!(message.grovedbProof && typeof message.grovedbProof.length === "number" || $util.isString(message.grovedbProof))) + return "grovedbProof: buffer expected"; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) + return "quorumHash: buffer expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + if (message.round != null && message.hasOwnProperty("round")) + if (!$util.isInteger(message.round)) + return "round: integer expected"; + if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) + if (!(message.blockIdHash && typeof message.blockIdHash.length === "number" || $util.isString(message.blockIdHash))) + return "blockIdHash: buffer expected"; + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + if (!$util.isInteger(message.quorumType)) + return "quorumType: integer expected"; + return null; + }; + + /** + * Creates a Proof message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.Proof} Proof + */ + Proof.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.Proof) + return object; + var message = new $root.org.dash.platform.dapi.v0.Proof(); + if (object.grovedbProof != null) + if (typeof object.grovedbProof === "string") + $util.base64.decode(object.grovedbProof, message.grovedbProof = $util.newBuffer($util.base64.length(object.grovedbProof)), 0); + else if (object.grovedbProof.length >= 0) + message.grovedbProof = object.grovedbProof; + if (object.quorumHash != null) + if (typeof object.quorumHash === "string") + $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); + else if (object.quorumHash.length >= 0) + message.quorumHash = object.quorumHash; + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length >= 0) + message.signature = object.signature; + if (object.round != null) + message.round = object.round >>> 0; + if (object.blockIdHash != null) + if (typeof object.blockIdHash === "string") + $util.base64.decode(object.blockIdHash, message.blockIdHash = $util.newBuffer($util.base64.length(object.blockIdHash)), 0); + else if (object.blockIdHash.length >= 0) + message.blockIdHash = object.blockIdHash; + if (object.quorumType != null) + message.quorumType = object.quorumType >>> 0; + return message; + }; + + /** + * Creates a plain object from a Proof message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.Proof + * @static + * @param {org.dash.platform.dapi.v0.Proof} message Proof + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Proof.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.grovedbProof = ""; + else { + object.grovedbProof = []; + if (options.bytes !== Array) + object.grovedbProof = $util.newBuffer(object.grovedbProof); + } + if (options.bytes === String) + object.quorumHash = ""; + else { + object.quorumHash = []; + if (options.bytes !== Array) + object.quorumHash = $util.newBuffer(object.quorumHash); + } + if (options.bytes === String) + object.signature = ""; + else { + object.signature = []; + if (options.bytes !== Array) + object.signature = $util.newBuffer(object.signature); + } + object.round = 0; + if (options.bytes === String) + object.blockIdHash = ""; + else { + object.blockIdHash = []; + if (options.bytes !== Array) + object.blockIdHash = $util.newBuffer(object.blockIdHash); + } + object.quorumType = 0; + } + if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) + object.grovedbProof = options.bytes === String ? $util.base64.encode(message.grovedbProof, 0, message.grovedbProof.length) : options.bytes === Array ? Array.prototype.slice.call(message.grovedbProof) : message.grovedbProof; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + if (message.round != null && message.hasOwnProperty("round")) + object.round = message.round; + if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash")) + object.blockIdHash = options.bytes === String ? $util.base64.encode(message.blockIdHash, 0, message.blockIdHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.blockIdHash) : message.blockIdHash; + if (message.quorumType != null && message.hasOwnProperty("quorumType")) + object.quorumType = message.quorumType; + return object; + }; + + /** + * Converts this Proof to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.Proof + * @instance + * @returns {Object.} JSON object + */ + Proof.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Proof; + })(); + + v0.ResponseMetadata = (function() { + + /** + * Properties of a ResponseMetadata. + * @memberof org.dash.platform.dapi.v0 + * @interface IResponseMetadata + * @property {number|Long|null} [height] ResponseMetadata height + * @property {number|null} [coreChainLockedHeight] ResponseMetadata coreChainLockedHeight + * @property {number|null} [epoch] ResponseMetadata epoch + * @property {number|Long|null} [timeMs] ResponseMetadata timeMs + * @property {number|null} [protocolVersion] ResponseMetadata protocolVersion + * @property {string|null} [chainId] ResponseMetadata chainId + */ + + /** + * Constructs a new ResponseMetadata. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a ResponseMetadata. + * @implements IResponseMetadata + * @constructor + * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set + */ + function ResponseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseMetadata height. + * @member {number|Long} height + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseMetadata coreChainLockedHeight. + * @member {number} coreChainLockedHeight + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.coreChainLockedHeight = 0; + + /** + * ResponseMetadata epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.epoch = 0; + + /** + * ResponseMetadata timeMs. + * @member {number|Long} timeMs + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.timeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ResponseMetadata protocolVersion. + * @member {number} protocolVersion + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.protocolVersion = 0; + + /** + * ResponseMetadata chainId. + * @member {string} chainId + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.chainId = ""; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata instance + */ + ResponseMetadata.create = function create(properties) { + return new ResponseMetadata(properties); + }; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); + if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreChainLockedHeight); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.epoch); + if (message.timeMs != null && Object.hasOwnProperty.call(message, "timeMs")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timeMs); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.protocolVersion); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.chainId); + return writer; + }; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ResponseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.coreChainLockedHeight = reader.uint32(); + break; + case 3: + message.epoch = reader.uint32(); + break; + case 4: + message.timeMs = reader.uint64(); + break; + case 5: + message.protocolVersion = reader.uint32(); + break; + case 6: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMetadata message. + * @function verify + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + if (!$util.isInteger(message.coreChainLockedHeight)) + return "coreChainLockedHeight: integer expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.timeMs != null && message.hasOwnProperty("timeMs")) + if (!$util.isInteger(message.timeMs) && !(message.timeMs && $util.isInteger(message.timeMs.low) && $util.isInteger(message.timeMs.high))) + return "timeMs: integer|Long expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion)) + return "protocolVersion: integer expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + return null; + }; + + /** + * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.ResponseMetadata} ResponseMetadata + */ + ResponseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.ResponseMetadata) + return object; + var message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = true; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); + if (object.coreChainLockedHeight != null) + message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.timeMs != null) + if ($util.Long) + (message.timeMs = $util.Long.fromValue(object.timeMs)).unsigned = true; + else if (typeof object.timeMs === "string") + message.timeMs = parseInt(object.timeMs, 10); + else if (typeof object.timeMs === "number") + message.timeMs = object.timeMs; + else if (typeof object.timeMs === "object") + message.timeMs = new $util.LongBits(object.timeMs.low >>> 0, object.timeMs.high >>> 0).toNumber(true); + if (object.protocolVersion != null) + message.protocolVersion = object.protocolVersion >>> 0; + if (object.chainId != null) + message.chainId = String(object.chainId); + return message; + }; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @static + * @param {org.dash.platform.dapi.v0.ResponseMetadata} message ResponseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.coreChainLockedHeight = 0; + object.epoch = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timeMs = options.longs === String ? "0" : 0; + object.protocolVersion = 0; + object.chainId = ""; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + object.coreChainLockedHeight = message.coreChainLockedHeight; + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.timeMs != null && message.hasOwnProperty("timeMs")) + if (typeof message.timeMs === "number") + object.timeMs = options.longs === String ? String(message.timeMs) : message.timeMs; + else + object.timeMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeMs) : options.longs === Number ? new $util.LongBits(message.timeMs.low >>> 0, message.timeMs.high >>> 0).toNumber(true) : message.timeMs; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = message.protocolVersion; + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + return object; + }; + + /** + * Converts this ResponseMetadata to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.ResponseMetadata + * @instance + * @returns {Object.} JSON object + */ + ResponseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseMetadata; + })(); + + v0.StateTransitionBroadcastError = (function() { + + /** + * Properties of a StateTransitionBroadcastError. + * @memberof org.dash.platform.dapi.v0 + * @interface IStateTransitionBroadcastError + * @property {number|null} [code] StateTransitionBroadcastError code + * @property {string|null} [message] StateTransitionBroadcastError message + * @property {Uint8Array|null} [data] StateTransitionBroadcastError data + */ + + /** + * Constructs a new StateTransitionBroadcastError. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a StateTransitionBroadcastError. + * @implements IStateTransitionBroadcastError + * @constructor + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set + */ + function StateTransitionBroadcastError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateTransitionBroadcastError code. + * @member {number} code + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.code = 0; + + /** + * StateTransitionBroadcastError message. + * @member {string} message + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.message = ""; + + /** + * StateTransitionBroadcastError data. + * @member {Uint8Array} data + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + */ + StateTransitionBroadcastError.prototype.data = $util.newBuffer([]); + + /** + * Creates a new StateTransitionBroadcastError instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError instance + */ + StateTransitionBroadcastError.create = function create(properties) { + return new StateTransitionBroadcastError(properties); + }; + + /** + * Encodes the specified StateTransitionBroadcastError message. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionBroadcastError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified StateTransitionBroadcastError message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.IStateTransitionBroadcastError} message StateTransitionBroadcastError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateTransitionBroadcastError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateTransitionBroadcastError message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionBroadcastError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateTransitionBroadcastError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateTransitionBroadcastError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateTransitionBroadcastError message. + * @function verify + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateTransitionBroadcastError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a StateTransitionBroadcastError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.StateTransitionBroadcastError} StateTransitionBroadcastError + */ + StateTransitionBroadcastError.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError) + return object; + var message = new $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError(); + if (object.code != null) + message.code = object.code >>> 0; + if (object.message != null) + message.message = String(object.message); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a StateTransitionBroadcastError message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @static + * @param {org.dash.platform.dapi.v0.StateTransitionBroadcastError} message StateTransitionBroadcastError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateTransitionBroadcastError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = 0; + object.message = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this StateTransitionBroadcastError to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.StateTransitionBroadcastError + * @instance + * @returns {Object.} JSON object + */ + StateTransitionBroadcastError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateTransitionBroadcastError; + })(); + + /** + * KeyPurpose enum. + * @name org.dash.platform.dapi.v0.KeyPurpose + * @enum {number} + * @property {number} AUTHENTICATION=0 AUTHENTICATION value + * @property {number} ENCRYPTION=1 ENCRYPTION value + * @property {number} DECRYPTION=2 DECRYPTION value + * @property {number} TRANSFER=3 TRANSFER value + * @property {number} VOTING=5 VOTING value + */ + v0.KeyPurpose = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTHENTICATION"] = 0; + values[valuesById[1] = "ENCRYPTION"] = 1; + values[valuesById[2] = "DECRYPTION"] = 2; + values[valuesById[3] = "TRANSFER"] = 3; + values[valuesById[5] = "VOTING"] = 5; + return values; + })(); + + v0.BroadcastStateTransitionRequest = (function() { + + /** + * Properties of a BroadcastStateTransitionRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IBroadcastStateTransitionRequest + * @property {Uint8Array|null} [stateTransition] BroadcastStateTransitionRequest stateTransition + */ + + /** + * Constructs a new BroadcastStateTransitionRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BroadcastStateTransitionRequest. + * @implements IBroadcastStateTransitionRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set + */ + function BroadcastStateTransitionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BroadcastStateTransitionRequest stateTransition. + * @member {Uint8Array} stateTransition + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @instance + */ + BroadcastStateTransitionRequest.prototype.stateTransition = $util.newBuffer([]); + + /** + * Creates a new BroadcastStateTransitionRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest instance + */ + BroadcastStateTransitionRequest.create = function create(properties) { + return new BroadcastStateTransitionRequest(properties); + }; + + /** + * Encodes the specified BroadcastStateTransitionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransition != null && Object.hasOwnProperty.call(message, "stateTransition")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransition); + return writer; + }; + + /** + * Encodes the specified BroadcastStateTransitionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionRequest} message BroadcastStateTransitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransition = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastStateTransitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastStateTransitionRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastStateTransitionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + if (!(message.stateTransition && typeof message.stateTransition.length === "number" || $util.isString(message.stateTransition))) + return "stateTransition: buffer expected"; + return null; + }; + + /** + * Creates a BroadcastStateTransitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} BroadcastStateTransitionRequest + */ + BroadcastStateTransitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest(); + if (object.stateTransition != null) + if (typeof object.stateTransition === "string") + $util.base64.decode(object.stateTransition, message.stateTransition = $util.newBuffer($util.base64.length(object.stateTransition)), 0); + else if (object.stateTransition.length >= 0) + message.stateTransition = object.stateTransition; + return message; + }; + + /** + * Creates a plain object from a BroadcastStateTransitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @static + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message BroadcastStateTransitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastStateTransitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.stateTransition = ""; + else { + object.stateTransition = []; + if (options.bytes !== Array) + object.stateTransition = $util.newBuffer(object.stateTransition); + } + if (message.stateTransition != null && message.hasOwnProperty("stateTransition")) + object.stateTransition = options.bytes === String ? $util.base64.encode(message.stateTransition, 0, message.stateTransition.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransition) : message.stateTransition; + return object; + }; + + /** + * Converts this BroadcastStateTransitionRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionRequest + * @instance + * @returns {Object.} JSON object + */ + BroadcastStateTransitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastStateTransitionRequest; + })(); + + v0.BroadcastStateTransitionResponse = (function() { + + /** + * Properties of a BroadcastStateTransitionResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IBroadcastStateTransitionResponse + */ + + /** + * Constructs a new BroadcastStateTransitionResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a BroadcastStateTransitionResponse. + * @implements IBroadcastStateTransitionResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set + */ + function BroadcastStateTransitionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new BroadcastStateTransitionResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse instance + */ + BroadcastStateTransitionResponse.create = function create(properties) { + return new BroadcastStateTransitionResponse(properties); + }; + + /** + * Encodes the specified BroadcastStateTransitionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BroadcastStateTransitionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.IBroadcastStateTransitionResponse} message BroadcastStateTransitionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastStateTransitionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastStateTransitionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastStateTransitionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastStateTransitionResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastStateTransitionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BroadcastStateTransitionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} BroadcastStateTransitionResponse + */ + BroadcastStateTransitionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse) + return object; + return new $root.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse(); + }; + + /** + * Creates a plain object from a BroadcastStateTransitionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @static + * @param {org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message BroadcastStateTransitionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastStateTransitionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BroadcastStateTransitionResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.BroadcastStateTransitionResponse + * @instance + * @returns {Object.} JSON object + */ + BroadcastStateTransitionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BroadcastStateTransitionResponse; + })(); + + v0.GetIdentityRequest = (function() { + + /** + * Properties of a GetIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityRequest + * @property {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null} [v0] GetIdentityRequest v0 + */ + + /** + * Constructs a new GetIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityRequest. + * @implements IGetIdentityRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set + */ + function GetIdentityRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + */ + GetIdentityRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + */ + Object.defineProperty(GetIdentityRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest instance + */ + GetIdentityRequest.create = function create(properties) { + return new GetIdentityRequest(properties); + }; + + /** + * Encodes the specified GetIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} message GetIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest} GetIdentityRequest + */ + GetIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest} message GetIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityRequest.GetIdentityRequestV0 = (function() { + + /** + * Properties of a GetIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @interface IGetIdentityRequestV0 + * @property {Uint8Array|null} [id] GetIdentityRequestV0 id + * @property {boolean|null} [prove] GetIdentityRequestV0 prove + */ + + /** + * Constructs a new GetIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest + * @classdesc Represents a GetIdentityRequestV0. + * @implements IGetIdentityRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set + */ + function GetIdentityRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + */ + GetIdentityRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + */ + GetIdentityRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 instance + */ + GetIdentityRequestV0.create = function create(properties) { + return new GetIdentityRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.IGetIdentityRequestV0} message GetIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} GetIdentityRequestV0 + */ + GetIdentityRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0} message GetIdentityRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityRequestV0; + })(); + + return GetIdentityRequest; + })(); + + v0.GetIdentityNonceRequest = (function() { + + /** + * Properties of a GetIdentityNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityNonceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null} [v0] GetIdentityNonceRequest v0 + */ + + /** + * Constructs a new GetIdentityNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityNonceRequest. + * @implements IGetIdentityNonceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set + */ + function GetIdentityNonceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityNonceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + */ + GetIdentityNonceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + */ + Object.defineProperty(GetIdentityNonceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest instance + */ + GetIdentityNonceRequest.create = function create(properties) { + return new GetIdentityNonceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceRequest} message GetIdentityNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityNonceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest} GetIdentityNonceRequest + */ + GetIdentityNonceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest} message GetIdentityNonceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityNonceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityNonceRequest.GetIdentityNonceRequestV0 = (function() { + + /** + * Properties of a GetIdentityNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @interface IGetIdentityNonceRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityNonceRequestV0 identityId + * @property {boolean|null} [prove] GetIdentityNonceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest + * @classdesc Represents a GetIdentityNonceRequestV0. + * @implements IGetIdentityNonceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set + */ + function GetIdentityNonceRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityNonceRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + */ + GetIdentityNonceRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityNonceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + */ + GetIdentityNonceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityNonceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 instance + */ + GetIdentityNonceRequestV0.create = function create(properties) { + return new GetIdentityNonceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.IGetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityNonceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} GetIdentityNonceRequestV0 + */ + GetIdentityNonceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0} message GetIdentityNonceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityNonceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityNonceRequestV0; + })(); + + return GetIdentityNonceRequest; + })(); + + v0.GetIdentityContractNonceRequest = (function() { + + /** + * Properties of a GetIdentityContractNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityContractNonceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null} [v0] GetIdentityContractNonceRequest v0 + */ + + /** + * Constructs a new GetIdentityContractNonceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityContractNonceRequest. + * @implements IGetIdentityContractNonceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set + */ + function GetIdentityContractNonceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityContractNonceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + */ + GetIdentityContractNonceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + */ + Object.defineProperty(GetIdentityContractNonceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest instance + */ + GetIdentityContractNonceRequest.create = function create(properties) { + return new GetIdentityContractNonceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceRequest} message GetIdentityContractNonceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} GetIdentityContractNonceRequest + */ + GetIdentityContractNonceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest} message GetIdentityContractNonceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityContractNonceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 = (function() { + + /** + * Properties of a GetIdentityContractNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @interface IGetIdentityContractNonceRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityContractNonceRequestV0 identityId + * @property {Uint8Array|null} [contractId] GetIdentityContractNonceRequestV0 contractId + * @property {boolean|null} [prove] GetIdentityContractNonceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityContractNonceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest + * @classdesc Represents a GetIdentityContractNonceRequestV0. + * @implements IGetIdentityContractNonceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set + */ + function GetIdentityContractNonceRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityContractNonceRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityContractNonceRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetIdentityContractNonceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + */ + GetIdentityContractNonceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityContractNonceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 instance + */ + GetIdentityContractNonceRequestV0.create = function create(properties) { + return new GetIdentityContractNonceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.IGetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.contractId = reader.bytes(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityContractNonceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} GetIdentityContractNonceRequestV0 + */ + GetIdentityContractNonceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0} message GetIdentityContractNonceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityContractNonceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityContractNonceRequestV0; + })(); + + return GetIdentityContractNonceRequest; + })(); + + v0.GetIdentityBalanceRequest = (function() { + + /** + * Properties of a GetIdentityBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceRequest + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null} [v0] GetIdentityBalanceRequest v0 + */ + + /** + * Constructs a new GetIdentityBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceRequest. + * @implements IGetIdentityBalanceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set + */ + function GetIdentityBalanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + */ + GetIdentityBalanceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + */ + Object.defineProperty(GetIdentityBalanceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest instance + */ + GetIdentityBalanceRequest.create = function create(properties) { + return new GetIdentityBalanceRequest(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceRequest} message GetIdentityBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} GetIdentityBalanceRequest + */ + GetIdentityBalanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest} message GetIdentityBalanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 = (function() { + + /** + * Properties of a GetIdentityBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @interface IGetIdentityBalanceRequestV0 + * @property {Uint8Array|null} [id] GetIdentityBalanceRequestV0 id + * @property {boolean|null} [prove] GetIdentityBalanceRequestV0 prove + */ + + /** + * Constructs a new GetIdentityBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest + * @classdesc Represents a GetIdentityBalanceRequestV0. + * @implements IGetIdentityBalanceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set + */ + function GetIdentityBalanceRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + */ + GetIdentityBalanceRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityBalanceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + */ + GetIdentityBalanceRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityBalanceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 instance + */ + GetIdentityBalanceRequestV0.create = function create(properties) { + return new GetIdentityBalanceRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.IGetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} GetIdentityBalanceRequestV0 + */ + GetIdentityBalanceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0} message GetIdentityBalanceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityBalanceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceRequestV0; + })(); + + return GetIdentityBalanceRequest; + })(); + + v0.GetIdentityBalanceAndRevisionRequest = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceAndRevisionRequest + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null} [v0] GetIdentityBalanceAndRevisionRequest v0 + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceAndRevisionRequest. + * @implements IGetIdentityBalanceAndRevisionRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceAndRevisionRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + */ + GetIdentityBalanceAndRevisionRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest instance + */ + GetIdentityBalanceAndRevisionRequest.create = function create(properties) { + return new GetIdentityBalanceAndRevisionRequest(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} GetIdentityBalanceAndRevisionRequest + */ + GetIdentityBalanceAndRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest} message GetIdentityBalanceAndRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @interface IGetIdentityBalanceAndRevisionRequestV0 + * @property {Uint8Array|null} [id] GetIdentityBalanceAndRevisionRequestV0 id + * @property {boolean|null} [prove] GetIdentityBalanceAndRevisionRequestV0 prove + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest + * @classdesc Represents a GetIdentityBalanceAndRevisionRequestV0. + * @implements IGetIdentityBalanceAndRevisionRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceAndRevisionRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetIdentityBalanceAndRevisionRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityBalanceAndRevisionRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 instance + */ + GetIdentityBalanceAndRevisionRequestV0.create = function create(properties) { + return new GetIdentityBalanceAndRevisionRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.IGetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} GetIdentityBalanceAndRevisionRequestV0 + */ + GetIdentityBalanceAndRevisionRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0} message GetIdentityBalanceAndRevisionRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceAndRevisionRequestV0; + })(); + + return GetIdentityBalanceAndRevisionRequest; + })(); + + v0.GetIdentityResponse = (function() { + + /** + * Properties of a GetIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityResponse + * @property {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null} [v0] GetIdentityResponse v0 + */ + + /** + * Constructs a new GetIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityResponse. + * @implements IGetIdentityResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set + */ + function GetIdentityResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + */ + GetIdentityResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + */ + Object.defineProperty(GetIdentityResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse instance + */ + GetIdentityResponse.create = function create(properties) { + return new GetIdentityResponse(properties); + }; + + /** + * Encodes the specified GetIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityResponse} message GetIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse} GetIdentityResponse + */ + GetIdentityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse} message GetIdentityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityResponse.GetIdentityResponseV0 = (function() { + + /** + * Properties of a GetIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @interface IGetIdentityResponseV0 + * @property {Uint8Array|null} [identity] GetIdentityResponseV0 identity + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse + * @classdesc Represents a GetIdentityResponseV0. + * @implements IGetIdentityResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set + */ + function GetIdentityResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityResponseV0 identity. + * @member {Uint8Array} identity + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.identity = $util.newBuffer([]); + + /** + * GetIdentityResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.proof = null; + + /** + * GetIdentityResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + GetIdentityResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityResponseV0 result. + * @member {"identity"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 instance + */ + GetIdentityResponseV0.create = function create(properties) { + return new GetIdentityResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.IGetIdentityResponseV0} message GetIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identity != null && message.hasOwnProperty("identity")) { + properties.result = 1; + if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) + return "identity: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} GetIdentityResponseV0 + */ + GetIdentityResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0(); + if (object.identity != null) + if (typeof object.identity === "string") + $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); + else if (object.identity.length >= 0) + message.identity = object.identity; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0} message GetIdentityResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identity != null && message.hasOwnProperty("identity")) { + object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; + if (options.oneofs) + object.result = "identity"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityResponseV0; + })(); + + return GetIdentityResponse; + })(); + + v0.GetIdentityNonceResponse = (function() { + + /** + * Properties of a GetIdentityNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityNonceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null} [v0] GetIdentityNonceResponse v0 + */ + + /** + * Constructs a new GetIdentityNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityNonceResponse. + * @implements IGetIdentityNonceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set + */ + function GetIdentityNonceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityNonceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + */ + GetIdentityNonceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + */ + Object.defineProperty(GetIdentityNonceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse instance + */ + GetIdentityNonceResponse.create = function create(properties) { + return new GetIdentityNonceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityNonceResponse} message GetIdentityNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityNonceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse} GetIdentityNonceResponse + */ + GetIdentityNonceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse} message GetIdentityNonceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityNonceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityNonceResponse.GetIdentityNonceResponseV0 = (function() { + + /** + * Properties of a GetIdentityNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @interface IGetIdentityNonceResponseV0 + * @property {number|Long|null} [identityNonce] GetIdentityNonceResponseV0 identityNonce + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityNonceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityNonceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse + * @classdesc Represents a GetIdentityNonceResponseV0. + * @implements IGetIdentityNonceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set + */ + function GetIdentityNonceResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityNonceResponseV0 identityNonce. + * @member {number|Long} identityNonce + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.identityNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityNonceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.proof = null; + + /** + * GetIdentityNonceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + GetIdentityNonceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityNonceResponseV0 result. + * @member {"identityNonce"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityNonceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityNonce", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityNonceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 instance + */ + GetIdentityNonceResponseV0.create = function create(properties) { + return new GetIdentityNonceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityNonce != null && Object.hasOwnProperty.call(message, "identityNonce")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityNonce); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.IGetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityNonce = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityNonceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityNonceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityNonceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { + properties.result = 1; + if (!$util.isInteger(message.identityNonce) && !(message.identityNonce && $util.isInteger(message.identityNonce.low) && $util.isInteger(message.identityNonce.high))) + return "identityNonce: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityNonceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} GetIdentityNonceResponseV0 + */ + GetIdentityNonceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0(); + if (object.identityNonce != null) + if ($util.Long) + (message.identityNonce = $util.Long.fromValue(object.identityNonce)).unsigned = true; + else if (typeof object.identityNonce === "string") + message.identityNonce = parseInt(object.identityNonce, 10); + else if (typeof object.identityNonce === "number") + message.identityNonce = object.identityNonce; + else if (typeof object.identityNonce === "object") + message.identityNonce = new $util.LongBits(object.identityNonce.low >>> 0, object.identityNonce.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityNonceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0} message GetIdentityNonceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityNonceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityNonce != null && message.hasOwnProperty("identityNonce")) { + if (typeof message.identityNonce === "number") + object.identityNonce = options.longs === String ? String(message.identityNonce) : message.identityNonce; + else + object.identityNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityNonce) : options.longs === Number ? new $util.LongBits(message.identityNonce.low >>> 0, message.identityNonce.high >>> 0).toNumber(true) : message.identityNonce; + if (options.oneofs) + object.result = "identityNonce"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityNonceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityNonceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityNonceResponseV0; + })(); + + return GetIdentityNonceResponse; + })(); + + v0.GetIdentityContractNonceResponse = (function() { + + /** + * Properties of a GetIdentityContractNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityContractNonceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null} [v0] GetIdentityContractNonceResponse v0 + */ + + /** + * Constructs a new GetIdentityContractNonceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityContractNonceResponse. + * @implements IGetIdentityContractNonceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set + */ + function GetIdentityContractNonceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityContractNonceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + */ + GetIdentityContractNonceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + */ + Object.defineProperty(GetIdentityContractNonceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse instance + */ + GetIdentityContractNonceResponse.create = function create(properties) { + return new GetIdentityContractNonceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityContractNonceResponse} message GetIdentityContractNonceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} GetIdentityContractNonceResponse + */ + GetIdentityContractNonceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse} message GetIdentityContractNonceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityContractNonceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 = (function() { + + /** + * Properties of a GetIdentityContractNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @interface IGetIdentityContractNonceResponseV0 + * @property {number|Long|null} [identityContractNonce] GetIdentityContractNonceResponseV0 identityContractNonce + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityContractNonceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityContractNonceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityContractNonceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse + * @classdesc Represents a GetIdentityContractNonceResponseV0. + * @implements IGetIdentityContractNonceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set + */ + function GetIdentityContractNonceResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityContractNonceResponseV0 identityContractNonce. + * @member {number|Long} identityContractNonce + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.identityContractNonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityContractNonceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.proof = null; + + /** + * GetIdentityContractNonceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + GetIdentityContractNonceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityContractNonceResponseV0 result. + * @member {"identityContractNonce"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityContractNonceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityContractNonce", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityContractNonceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 instance + */ + GetIdentityContractNonceResponseV0.create = function create(properties) { + return new GetIdentityContractNonceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityContractNonceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityContractNonce != null && Object.hasOwnProperty.call(message, "identityContractNonce")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.identityContractNonce); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityContractNonceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.IGetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityContractNonceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityContractNonce = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityContractNonceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityContractNonceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityContractNonceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityContractNonceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { + properties.result = 1; + if (!$util.isInteger(message.identityContractNonce) && !(message.identityContractNonce && $util.isInteger(message.identityContractNonce.low) && $util.isInteger(message.identityContractNonce.high))) + return "identityContractNonce: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityContractNonceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} GetIdentityContractNonceResponseV0 + */ + GetIdentityContractNonceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0(); + if (object.identityContractNonce != null) + if ($util.Long) + (message.identityContractNonce = $util.Long.fromValue(object.identityContractNonce)).unsigned = true; + else if (typeof object.identityContractNonce === "string") + message.identityContractNonce = parseInt(object.identityContractNonce, 10); + else if (typeof object.identityContractNonce === "number") + message.identityContractNonce = object.identityContractNonce; + else if (typeof object.identityContractNonce === "object") + message.identityContractNonce = new $util.LongBits(object.identityContractNonce.low >>> 0, object.identityContractNonce.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityContractNonceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0} message GetIdentityContractNonceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityContractNonceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityContractNonce != null && message.hasOwnProperty("identityContractNonce")) { + if (typeof message.identityContractNonce === "number") + object.identityContractNonce = options.longs === String ? String(message.identityContractNonce) : message.identityContractNonce; + else + object.identityContractNonce = options.longs === String ? $util.Long.prototype.toString.call(message.identityContractNonce) : options.longs === Number ? new $util.LongBits(message.identityContractNonce.low >>> 0, message.identityContractNonce.high >>> 0).toNumber(true) : message.identityContractNonce; + if (options.oneofs) + object.result = "identityContractNonce"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityContractNonceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityContractNonceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityContractNonceResponseV0; + })(); + + return GetIdentityContractNonceResponse; + })(); + + v0.GetIdentityBalanceResponse = (function() { + + /** + * Properties of a GetIdentityBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceResponse + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null} [v0] GetIdentityBalanceResponse v0 + */ + + /** + * Constructs a new GetIdentityBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceResponse. + * @implements IGetIdentityBalanceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set + */ + function GetIdentityBalanceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + */ + GetIdentityBalanceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + */ + Object.defineProperty(GetIdentityBalanceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse instance + */ + GetIdentityBalanceResponse.create = function create(properties) { + return new GetIdentityBalanceResponse(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse + */ + GetIdentityBalanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} message GetIdentityBalanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 = (function() { + + /** + * Properties of a GetIdentityBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @interface IGetIdentityBalanceResponseV0 + * @property {number|Long|null} [balance] GetIdentityBalanceResponseV0 balance + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @classdesc Represents a GetIdentityBalanceResponseV0. + * @implements IGetIdentityBalanceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set + */ + function GetIdentityBalanceResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceResponseV0 balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetIdentityBalanceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.proof = null; + + /** + * GetIdentityBalanceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + GetIdentityBalanceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceResponseV0 result. + * @member {"balance"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityBalanceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 instance + */ + GetIdentityBalanceResponseV0.create = function create(properties) { + return new GetIdentityBalanceResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.IGetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balance != null && message.hasOwnProperty("balance")) { + properties.result = 1; + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} GetIdentityBalanceResponseV0 + */ + GetIdentityBalanceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0} message GetIdentityBalanceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balance != null && message.hasOwnProperty("balance")) { + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (options.oneofs) + object.result = "balance"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityBalanceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityBalanceResponseV0; + })(); + + return GetIdentityBalanceResponse; + })(); + + v0.GetIdentityBalanceAndRevisionResponse = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityBalanceAndRevisionResponse + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null} [v0] GetIdentityBalanceAndRevisionResponse v0 + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityBalanceAndRevisionResponse. + * @implements IGetIdentityBalanceAndRevisionResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceAndRevisionResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + */ + GetIdentityBalanceAndRevisionResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse instance + */ + GetIdentityBalanceAndRevisionResponse.create = function create(properties) { + return new GetIdentityBalanceAndRevisionResponse(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse + */ + GetIdentityBalanceAndRevisionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 = (function() { + + /** + * Properties of a GetIdentityBalanceAndRevisionResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @interface IGetIdentityBalanceAndRevisionResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null} [balanceAndRevision] GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceAndRevisionResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceAndRevisionResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityBalanceAndRevisionResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @classdesc Represents a GetIdentityBalanceAndRevisionResponseV0. + * @implements IGetIdentityBalanceAndRevisionResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set + */ + function GetIdentityBalanceAndRevisionResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityBalanceAndRevisionResponseV0 balanceAndRevision. + * @member {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision|null|undefined} balanceAndRevision + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.balanceAndRevision = null; + + /** + * GetIdentityBalanceAndRevisionResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.proof = null; + + /** + * GetIdentityBalanceAndRevisionResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityBalanceAndRevisionResponseV0 result. + * @member {"balanceAndRevision"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityBalanceAndRevisionResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balanceAndRevision", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityBalanceAndRevisionResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 instance + */ + GetIdentityBalanceAndRevisionResponseV0.create = function create(properties) { + return new GetIdentityBalanceAndRevisionResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balanceAndRevision != null && Object.hasOwnProperty.call(message, "balanceAndRevision")) + $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.encode(message.balanceAndRevision, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityBalanceAndRevisionResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.IGetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityBalanceAndRevisionResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityBalanceAndRevisionResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityBalanceAndRevisionResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityBalanceAndRevisionResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityBalanceAndRevisionResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify(message.balanceAndRevision); + if (error) + return "balanceAndRevision." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityBalanceAndRevisionResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} GetIdentityBalanceAndRevisionResponseV0 + */ + GetIdentityBalanceAndRevisionResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0(); + if (object.balanceAndRevision != null) { + if (typeof object.balanceAndRevision !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.balanceAndRevision: object expected"); + message.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.fromObject(object.balanceAndRevision); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityBalanceAndRevisionResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0} message GetIdentityBalanceAndRevisionResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityBalanceAndRevisionResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balanceAndRevision != null && message.hasOwnProperty("balanceAndRevision")) { + object.balanceAndRevision = $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.toObject(message.balanceAndRevision, options); + if (options.oneofs) + object.result = "balanceAndRevision"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityBalanceAndRevisionResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityBalanceAndRevisionResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision = (function() { + + /** + * Properties of a BalanceAndRevision. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @interface IBalanceAndRevision + * @property {number|Long|null} [balance] BalanceAndRevision balance + * @property {number|Long|null} [revision] BalanceAndRevision revision + */ + + /** + * Constructs a new BalanceAndRevision. + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0 + * @classdesc Represents a BalanceAndRevision. + * @implements IBalanceAndRevision + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set + */ + function BalanceAndRevision(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BalanceAndRevision balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + */ + BalanceAndRevision.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BalanceAndRevision revision. + * @member {number|Long} revision + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + */ + BalanceAndRevision.prototype.revision = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new BalanceAndRevision instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision instance + */ + BalanceAndRevision.create = function create(properties) { + return new BalanceAndRevision(properties); + }; + + /** + * Encodes the specified BalanceAndRevision message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BalanceAndRevision.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision); + return writer; + }; + + /** + * Encodes the specified BalanceAndRevision message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.IBalanceAndRevision} message BalanceAndRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BalanceAndRevision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BalanceAndRevision message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BalanceAndRevision.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.revision = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BalanceAndRevision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BalanceAndRevision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BalanceAndRevision message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BalanceAndRevision.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision) && !(message.revision && $util.isInteger(message.revision.low) && $util.isInteger(message.revision.high))) + return "revision: integer|Long expected"; + return null; + }; + + /** + * Creates a BalanceAndRevision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} BalanceAndRevision + */ + BalanceAndRevision.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.revision != null) + if ($util.Long) + (message.revision = $util.Long.fromValue(object.revision)).unsigned = true; + else if (typeof object.revision === "string") + message.revision = parseInt(object.revision, 10); + else if (typeof object.revision === "number") + message.revision = object.revision; + else if (typeof object.revision === "object") + message.revision = new $util.LongBits(object.revision.low >>> 0, object.revision.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a BalanceAndRevision message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision} message BalanceAndRevision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BalanceAndRevision.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.revision = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.revision = options.longs === String ? "0" : 0; + } + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (message.revision != null && message.hasOwnProperty("revision")) + if (typeof message.revision === "number") + object.revision = options.longs === String ? String(message.revision) : message.revision; + else + object.revision = options.longs === String ? $util.Long.prototype.toString.call(message.revision) : options.longs === Number ? new $util.LongBits(message.revision.low >>> 0, message.revision.high >>> 0).toNumber(true) : message.revision; + return object; + }; + + /** + * Converts this BalanceAndRevision to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision + * @instance + * @returns {Object.} JSON object + */ + BalanceAndRevision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BalanceAndRevision; + })(); + + return GetIdentityBalanceAndRevisionResponseV0; + })(); + + return GetIdentityBalanceAndRevisionResponse; + })(); + + v0.KeyRequestType = (function() { + + /** + * Properties of a KeyRequestType. + * @memberof org.dash.platform.dapi.v0 + * @interface IKeyRequestType + * @property {org.dash.platform.dapi.v0.IAllKeys|null} [allKeys] KeyRequestType allKeys + * @property {org.dash.platform.dapi.v0.ISpecificKeys|null} [specificKeys] KeyRequestType specificKeys + * @property {org.dash.platform.dapi.v0.ISearchKey|null} [searchKey] KeyRequestType searchKey + */ + + /** + * Constructs a new KeyRequestType. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a KeyRequestType. + * @implements IKeyRequestType + * @constructor + * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set + */ + function KeyRequestType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRequestType allKeys. + * @member {org.dash.platform.dapi.v0.IAllKeys|null|undefined} allKeys + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.allKeys = null; + + /** + * KeyRequestType specificKeys. + * @member {org.dash.platform.dapi.v0.ISpecificKeys|null|undefined} specificKeys + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.specificKeys = null; + + /** + * KeyRequestType searchKey. + * @member {org.dash.platform.dapi.v0.ISearchKey|null|undefined} searchKey + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + KeyRequestType.prototype.searchKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KeyRequestType request. + * @member {"allKeys"|"specificKeys"|"searchKey"|undefined} request + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + */ + Object.defineProperty(KeyRequestType.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["allKeys", "specificKeys", "searchKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyRequestType instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType instance + */ + KeyRequestType.create = function create(properties) { + return new KeyRequestType(properties); + }; + + /** + * Encodes the specified KeyRequestType message. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRequestType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allKeys != null && Object.hasOwnProperty.call(message, "allKeys")) + $root.org.dash.platform.dapi.v0.AllKeys.encode(message.allKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.specificKeys != null && Object.hasOwnProperty.call(message, "specificKeys")) + $root.org.dash.platform.dapi.v0.SpecificKeys.encode(message.specificKeys, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.searchKey != null && Object.hasOwnProperty.call(message, "searchKey")) + $root.org.dash.platform.dapi.v0.SearchKey.encode(message.searchKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KeyRequestType message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRequestType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRequestType message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRequestType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.decode(reader, reader.uint32()); + break; + case 2: + message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.decode(reader, reader.uint32()); + break; + case 3: + message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRequestType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRequestType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRequestType message. + * @function verify + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRequestType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allKeys != null && message.hasOwnProperty("allKeys")) { + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.AllKeys.verify(message.allKeys); + if (error) + return "allKeys." + error; + } + } + if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.SpecificKeys.verify(message.specificKeys); + if (error) + return "specificKeys." + error; + } + } + if (message.searchKey != null && message.hasOwnProperty("searchKey")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.SearchKey.verify(message.searchKey); + if (error) + return "searchKey." + error; + } + } + return null; + }; + + /** + * Creates a KeyRequestType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType + */ + KeyRequestType.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.KeyRequestType) + return object; + var message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); + if (object.allKeys != null) { + if (typeof object.allKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.allKeys: object expected"); + message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.fromObject(object.allKeys); + } + if (object.specificKeys != null) { + if (typeof object.specificKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.specificKeys: object expected"); + message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.fromObject(object.specificKeys); + } + if (object.searchKey != null) { + if (typeof object.searchKey !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.searchKey: object expected"); + message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.fromObject(object.searchKey); + } + return message; + }; + + /** + * Creates a plain object from a KeyRequestType message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @static + * @param {org.dash.platform.dapi.v0.KeyRequestType} message KeyRequestType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRequestType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.allKeys != null && message.hasOwnProperty("allKeys")) { + object.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.toObject(message.allKeys, options); + if (options.oneofs) + object.request = "allKeys"; + } + if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { + object.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.toObject(message.specificKeys, options); + if (options.oneofs) + object.request = "specificKeys"; + } + if (message.searchKey != null && message.hasOwnProperty("searchKey")) { + object.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.toObject(message.searchKey, options); + if (options.oneofs) + object.request = "searchKey"; + } + return object; + }; + + /** + * Converts this KeyRequestType to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.KeyRequestType + * @instance + * @returns {Object.} JSON object + */ + KeyRequestType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KeyRequestType; + })(); + + v0.AllKeys = (function() { + + /** + * Properties of an AllKeys. + * @memberof org.dash.platform.dapi.v0 + * @interface IAllKeys + */ + + /** + * Constructs a new AllKeys. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents an AllKeys. + * @implements IAllKeys + * @constructor + * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set + */ + function AllKeys(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AllKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys instance + */ + AllKeys.create = function create(properties) { + return new AllKeys(properties); + }; + + /** + * Encodes the specified AllKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AllKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.AllKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AllKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys + */ + AllKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.AllKeys) + return object; + return new $root.org.dash.platform.dapi.v0.AllKeys(); + }; + + /** + * Creates a plain object from an AllKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.AllKeys + * @static + * @param {org.dash.platform.dapi.v0.AllKeys} message AllKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllKeys.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AllKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.AllKeys + * @instance + * @returns {Object.} JSON object + */ + AllKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AllKeys; + })(); + + v0.SpecificKeys = (function() { + + /** + * Properties of a SpecificKeys. + * @memberof org.dash.platform.dapi.v0 + * @interface ISpecificKeys + * @property {Array.|null} [keyIds] SpecificKeys keyIds + */ + + /** + * Constructs a new SpecificKeys. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SpecificKeys. + * @implements ISpecificKeys + * @constructor + * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set + */ + function SpecificKeys(properties) { + this.keyIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpecificKeys keyIds. + * @member {Array.} keyIds + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @instance + */ + SpecificKeys.prototype.keyIds = $util.emptyArray; + + /** + * Creates a new SpecificKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys instance + */ + SpecificKeys.create = function create(properties) { + return new SpecificKeys(properties); + }; + + /** + * Encodes the specified SpecificKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecificKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyIds != null && message.keyIds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.keyIds.length; ++i) + writer.uint32(message.keyIds[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SpecificKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecificKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecificKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecificKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keyIds && message.keyIds.length)) + message.keyIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.keyIds.push(reader.uint32()); + } else + message.keyIds.push(reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecificKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecificKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecificKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecificKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyIds != null && message.hasOwnProperty("keyIds")) { + if (!Array.isArray(message.keyIds)) + return "keyIds: array expected"; + for (var i = 0; i < message.keyIds.length; ++i) + if (!$util.isInteger(message.keyIds[i])) + return "keyIds: integer[] expected"; + } + return null; + }; + + /** + * Creates a SpecificKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys + */ + SpecificKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SpecificKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); + if (object.keyIds) { + if (!Array.isArray(object.keyIds)) + throw TypeError(".org.dash.platform.dapi.v0.SpecificKeys.keyIds: array expected"); + message.keyIds = []; + for (var i = 0; i < object.keyIds.length; ++i) + message.keyIds[i] = object.keyIds[i] >>> 0; + } + return message; + }; + + /** + * Creates a plain object from a SpecificKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @static + * @param {org.dash.platform.dapi.v0.SpecificKeys} message SpecificKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecificKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keyIds = []; + if (message.keyIds && message.keyIds.length) { + object.keyIds = []; + for (var j = 0; j < message.keyIds.length; ++j) + object.keyIds[j] = message.keyIds[j]; + } + return object; + }; + + /** + * Converts this SpecificKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SpecificKeys + * @instance + * @returns {Object.} JSON object + */ + SpecificKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SpecificKeys; + })(); + + v0.SearchKey = (function() { + + /** + * Properties of a SearchKey. + * @memberof org.dash.platform.dapi.v0 + * @interface ISearchKey + * @property {Object.|null} [purposeMap] SearchKey purposeMap + */ + + /** + * Constructs a new SearchKey. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SearchKey. + * @implements ISearchKey + * @constructor + * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set + */ + function SearchKey(properties) { + this.purposeMap = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchKey purposeMap. + * @member {Object.} purposeMap + * @memberof org.dash.platform.dapi.v0.SearchKey + * @instance + */ + SearchKey.prototype.purposeMap = $util.emptyObject; + + /** + * Creates a new SearchKey instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey instance + */ + SearchKey.create = function create(properties) { + return new SearchKey(properties); + }; + + /** + * Encodes the specified SearchKey message. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purposeMap != null && Object.hasOwnProperty.call(message, "purposeMap")) + for (var keys = Object.keys(message.purposeMap), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]); + $root.org.dash.platform.dapi.v0.SecurityLevelMap.encode(message.purposeMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SearchKey message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchKey message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SearchKey(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.purposeMap === $util.emptyObject) + message.purposeMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = $root.org.dash.platform.dapi.v0.SecurityLevelMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.purposeMap[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchKey message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purposeMap != null && message.hasOwnProperty("purposeMap")) { + if (!$util.isObject(message.purposeMap)) + return "purposeMap: object expected"; + var key = Object.keys(message.purposeMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "purposeMap: integer key{k:uint32} expected"; + { + var error = $root.org.dash.platform.dapi.v0.SecurityLevelMap.verify(message.purposeMap[key[i]]); + if (error) + return "purposeMap." + error; + } + } + } + return null; + }; + + /** + * Creates a SearchKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey + */ + SearchKey.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SearchKey) + return object; + var message = new $root.org.dash.platform.dapi.v0.SearchKey(); + if (object.purposeMap) { + if (typeof object.purposeMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); + message.purposeMap = {}; + for (var keys = Object.keys(object.purposeMap), i = 0; i < keys.length; ++i) { + if (typeof object.purposeMap[keys[i]] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); + message.purposeMap[keys[i]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.fromObject(object.purposeMap[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchKey message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SearchKey + * @static + * @param {org.dash.platform.dapi.v0.SearchKey} message SearchKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.purposeMap = {}; + var keys2; + if (message.purposeMap && (keys2 = Object.keys(message.purposeMap)).length) { + object.purposeMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.purposeMap[keys2[j]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.toObject(message.purposeMap[keys2[j]], options); + } + return object; + }; + + /** + * Converts this SearchKey to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SearchKey + * @instance + * @returns {Object.} JSON object + */ + SearchKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchKey; + })(); + + v0.SecurityLevelMap = (function() { + + /** + * Properties of a SecurityLevelMap. + * @memberof org.dash.platform.dapi.v0 + * @interface ISecurityLevelMap + * @property {Object.|null} [securityLevelMap] SecurityLevelMap securityLevelMap + */ + + /** + * Constructs a new SecurityLevelMap. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a SecurityLevelMap. + * @implements ISecurityLevelMap + * @constructor + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set + */ + function SecurityLevelMap(properties) { + this.securityLevelMap = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityLevelMap securityLevelMap. + * @member {Object.} securityLevelMap + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @instance + */ + SecurityLevelMap.prototype.securityLevelMap = $util.emptyObject; + + /** + * Creates a new SecurityLevelMap instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap instance + */ + SecurityLevelMap.create = function create(properties) { + return new SecurityLevelMap(properties); + }; + + /** + * Encodes the specified SecurityLevelMap message. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityLevelMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityLevelMap != null && Object.hasOwnProperty.call(message, "securityLevelMap")) + for (var keys = Object.keys(message.securityLevelMap), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.securityLevelMap[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityLevelMap message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityLevelMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityLevelMap message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityLevelMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.securityLevelMap === $util.emptyObject) + message.securityLevelMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.securityLevelMap[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityLevelMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityLevelMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityLevelMap message. + * @function verify + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityLevelMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityLevelMap != null && message.hasOwnProperty("securityLevelMap")) { + if (!$util.isObject(message.securityLevelMap)) + return "securityLevelMap: object expected"; + var key = Object.keys(message.securityLevelMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "securityLevelMap: integer key{k:uint32} expected"; + switch (message.securityLevelMap[key[i]]) { + default: + return "securityLevelMap: enum value{k:uint32} expected"; + case 0: + case 1: + break; + } + } + } + return null; + }; + + /** + * Creates a SecurityLevelMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap + */ + SecurityLevelMap.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SecurityLevelMap) + return object; + var message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(); + if (object.securityLevelMap) { + if (typeof object.securityLevelMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SecurityLevelMap.securityLevelMap: object expected"); + message.securityLevelMap = {}; + for (var keys = Object.keys(object.securityLevelMap), i = 0; i < keys.length; ++i) + switch (object.securityLevelMap[keys[i]]) { + case "CURRENT_KEY_OF_KIND_REQUEST": + case 0: + message.securityLevelMap[keys[i]] = 0; + break; + case "ALL_KEYS_OF_KIND_REQUEST": + case 1: + message.securityLevelMap[keys[i]] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SecurityLevelMap message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.SecurityLevelMap} message SecurityLevelMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityLevelMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.securityLevelMap = {}; + var keys2; + if (message.securityLevelMap && (keys2 = Object.keys(message.securityLevelMap)).length) { + object.securityLevelMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.securityLevelMap[keys2[j]] = options.enums === String ? $root.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType[message.securityLevelMap[keys2[j]]] : message.securityLevelMap[keys2[j]]; + } + return object; + }; + + /** + * Converts this SecurityLevelMap to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap + * @instance + * @returns {Object.} JSON object + */ + SecurityLevelMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * KeyKindRequestType enum. + * @name org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType + * @enum {number} + * @property {number} CURRENT_KEY_OF_KIND_REQUEST=0 CURRENT_KEY_OF_KIND_REQUEST value + * @property {number} ALL_KEYS_OF_KIND_REQUEST=1 ALL_KEYS_OF_KIND_REQUEST value + */ + SecurityLevelMap.KeyKindRequestType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CURRENT_KEY_OF_KIND_REQUEST"] = 0; + values[valuesById[1] = "ALL_KEYS_OF_KIND_REQUEST"] = 1; + return values; + })(); + + return SecurityLevelMap; + })(); + + v0.GetIdentityKeysRequest = (function() { + + /** + * Properties of a GetIdentityKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityKeysRequest + * @property {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null} [v0] GetIdentityKeysRequest v0 + */ + + /** + * Constructs a new GetIdentityKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityKeysRequest. + * @implements IGetIdentityKeysRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set + */ + function GetIdentityKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityKeysRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + */ + GetIdentityKeysRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + */ + Object.defineProperty(GetIdentityKeysRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest instance + */ + GetIdentityKeysRequest.create = function create(properties) { + return new GetIdentityKeysRequest(properties); + }; + + /** + * Encodes the specified GetIdentityKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest + */ + GetIdentityKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest} message GetIdentityKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityKeysRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysRequest.GetIdentityKeysRequestV0 = (function() { + + /** + * Properties of a GetIdentityKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @interface IGetIdentityKeysRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityKeysRequestV0 identityId + * @property {org.dash.platform.dapi.v0.IKeyRequestType|null} [requestType] GetIdentityKeysRequestV0 requestType + * @property {google.protobuf.IUInt32Value|null} [limit] GetIdentityKeysRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetIdentityKeysRequestV0 offset + * @property {boolean|null} [prove] GetIdentityKeysRequestV0 prove + */ + + /** + * Constructs a new GetIdentityKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @classdesc Represents a GetIdentityKeysRequestV0. + * @implements IGetIdentityKeysRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set + */ + function GetIdentityKeysRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityKeysRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityKeysRequestV0 requestType. + * @member {org.dash.platform.dapi.v0.IKeyRequestType|null|undefined} requestType + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.requestType = null; + + /** + * GetIdentityKeysRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.limit = null; + + /** + * GetIdentityKeysRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.offset = null; + + /** + * GetIdentityKeysRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + */ + GetIdentityKeysRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityKeysRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 instance + */ + GetIdentityKeysRequestV0.create = function create(properties) { + return new GetIdentityKeysRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.requestType != null && Object.hasOwnProperty.call(message, "requestType")) + $root.org.dash.platform.dapi.v0.KeyRequestType.encode(message.requestType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.IGetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.decode(reader, reader.uint32()); + break; + case 3: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.requestType != null && message.hasOwnProperty("requestType")) { + var error = $root.org.dash.platform.dapi.v0.KeyRequestType.verify(message.requestType); + if (error) + return "requestType." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityKeysRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} GetIdentityKeysRequestV0 + */ + GetIdentityKeysRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.requestType != null) { + if (typeof object.requestType !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.requestType: object expected"); + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.fromObject(object.requestType); + } + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0} message GetIdentityKeysRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.requestType = null; + object.limit = null; + object.offset = null; + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.requestType != null && message.hasOwnProperty("requestType")) + object.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.toObject(message.requestType, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityKeysRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityKeysRequestV0; + })(); + + return GetIdentityKeysRequest; + })(); + + v0.GetIdentityKeysResponse = (function() { + + /** + * Properties of a GetIdentityKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityKeysResponse + * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null} [v0] GetIdentityKeysResponse v0 + */ + + /** + * Constructs a new GetIdentityKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityKeysResponse. + * @implements IGetIdentityKeysResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set + */ + function GetIdentityKeysResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityKeysResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + */ + GetIdentityKeysResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + */ + Object.defineProperty(GetIdentityKeysResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse instance + */ + GetIdentityKeysResponse.create = function create(properties) { + return new GetIdentityKeysResponse(properties); + }; + + /** + * Encodes the specified GetIdentityKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse + */ + GetIdentityKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} message GetIdentityKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityKeysResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysResponse.GetIdentityKeysResponseV0 = (function() { + + /** + * Properties of a GetIdentityKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @interface IGetIdentityKeysResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null} [keys] GetIdentityKeysResponseV0 keys + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityKeysResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityKeysResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @classdesc Represents a GetIdentityKeysResponseV0. + * @implements IGetIdentityKeysResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set + */ + function GetIdentityKeysResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityKeysResponseV0 keys. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys|null|undefined} keys + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.keys = null; + + /** + * GetIdentityKeysResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.proof = null; + + /** + * GetIdentityKeysResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + GetIdentityKeysResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityKeysResponseV0 result. + * @member {"keys"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityKeysResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["keys", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 instance + */ + GetIdentityKeysResponseV0.create = function create(properties) { + return new GetIdentityKeysResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.encode(message.keys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IGetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityKeysResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityKeysResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityKeysResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.keys != null && message.hasOwnProperty("keys")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify(message.keys); + if (error) + return "keys." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityKeysResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} GetIdentityKeysResponseV0 + */ + GetIdentityKeysResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0(); + if (object.keys != null) { + if (typeof object.keys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.keys: object expected"); + message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.fromObject(object.keys); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityKeysResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0} message GetIdentityKeysResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityKeysResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.keys != null && message.hasOwnProperty("keys")) { + object.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.toObject(message.keys, options); + if (options.oneofs) + object.result = "keys"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityKeysResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityKeysResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityKeysResponseV0.Keys = (function() { + + /** + * Properties of a Keys. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @interface IKeys + * @property {Array.|null} [keysBytes] Keys keysBytes + */ + + /** + * Constructs a new Keys. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0 + * @classdesc Represents a Keys. + * @implements IKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set + */ + function Keys(properties) { + this.keysBytes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Keys keysBytes. + * @member {Array.} keysBytes + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @instance + */ + Keys.prototype.keysBytes = $util.emptyArray; + + /** + * Creates a new Keys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys instance + */ + Keys.create = function create(properties) { + return new Keys(properties); + }; + + /** + * Encodes the specified Keys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Keys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keysBytes != null && message.keysBytes.length) + for (var i = 0; i < message.keysBytes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keysBytes[i]); + return writer; + }; + + /** + * Encodes the specified Keys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.IKeys} message Keys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Keys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Keys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Keys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keysBytes && message.keysBytes.length)) + message.keysBytes = []; + message.keysBytes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Keys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Keys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Keys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Keys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { + if (!Array.isArray(message.keysBytes)) + return "keysBytes: array expected"; + for (var i = 0; i < message.keysBytes.length; ++i) + if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) + return "keysBytes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Keys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} Keys + */ + Keys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys(); + if (object.keysBytes) { + if (!Array.isArray(object.keysBytes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys.keysBytes: array expected"); + message.keysBytes = []; + for (var i = 0; i < object.keysBytes.length; ++i) + if (typeof object.keysBytes[i] === "string") + $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); + else if (object.keysBytes[i].length >= 0) + message.keysBytes[i] = object.keysBytes[i]; + } + return message; + }; + + /** + * Creates a plain object from a Keys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys} message Keys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Keys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keysBytes = []; + if (message.keysBytes && message.keysBytes.length) { + object.keysBytes = []; + for (var j = 0; j < message.keysBytes.length; ++j) + object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; + } + return object; + }; + + /** + * Converts this Keys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys + * @instance + * @returns {Object.} JSON object + */ + Keys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Keys; + })(); + + return GetIdentityKeysResponseV0; + })(); + + return GetIdentityKeysResponse; + })(); + + v0.GetIdentitiesContractKeysRequest = (function() { + + /** + * Properties of a GetIdentitiesContractKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesContractKeysRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null} [v0] GetIdentitiesContractKeysRequest v0 + */ + + /** + * Constructs a new GetIdentitiesContractKeysRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesContractKeysRequest. + * @implements IGetIdentitiesContractKeysRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set + */ + function GetIdentitiesContractKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesContractKeysRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + */ + GetIdentitiesContractKeysRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest instance + */ + GetIdentitiesContractKeysRequest.create = function create(properties) { + return new GetIdentitiesContractKeysRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} GetIdentitiesContractKeysRequest + */ + GetIdentitiesContractKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest} message GetIdentitiesContractKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesContractKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @interface IGetIdentitiesContractKeysRequestV0 + * @property {Array.|null} [identitiesIds] GetIdentitiesContractKeysRequestV0 identitiesIds + * @property {Uint8Array|null} [contractId] GetIdentitiesContractKeysRequestV0 contractId + * @property {string|null} [documentTypeName] GetIdentitiesContractKeysRequestV0 documentTypeName + * @property {Array.|null} [purposes] GetIdentitiesContractKeysRequestV0 purposes + * @property {boolean|null} [prove] GetIdentitiesContractKeysRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesContractKeysRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest + * @classdesc Represents a GetIdentitiesContractKeysRequestV0. + * @implements IGetIdentitiesContractKeysRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set + */ + function GetIdentitiesContractKeysRequestV0(properties) { + this.identitiesIds = []; + this.purposes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesContractKeysRequestV0 identitiesIds. + * @member {Array.} identitiesIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.identitiesIds = $util.emptyArray; + + /** + * GetIdentitiesContractKeysRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetIdentitiesContractKeysRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.documentTypeName = ""; + + /** + * GetIdentitiesContractKeysRequestV0 purposes. + * @member {Array.} purposes + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.purposes = $util.emptyArray; + + /** + * GetIdentitiesContractKeysRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + */ + GetIdentitiesContractKeysRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesContractKeysRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 instance + */ + GetIdentitiesContractKeysRequestV0.create = function create(properties) { + return new GetIdentitiesContractKeysRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesIds != null && message.identitiesIds.length) + for (var i = 0; i < message.identitiesIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identitiesIds[i]); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.documentTypeName); + if (message.purposes != null && message.purposes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.purposes.length; ++i) + writer.int32(message.purposes[i]); + writer.ldelim(); + } + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.IGetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identitiesIds && message.identitiesIds.length)) + message.identitiesIds = []; + message.identitiesIds.push(reader.bytes()); + break; + case 2: + message.contractId = reader.bytes(); + break; + case 3: + message.documentTypeName = reader.string(); + break; + case 4: + if (!(message.purposes && message.purposes.length)) + message.purposes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.purposes.push(reader.int32()); + } else + message.purposes.push(reader.int32()); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identitiesIds != null && message.hasOwnProperty("identitiesIds")) { + if (!Array.isArray(message.identitiesIds)) + return "identitiesIds: array expected"; + for (var i = 0; i < message.identitiesIds.length; ++i) + if (!(message.identitiesIds[i] && typeof message.identitiesIds[i].length === "number" || $util.isString(message.identitiesIds[i]))) + return "identitiesIds: buffer[] expected"; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.purposes != null && message.hasOwnProperty("purposes")) { + if (!Array.isArray(message.purposes)) + return "purposes: array expected"; + for (var i = 0; i < message.purposes.length; ++i) + switch (message.purposes[i]) { + default: + return "purposes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} GetIdentitiesContractKeysRequestV0 + */ + GetIdentitiesContractKeysRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0(); + if (object.identitiesIds) { + if (!Array.isArray(object.identitiesIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.identitiesIds: array expected"); + message.identitiesIds = []; + for (var i = 0; i < object.identitiesIds.length; ++i) + if (typeof object.identitiesIds[i] === "string") + $util.base64.decode(object.identitiesIds[i], message.identitiesIds[i] = $util.newBuffer($util.base64.length(object.identitiesIds[i])), 0); + else if (object.identitiesIds[i].length >= 0) + message.identitiesIds[i] = object.identitiesIds[i]; + } + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.purposes) { + if (!Array.isArray(object.purposes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0.purposes: array expected"); + message.purposes = []; + for (var i = 0; i < object.purposes.length; ++i) + switch (object.purposes[i]) { + default: + case "AUTHENTICATION": + case 0: + message.purposes[i] = 0; + break; + case "ENCRYPTION": + case 1: + message.purposes[i] = 1; + break; + case "DECRYPTION": + case 2: + message.purposes[i] = 2; + break; + case "TRANSFER": + case 3: + message.purposes[i] = 3; + break; + case "VOTING": + case 5: + message.purposes[i] = 5; + break; + } + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0} message GetIdentitiesContractKeysRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.identitiesIds = []; + object.purposes = []; + } + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.prove = false; + } + if (message.identitiesIds && message.identitiesIds.length) { + object.identitiesIds = []; + for (var j = 0; j < message.identitiesIds.length; ++j) + object.identitiesIds[j] = options.bytes === String ? $util.base64.encode(message.identitiesIds[j], 0, message.identitiesIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identitiesIds[j]) : message.identitiesIds[j]; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.purposes && message.purposes.length) { + object.purposes = []; + for (var j = 0; j < message.purposes.length; ++j) + object.purposes[j] = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purposes[j]] : message.purposes[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesContractKeysRequestV0; + })(); + + return GetIdentitiesContractKeysRequest; + })(); + + v0.GetIdentitiesContractKeysResponse = (function() { + + /** + * Properties of a GetIdentitiesContractKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesContractKeysResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null} [v0] GetIdentitiesContractKeysResponse v0 + */ + + /** + * Constructs a new GetIdentitiesContractKeysResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesContractKeysResponse. + * @implements IGetIdentitiesContractKeysResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set + */ + function GetIdentitiesContractKeysResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesContractKeysResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + */ + GetIdentitiesContractKeysResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse instance + */ + GetIdentitiesContractKeysResponse.create = function create(properties) { + return new GetIdentitiesContractKeysResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} GetIdentitiesContractKeysResponse + */ + GetIdentitiesContractKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse} message GetIdentitiesContractKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesContractKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @interface IGetIdentitiesContractKeysResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null} [identitiesKeys] GetIdentitiesContractKeysResponseV0 identitiesKeys + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesContractKeysResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesContractKeysResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesContractKeysResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse + * @classdesc Represents a GetIdentitiesContractKeysResponseV0. + * @implements IGetIdentitiesContractKeysResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set + */ + function GetIdentitiesContractKeysResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesContractKeysResponseV0 identitiesKeys. + * @member {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys|null|undefined} identitiesKeys + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.identitiesKeys = null; + + /** + * GetIdentitiesContractKeysResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.proof = null; + + /** + * GetIdentitiesContractKeysResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + GetIdentitiesContractKeysResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesContractKeysResponseV0 result. + * @member {"identitiesKeys"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesContractKeysResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identitiesKeys", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesContractKeysResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 instance + */ + GetIdentitiesContractKeysResponseV0.create = function create(properties) { + return new GetIdentitiesContractKeysResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesKeys != null && Object.hasOwnProperty.call(message, "identitiesKeys")) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.encode(message.identitiesKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesContractKeysResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.IGetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesContractKeysResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesContractKeysResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesContractKeysResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesContractKeysResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesContractKeysResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify(message.identitiesKeys); + if (error) + return "identitiesKeys." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesContractKeysResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} GetIdentitiesContractKeysResponseV0 + */ + GetIdentitiesContractKeysResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0(); + if (object.identitiesKeys != null) { + if (typeof object.identitiesKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.identitiesKeys: object expected"); + message.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.fromObject(object.identitiesKeys); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesContractKeysResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0} message GetIdentitiesContractKeysResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesContractKeysResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identitiesKeys != null && message.hasOwnProperty("identitiesKeys")) { + object.identitiesKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.toObject(message.identitiesKeys, options); + if (options.oneofs) + object.result = "identitiesKeys"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesContractKeysResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesContractKeysResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesContractKeysResponseV0.PurposeKeys = (function() { + + /** + * Properties of a PurposeKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IPurposeKeys + * @property {org.dash.platform.dapi.v0.KeyPurpose|null} [purpose] PurposeKeys purpose + * @property {Array.|null} [keysBytes] PurposeKeys keysBytes + */ + + /** + * Constructs a new PurposeKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents a PurposeKeys. + * @implements IPurposeKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set + */ + function PurposeKeys(properties) { + this.keysBytes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurposeKeys purpose. + * @member {org.dash.platform.dapi.v0.KeyPurpose} purpose + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + */ + PurposeKeys.prototype.purpose = 0; + + /** + * PurposeKeys keysBytes. + * @member {Array.} keysBytes + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + */ + PurposeKeys.prototype.keysBytes = $util.emptyArray; + + /** + * Creates a new PurposeKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys instance + */ + PurposeKeys.create = function create(properties) { + return new PurposeKeys(properties); + }; + + /** + * Encodes the specified PurposeKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurposeKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purpose != null && Object.hasOwnProperty.call(message, "purpose")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.purpose); + if (message.keysBytes != null && message.keysBytes.length) + for (var i = 0; i < message.keysBytes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keysBytes[i]); + return writer; + }; + + /** + * Encodes the specified PurposeKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IPurposeKeys} message PurposeKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurposeKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurposeKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurposeKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purpose = reader.int32(); + break; + case 2: + if (!(message.keysBytes && message.keysBytes.length)) + message.keysBytes = []; + message.keysBytes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurposeKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurposeKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurposeKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurposeKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purpose != null && message.hasOwnProperty("purpose")) + switch (message.purpose) { + default: + return "purpose: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { + if (!Array.isArray(message.keysBytes)) + return "keysBytes: array expected"; + for (var i = 0; i < message.keysBytes.length; ++i) + if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) + return "keysBytes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a PurposeKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} PurposeKeys + */ + PurposeKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys(); + switch (object.purpose) { + case "AUTHENTICATION": + case 0: + message.purpose = 0; + break; + case "ENCRYPTION": + case 1: + message.purpose = 1; + break; + case "DECRYPTION": + case 2: + message.purpose = 2; + break; + case "TRANSFER": + case 3: + message.purpose = 3; + break; + case "VOTING": + case 5: + message.purpose = 5; + break; + } + if (object.keysBytes) { + if (!Array.isArray(object.keysBytes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.keysBytes: array expected"); + message.keysBytes = []; + for (var i = 0; i < object.keysBytes.length; ++i) + if (typeof object.keysBytes[i] === "string") + $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); + else if (object.keysBytes[i].length >= 0) + message.keysBytes[i] = object.keysBytes[i]; + } + return message; + }; + + /** + * Creates a plain object from a PurposeKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys} message PurposeKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurposeKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keysBytes = []; + if (options.defaults) + object.purpose = options.enums === String ? "AUTHENTICATION" : 0; + if (message.purpose != null && message.hasOwnProperty("purpose")) + object.purpose = options.enums === String ? $root.org.dash.platform.dapi.v0.KeyPurpose[message.purpose] : message.purpose; + if (message.keysBytes && message.keysBytes.length) { + object.keysBytes = []; + for (var j = 0; j < message.keysBytes.length; ++j) + object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; + } + return object; + }; + + /** + * Converts this PurposeKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys + * @instance + * @returns {Object.} JSON object + */ + PurposeKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PurposeKeys; + })(); + + GetIdentitiesContractKeysResponseV0.IdentityKeys = (function() { + + /** + * Properties of an IdentityKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IIdentityKeys + * @property {Uint8Array|null} [identityId] IdentityKeys identityId + * @property {Array.|null} [keys] IdentityKeys keys + */ + + /** + * Constructs a new IdentityKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents an IdentityKeys. + * @implements IIdentityKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set + */ + function IdentityKeys(properties) { + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityKeys identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + */ + IdentityKeys.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityKeys keys. + * @member {Array.} keys + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + */ + IdentityKeys.prototype.keys = $util.emptyArray; + + /** + * Creates a new IdentityKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys instance + */ + IdentityKeys.create = function create(properties) { + return new IdentityKeys(properties); + }; + + /** + * Encodes the specified IdentityKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.encode(message.keys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentityKeys} message IdentityKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + return null; + }; + + /** + * Creates an IdentityKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} IdentityKeys + */ + IdentityKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.keys: object expected"); + message.keys[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.fromObject(object.keys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys} message IdentityKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys.toObject(message.keys[j], options); + } + return object; + }; + + /** + * Converts this IdentityKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys + * @instance + * @returns {Object.} JSON object + */ + IdentityKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityKeys; + })(); + + GetIdentitiesContractKeysResponseV0.IdentitiesKeys = (function() { + + /** + * Properties of an IdentitiesKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @interface IIdentitiesKeys + * @property {Array.|null} [entries] IdentitiesKeys entries + */ + + /** + * Constructs a new IdentitiesKeys. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0 + * @classdesc Represents an IdentitiesKeys. + * @implements IIdentitiesKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set + */ + function IdentitiesKeys(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentitiesKeys entries. + * @member {Array.} entries + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @instance + */ + IdentitiesKeys.prototype.entries = $util.emptyArray; + + /** + * Creates a new IdentitiesKeys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys instance + */ + IdentitiesKeys.create = function create(properties) { + return new IdentitiesKeys(properties); + }; + + /** + * Encodes the specified IdentitiesKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesKeys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentitiesKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IIdentitiesKeys} message IdentitiesKeys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesKeys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentitiesKeys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesKeys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentitiesKeys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesKeys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentitiesKeys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitiesKeys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an IdentitiesKeys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} IdentitiesKeys + */ + IdentitiesKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys.entries: object expected"); + message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentitiesKeys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys} message IdentitiesKeys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitiesKeys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this IdentitiesKeys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys + * @instance + * @returns {Object.} JSON object + */ + IdentitiesKeys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentitiesKeys; + })(); + + return GetIdentitiesContractKeysResponseV0; + })(); + + return GetIdentitiesContractKeysResponse; + })(); + + v0.GetEvonodesProposedEpochBlocksByIdsRequest = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByIdsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksByIdsRequest + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByIdsRequest v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequest. + * @implements IGetEvonodesProposedEpochBlocksByIdsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByIdsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksByIdsRequest v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByIdsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByIdsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest instance + */ + GetEvonodesProposedEpochBlocksByIdsRequest.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByIdsRequest(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByIdsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByIdsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByIdsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} GetEvonodesProposedEpochBlocksByIdsRequest + */ + GetEvonodesProposedEpochBlocksByIdsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest} message GetEvonodesProposedEpochBlocksByIdsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByIdsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByIdsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByIdsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @interface IGetEvonodesProposedEpochBlocksByIdsRequestV0 + * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch + * @property {Array.|null} [ids] GetEvonodesProposedEpochBlocksByIdsRequestV0 ids + * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByIdsRequestV0 prove + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest + * @classdesc Represents a GetEvonodesProposedEpochBlocksByIdsRequestV0. + * @implements IGetEvonodesProposedEpochBlocksByIdsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByIdsRequestV0(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.epoch = 0; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetEvonodesProposedEpochBlocksByIdsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.prove = false; + + /** + * Creates a new GetEvonodesProposedEpochBlocksByIdsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 instance + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByIdsRequestV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByIdsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.IGetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.uint32(); + break; + case 2: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByIdsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} GetEvonodesProposedEpochBlocksByIdsRequestV0 + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0(); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByIdsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0} message GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) { + object.epoch = 0; + object.prove = false; + } + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByIdsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByIdsRequest.GetEvonodesProposedEpochBlocksByIdsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByIdsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEvonodesProposedEpochBlocksByIdsRequestV0; + })(); + + return GetEvonodesProposedEpochBlocksByIdsRequest; + })(); + + v0.GetEvonodesProposedEpochBlocksResponse = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksResponse + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null} [v0] GetEvonodesProposedEpochBlocksResponse v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksResponse. + * @implements IGetEvonodesProposedEpochBlocksResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksResponse v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + */ + GetEvonodesProposedEpochBlocksResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse instance + */ + GetEvonodesProposedEpochBlocksResponse.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksResponse(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} GetEvonodesProposedEpochBlocksResponse + */ + GetEvonodesProposedEpochBlocksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse} message GetEvonodesProposedEpochBlocksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @interface IGetEvonodesProposedEpochBlocksResponseV0 + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null} [evonodesProposedBlockCountsInfo] GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEvonodesProposedEpochBlocksResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEvonodesProposedEpochBlocksResponseV0 metadata + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse + * @classdesc Represents a GetEvonodesProposedEpochBlocksResponseV0. + * @implements IGetEvonodesProposedEpochBlocksResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksResponseV0 evonodesProposedBlockCountsInfo. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks|null|undefined} evonodesProposedBlockCountsInfo + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.evonodesProposedBlockCountsInfo = null; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.proof = null; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksResponseV0 result. + * @member {"evonodesProposedBlockCountsInfo"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["evonodesProposedBlockCountsInfo", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 instance + */ + GetEvonodesProposedEpochBlocksResponseV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksResponseV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evonodesProposedBlockCountsInfo != null && Object.hasOwnProperty.call(message, "evonodesProposedBlockCountsInfo")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.encode(message.evonodesProposedBlockCountsInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.IGetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify(message.evonodesProposedBlockCountsInfo); + if (error) + return "evonodesProposedBlockCountsInfo." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} GetEvonodesProposedEpochBlocksResponseV0 + */ + GetEvonodesProposedEpochBlocksResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0(); + if (object.evonodesProposedBlockCountsInfo != null) { + if (typeof object.evonodesProposedBlockCountsInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.evonodesProposedBlockCountsInfo: object expected"); + message.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.fromObject(object.evonodesProposedBlockCountsInfo); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0} message GetEvonodesProposedEpochBlocksResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.evonodesProposedBlockCountsInfo != null && message.hasOwnProperty("evonodesProposedBlockCountsInfo")) { + object.evonodesProposedBlockCountsInfo = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.toObject(message.evonodesProposedBlockCountsInfo, options); + if (options.oneofs) + object.result = "evonodesProposedBlockCountsInfo"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks = (function() { + + /** + * Properties of an EvonodeProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @interface IEvonodeProposedBlocks + * @property {Uint8Array|null} [proTxHash] EvonodeProposedBlocks proTxHash + * @property {number|Long|null} [count] EvonodeProposedBlocks count + */ + + /** + * Constructs a new EvonodeProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @classdesc Represents an EvonodeProposedBlocks. + * @implements IEvonodeProposedBlocks + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set + */ + function EvonodeProposedBlocks(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvonodeProposedBlocks proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + */ + EvonodeProposedBlocks.prototype.proTxHash = $util.newBuffer([]); + + /** + * EvonodeProposedBlocks count. + * @member {number|Long} count + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + */ + EvonodeProposedBlocks.prototype.count = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new EvonodeProposedBlocks instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks instance + */ + EvonodeProposedBlocks.create = function create(properties) { + return new EvonodeProposedBlocks(properties); + }; + + /** + * Encodes the specified EvonodeProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodeProposedBlocks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.count); + return writer; + }; + + /** + * Encodes the specified EvonodeProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodeProposedBlocks} message EvonodeProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodeProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvonodeProposedBlocks message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodeProposedBlocks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.count = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvonodeProposedBlocks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodeProposedBlocks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvonodeProposedBlocks message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvonodeProposedBlocks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates an EvonodeProposedBlocks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} EvonodeProposedBlocks + */ + EvonodeProposedBlocks.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = true; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an EvonodeProposedBlocks message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks} message EvonodeProposedBlocks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvonodeProposedBlocks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber(true) : message.count; + return object; + }; + + /** + * Converts this EvonodeProposedBlocks to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks + * @instance + * @returns {Object.} JSON object + */ + EvonodeProposedBlocks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvonodeProposedBlocks; + })(); + + GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks = (function() { + + /** + * Properties of an EvonodesProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @interface IEvonodesProposedBlocks + * @property {Array.|null} [evonodesProposedBlockCounts] EvonodesProposedBlocks evonodesProposedBlockCounts + */ + + /** + * Constructs a new EvonodesProposedBlocks. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0 + * @classdesc Represents an EvonodesProposedBlocks. + * @implements IEvonodesProposedBlocks + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set + */ + function EvonodesProposedBlocks(properties) { + this.evonodesProposedBlockCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvonodesProposedBlocks evonodesProposedBlockCounts. + * @member {Array.} evonodesProposedBlockCounts + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @instance + */ + EvonodesProposedBlocks.prototype.evonodesProposedBlockCounts = $util.emptyArray; + + /** + * Creates a new EvonodesProposedBlocks instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks instance + */ + EvonodesProposedBlocks.create = function create(properties) { + return new EvonodesProposedBlocks(properties); + }; + + /** + * Encodes the specified EvonodesProposedBlocks message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodesProposedBlocks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evonodesProposedBlockCounts != null && message.evonodesProposedBlockCounts.length) + for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.encode(message.evonodesProposedBlockCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvonodesProposedBlocks message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.IEvonodesProposedBlocks} message EvonodesProposedBlocks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvonodesProposedBlocks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvonodesProposedBlocks message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodesProposedBlocks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length)) + message.evonodesProposedBlockCounts = []; + message.evonodesProposedBlockCounts.push($root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvonodesProposedBlocks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvonodesProposedBlocks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvonodesProposedBlocks message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvonodesProposedBlocks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evonodesProposedBlockCounts != null && message.hasOwnProperty("evonodesProposedBlockCounts")) { + if (!Array.isArray(message.evonodesProposedBlockCounts)) + return "evonodesProposedBlockCounts: array expected"; + for (var i = 0; i < message.evonodesProposedBlockCounts.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.verify(message.evonodesProposedBlockCounts[i]); + if (error) + return "evonodesProposedBlockCounts." + error; + } + } + return null; + }; + + /** + * Creates an EvonodesProposedBlocks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} EvonodesProposedBlocks + */ + EvonodesProposedBlocks.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks(); + if (object.evonodesProposedBlockCounts) { + if (!Array.isArray(object.evonodesProposedBlockCounts)) + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: array expected"); + message.evonodesProposedBlockCounts = []; + for (var i = 0; i < object.evonodesProposedBlockCounts.length; ++i) { + if (typeof object.evonodesProposedBlockCounts[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks.evonodesProposedBlockCounts: object expected"); + message.evonodesProposedBlockCounts[i] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.fromObject(object.evonodesProposedBlockCounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EvonodesProposedBlocks message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks} message EvonodesProposedBlocks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvonodesProposedBlocks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evonodesProposedBlockCounts = []; + if (message.evonodesProposedBlockCounts && message.evonodesProposedBlockCounts.length) { + object.evonodesProposedBlockCounts = []; + for (var j = 0; j < message.evonodesProposedBlockCounts.length; ++j) + object.evonodesProposedBlockCounts[j] = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodeProposedBlocks.toObject(message.evonodesProposedBlockCounts[j], options); + } + return object; + }; + + /** + * Converts this EvonodesProposedBlocks to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksResponse.GetEvonodesProposedEpochBlocksResponseV0.EvonodesProposedBlocks + * @instance + * @returns {Object.} JSON object + */ + EvonodesProposedBlocks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EvonodesProposedBlocks; + })(); + + return GetEvonodesProposedEpochBlocksResponseV0; + })(); + + return GetEvonodesProposedEpochBlocksResponse; + })(); + + v0.GetEvonodesProposedEpochBlocksByRangeRequest = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByRangeRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEvonodesProposedEpochBlocksByRangeRequest + * @property {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null} [v0] GetEvonodesProposedEpochBlocksByRangeRequest v0 + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequest. + * @implements IGetEvonodesProposedEpochBlocksByRangeRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByRangeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksByRangeRequest v0. + * @member {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByRangeRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest instance + */ + GetEvonodesProposedEpochBlocksByRangeRequest.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByRangeRequest(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByRangeRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByRangeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByRangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} GetEvonodesProposedEpochBlocksByRangeRequest + */ + GetEvonodesProposedEpochBlocksByRangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest} message GetEvonodesProposedEpochBlocksByRangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByRangeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByRangeRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByRangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 = (function() { + + /** + * Properties of a GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @interface IGetEvonodesProposedEpochBlocksByRangeRequestV0 + * @property {number|null} [epoch] GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch + * @property {number|null} [limit] GetEvonodesProposedEpochBlocksByRangeRequestV0 limit + * @property {Uint8Array|null} [startAfter] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter + * @property {Uint8Array|null} [startAt] GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt + * @property {boolean|null} [prove] GetEvonodesProposedEpochBlocksByRangeRequestV0 prove + */ + + /** + * Constructs a new GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest + * @classdesc Represents a GetEvonodesProposedEpochBlocksByRangeRequestV0. + * @implements IGetEvonodesProposedEpochBlocksByRangeRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set + */ + function GetEvonodesProposedEpochBlocksByRangeRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.epoch = 0; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.limit = 0; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAfter = $util.newBuffer([]); + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.startAt = $util.newBuffer([]); + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEvonodesProposedEpochBlocksByRangeRequestV0 start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + */ + Object.defineProperty(GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEvonodesProposedEpochBlocksByRangeRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 instance + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.create = function create(properties) { + return new GetEvonodesProposedEpochBlocksByRangeRequestV0(properties); + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.epoch); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEvonodesProposedEpochBlocksByRangeRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.IGetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.uint32(); + break; + case 2: + message.limit = reader.uint32(); + break; + case 3: + message.startAfter = reader.bytes(); + break; + case 4: + message.startAt = reader.bytes(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEvonodesProposedEpochBlocksByRangeRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} GetEvonodesProposedEpochBlocksByRangeRequestV0 + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0(); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEvonodesProposedEpochBlocksByRangeRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0} message GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.epoch = 0; + object.limit = 0; + object.prove = false; + } + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (options.oneofs) + object.start = "startAfter"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; + if (options.oneofs) + object.start = "startAt"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEvonodesProposedEpochBlocksByRangeRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEvonodesProposedEpochBlocksByRangeRequest.GetEvonodesProposedEpochBlocksByRangeRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEvonodesProposedEpochBlocksByRangeRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEvonodesProposedEpochBlocksByRangeRequestV0; + })(); + + return GetEvonodesProposedEpochBlocksByRangeRequest; + })(); + + v0.GetIdentitiesBalancesRequest = (function() { + + /** + * Properties of a GetIdentitiesBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null} [v0] GetIdentitiesBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentitiesBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesBalancesRequest. + * @implements IGetIdentitiesBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set + */ + function GetIdentitiesBalancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + */ + GetIdentitiesBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest instance + */ + GetIdentitiesBalancesRequest.create = function create(properties) { + return new GetIdentitiesBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} GetIdentitiesBalancesRequest + */ + GetIdentitiesBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest} message GetIdentitiesBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @interface IGetIdentitiesBalancesRequestV0 + * @property {Array.|null} [ids] GetIdentitiesBalancesRequestV0 ids + * @property {boolean|null} [prove] GetIdentitiesBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest + * @classdesc Represents a GetIdentitiesBalancesRequestV0. + * @implements IGetIdentitiesBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentitiesBalancesRequestV0(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesBalancesRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + */ + GetIdentitiesBalancesRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetIdentitiesBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + */ + GetIdentitiesBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 instance + */ + GetIdentitiesBalancesRequestV0.create = function create(properties) { + return new GetIdentitiesBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.IGetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} GetIdentitiesBalancesRequestV0 + */ + GetIdentitiesBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0} message GetIdentitiesBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) + object.prove = false; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesBalancesRequestV0; + })(); + + return GetIdentitiesBalancesRequest; + })(); + + v0.GetIdentitiesBalancesResponse = (function() { + + /** + * Properties of a GetIdentitiesBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null} [v0] GetIdentitiesBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentitiesBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesBalancesResponse. + * @implements IGetIdentitiesBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set + */ + function GetIdentitiesBalancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + */ + GetIdentitiesBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse instance + */ + GetIdentitiesBalancesResponse.create = function create(properties) { + return new GetIdentitiesBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} GetIdentitiesBalancesResponse + */ + GetIdentitiesBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse} message GetIdentitiesBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @interface IGetIdentitiesBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null} [identitiesBalances] GetIdentitiesBalancesResponseV0 identitiesBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse + * @classdesc Represents a GetIdentitiesBalancesResponseV0. + * @implements IGetIdentitiesBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentitiesBalancesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesBalancesResponseV0 identitiesBalances. + * @member {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances|null|undefined} identitiesBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.identitiesBalances = null; + + /** + * GetIdentitiesBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentitiesBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + GetIdentitiesBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesBalancesResponseV0 result. + * @member {"identitiesBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identitiesBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 instance + */ + GetIdentitiesBalancesResponseV0.create = function create(properties) { + return new GetIdentitiesBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identitiesBalances != null && Object.hasOwnProperty.call(message, "identitiesBalances")) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.encode(message.identitiesBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.IGetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify(message.identitiesBalances); + if (error) + return "identitiesBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} GetIdentitiesBalancesResponseV0 + */ + GetIdentitiesBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0(); + if (object.identitiesBalances != null) { + if (typeof object.identitiesBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.identitiesBalances: object expected"); + message.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.fromObject(object.identitiesBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0} message GetIdentitiesBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identitiesBalances != null && message.hasOwnProperty("identitiesBalances")) { + object.identitiesBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.toObject(message.identitiesBalances, options); + if (options.oneofs) + object.result = "identitiesBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesBalancesResponseV0.IdentityBalance = (function() { + + /** + * Properties of an IdentityBalance. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @interface IIdentityBalance + * @property {Uint8Array|null} [identityId] IdentityBalance identityId + * @property {number|Long|null} [balance] IdentityBalance balance + */ + + /** + * Constructs a new IdentityBalance. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @classdesc Represents an IdentityBalance. + * @implements IIdentityBalance + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set + */ + function IdentityBalance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityBalance identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + */ + IdentityBalance.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityBalance balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + */ + IdentityBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new IdentityBalance instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance instance + */ + IdentityBalance.create = function create(properties) { + return new IdentityBalance(properties); + }; + + /** + * Encodes the specified IdentityBalance message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityBalance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified IdentityBalance message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentityBalance} message IdentityBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityBalance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityBalance message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityBalance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityBalance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityBalance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityBalance message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityBalance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates an IdentityBalance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} IdentityBalance + */ + IdentityBalance.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an IdentityBalance message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance} message IdentityBalance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityBalance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this IdentityBalance to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance + * @instance + * @returns {Object.} JSON object + */ + IdentityBalance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityBalance; + })(); + + GetIdentitiesBalancesResponseV0.IdentitiesBalances = (function() { + + /** + * Properties of an IdentitiesBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @interface IIdentitiesBalances + * @property {Array.|null} [entries] IdentitiesBalances entries + */ + + /** + * Constructs a new IdentitiesBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0 + * @classdesc Represents an IdentitiesBalances. + * @implements IIdentitiesBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set + */ + function IdentitiesBalances(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentitiesBalances entries. + * @member {Array.} entries + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @instance + */ + IdentitiesBalances.prototype.entries = $util.emptyArray; + + /** + * Creates a new IdentitiesBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances instance + */ + IdentitiesBalances.create = function create(properties) { + return new IdentitiesBalances(properties); + }; + + /** + * Encodes the specified IdentitiesBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentitiesBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IIdentitiesBalances} message IdentitiesBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitiesBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentitiesBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesBalances.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentitiesBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitiesBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentitiesBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitiesBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an IdentitiesBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} IdentitiesBalances + */ + IdentitiesBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances.entries: object expected"); + message.entries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentitiesBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances} message IdentitiesBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitiesBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this IdentitiesBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances + * @instance + * @returns {Object.} JSON object + */ + IdentitiesBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentitiesBalances; + })(); + + return GetIdentitiesBalancesResponseV0; + })(); + + return GetIdentitiesBalancesResponse; + })(); + + v0.GetDataContractRequest = (function() { + + /** + * Properties of a GetDataContractRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractRequest + * @property {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null} [v0] GetDataContractRequest v0 + */ + + /** + * Constructs a new GetDataContractRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractRequest. + * @implements IGetDataContractRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set + */ + function GetDataContractRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + */ + GetDataContractRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + */ + Object.defineProperty(GetDataContractRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest instance + */ + GetDataContractRequest.create = function create(properties) { + return new GetDataContractRequest(properties); + }; + + /** + * Encodes the specified GetDataContractRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + */ + GetDataContractRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest} message GetDataContractRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractRequest.GetDataContractRequestV0 = (function() { + + /** + * Properties of a GetDataContractRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @interface IGetDataContractRequestV0 + * @property {Uint8Array|null} [id] GetDataContractRequestV0 id + * @property {boolean|null} [prove] GetDataContractRequestV0 prove + */ + + /** + * Constructs a new GetDataContractRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @classdesc Represents a GetDataContractRequestV0. + * @implements IGetDataContractRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set + */ + function GetDataContractRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + */ + GetDataContractRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetDataContractRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + */ + GetDataContractRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 instance + */ + GetDataContractRequestV0.create = function create(properties) { + return new GetDataContractRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.IGetDataContractRequestV0} message GetDataContractRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} GetDataContractRequestV0 + */ + GetDataContractRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0} message GetDataContractRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractRequestV0; + })(); + + return GetDataContractRequest; + })(); + + v0.GetDataContractResponse = (function() { + + /** + * Properties of a GetDataContractResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractResponse + * @property {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null} [v0] GetDataContractResponse v0 + */ + + /** + * Constructs a new GetDataContractResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractResponse. + * @implements IGetDataContractResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + */ + function GetDataContractResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + GetDataContractResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + Object.defineProperty(GetDataContractResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse instance + */ + GetDataContractResponse.create = function create(properties) { + return new GetDataContractResponse(properties); + }; + + /** + * Encodes the specified GetDataContractResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + */ + GetDataContractResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse} message GetDataContractResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractResponse.GetDataContractResponseV0 = (function() { + + /** + * Properties of a GetDataContractResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @interface IGetDataContractResponseV0 + * @property {Uint8Array|null} [dataContract] GetDataContractResponseV0 dataContract + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @classdesc Represents a GetDataContractResponseV0. + * @implements IGetDataContractResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set + */ + function GetDataContractResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractResponseV0 dataContract. + * @member {Uint8Array} dataContract + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.dataContract = $util.newBuffer([]); + + /** + * GetDataContractResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.proof = null; + + /** + * GetDataContractResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + GetDataContractResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractResponseV0 result. + * @member {"dataContract"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContract", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 instance + */ + GetDataContractResponseV0.create = function create(properties) { + return new GetDataContractResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContract); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.IGetDataContractResponseV0} message GetDataContractResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContract = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + properties.result = 1; + if (!(message.dataContract && typeof message.dataContract.length === "number" || $util.isString(message.dataContract))) + return "dataContract: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} GetDataContractResponseV0 + */ + GetDataContractResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0(); + if (object.dataContract != null) + if (typeof object.dataContract === "string") + $util.base64.decode(object.dataContract, message.dataContract = $util.newBuffer($util.base64.length(object.dataContract)), 0); + else if (object.dataContract.length >= 0) + message.dataContract = object.dataContract; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0} message GetDataContractResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + object.dataContract = options.bytes === String ? $util.base64.encode(message.dataContract, 0, message.dataContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContract) : message.dataContract; + if (options.oneofs) + object.result = "dataContract"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractResponseV0; + })(); + + return GetDataContractResponse; + })(); + + v0.GetDataContractsRequest = (function() { + + /** + * Properties of a GetDataContractsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractsRequest + * @property {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null} [v0] GetDataContractsRequest v0 + */ + + /** + * Constructs a new GetDataContractsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractsRequest. + * @implements IGetDataContractsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set + */ + function GetDataContractsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + */ + GetDataContractsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + */ + Object.defineProperty(GetDataContractsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest instance + */ + GetDataContractsRequest.create = function create(properties) { + return new GetDataContractsRequest(properties); + }; + + /** + * Encodes the specified GetDataContractsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + */ + GetDataContractsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest} message GetDataContractsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractsRequest.GetDataContractsRequestV0 = (function() { + + /** + * Properties of a GetDataContractsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @interface IGetDataContractsRequestV0 + * @property {Array.|null} [ids] GetDataContractsRequestV0 ids + * @property {boolean|null} [prove] GetDataContractsRequestV0 prove + */ + + /** + * Constructs a new GetDataContractsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @classdesc Represents a GetDataContractsRequestV0. + * @implements IGetDataContractsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set + */ + function GetDataContractsRequestV0(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsRequestV0 ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + */ + GetDataContractsRequestV0.prototype.ids = $util.emptyArray; + + /** + * GetDataContractsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + */ + GetDataContractsRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 instance + */ + GetDataContractsRequestV0.create = function create(properties) { + return new GetDataContractsRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.IGetDataContractsRequestV0} message GetDataContractsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} GetDataContractsRequestV0 + */ + GetDataContractsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0} message GetDataContractsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) + object.prove = false; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest.GetDataContractsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractsRequestV0; + })(); + + return GetDataContractsRequest; + })(); + + v0.GetDataContractsResponse = (function() { + + /** + * Properties of a GetDataContractsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractsResponse + * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null} [v0] GetDataContractsResponse v0 + */ + + /** + * Constructs a new GetDataContractsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractsResponse. + * @implements IGetDataContractsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set + */ + function GetDataContractsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + GetDataContractsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + Object.defineProperty(GetDataContractsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse instance + */ + GetDataContractsResponse.create = function create(properties) { + return new GetDataContractsResponse(properties); + }; + + /** + * Encodes the specified GetDataContractsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + */ + GetDataContractsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} message GetDataContractsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractsResponse.DataContractEntry = (function() { + + /** + * Properties of a DataContractEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContractEntry + * @property {Uint8Array|null} [identifier] DataContractEntry identifier + * @property {google.protobuf.IBytesValue|null} [dataContract] DataContractEntry dataContract + */ + + /** + * Constructs a new DataContractEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContractEntry. + * @implements IDataContractEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set + */ + function DataContractEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContractEntry identifier. + * @member {Uint8Array} identifier + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + */ + DataContractEntry.prototype.identifier = $util.newBuffer([]); + + /** + * DataContractEntry dataContract. + * @member {google.protobuf.IBytesValue|null|undefined} dataContract + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + */ + DataContractEntry.prototype.dataContract = null; + + /** + * Creates a new DataContractEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry instance + */ + DataContractEntry.create = function create(properties) { + return new DataContractEntry(properties); + }; + + /** + * Encodes the specified DataContractEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); + if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) + $root.google.protobuf.BytesValue.encode(message.dataContract, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContractEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.bytes(); + break; + case 2: + message.dataContract = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifier != null && message.hasOwnProperty("identifier")) + if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) + return "identifier: buffer expected"; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) { + var error = $root.google.protobuf.BytesValue.verify(message.dataContract); + if (error) + return "dataContract." + error; + } + return null; + }; + + /** + * Creates a DataContractEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + */ + DataContractEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); + if (object.identifier != null) + if (typeof object.identifier === "string") + $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); + else if (object.identifier.length >= 0) + message.identifier = object.identifier; + if (object.dataContract != null) { + if (typeof object.dataContract !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.dataContract: object expected"); + message.dataContract = $root.google.protobuf.BytesValue.fromObject(object.dataContract); + } + return message; + }; + + /** + * Creates a plain object from a DataContractEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} message DataContractEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identifier = ""; + else { + object.identifier = []; + if (options.bytes !== Array) + object.identifier = $util.newBuffer(object.identifier); + } + object.dataContract = null; + } + if (message.identifier != null && message.hasOwnProperty("identifier")) + object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) + object.dataContract = $root.google.protobuf.BytesValue.toObject(message.dataContract, options); + return object; + }; + + /** + * Converts this DataContractEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + * @returns {Object.} JSON object + */ + DataContractEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractEntry; + })(); + + GetDataContractsResponse.DataContracts = (function() { + + /** + * Properties of a DataContracts. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContracts + * @property {Array.|null} [dataContractEntries] DataContracts dataContractEntries + */ + + /** + * Constructs a new DataContracts. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContracts. + * @implements IDataContracts + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set + */ + function DataContracts(properties) { + this.dataContractEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContracts dataContractEntries. + * @member {Array.} dataContractEntries + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @instance + */ + DataContracts.prototype.dataContractEntries = $util.emptyArray; + + /** + * Creates a new DataContracts instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts instance + */ + DataContracts.create = function create(properties) { + return new DataContracts(properties); + }; + + /** + * Encodes the specified DataContracts message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContracts.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractEntries != null && message.dataContractEntries.length) + for (var i = 0; i < message.dataContractEntries.length; ++i) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContracts message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContracts.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContracts message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContracts.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataContractEntries && message.dataContractEntries.length)) + message.dataContractEntries = []; + message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContracts message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContracts.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContracts message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContracts.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { + if (!Array.isArray(message.dataContractEntries)) + return "dataContractEntries: array expected"; + for (var i = 0; i < message.dataContractEntries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify(message.dataContractEntries[i]); + if (error) + return "dataContractEntries." + error; + } + } + return null; + }; + + /** + * Creates a DataContracts message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + */ + DataContracts.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); + if (object.dataContractEntries) { + if (!Array.isArray(object.dataContractEntries)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: array expected"); + message.dataContractEntries = []; + for (var i = 0; i < object.dataContractEntries.length; ++i) { + if (typeof object.dataContractEntries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: object expected"); + message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.fromObject(object.dataContractEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataContracts message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} message DataContracts + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContracts.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataContractEntries = []; + if (message.dataContractEntries && message.dataContractEntries.length) { + object.dataContractEntries = []; + for (var j = 0; j < message.dataContractEntries.length; ++j) + object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject(message.dataContractEntries[j], options); + } + return object; + }; + + /** + * Converts this DataContracts to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @instance + * @returns {Object.} JSON object + */ + DataContracts.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContracts; + })(); + + GetDataContractsResponse.GetDataContractsResponseV0 = (function() { + + /** + * Properties of a GetDataContractsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IGetDataContractsResponseV0 + * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null} [dataContracts] GetDataContractsResponseV0 dataContracts + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractsResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a GetDataContractsResponseV0. + * @implements IGetDataContractsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set + */ + function GetDataContractsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsResponseV0 dataContracts. + * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null|undefined} dataContracts + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.dataContracts = null; + + /** + * GetDataContractsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.proof = null; + + /** + * GetDataContractsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + GetDataContractsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsResponseV0 result. + * @member {"dataContracts"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContracts", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 instance + */ + GetDataContractsResponseV0.create = function create(properties) { + return new GetDataContractsResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContracts != null && Object.hasOwnProperty.call(message, "dataContracts")) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.encode(message.dataContracts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IGetDataContractsResponseV0} message GetDataContractsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify(message.dataContracts); + if (error) + return "dataContracts." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} GetDataContractsResponseV0 + */ + GetDataContractsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0(); + if (object.dataContracts != null) { + if (typeof object.dataContracts !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.dataContracts: object expected"); + message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.fromObject(object.dataContracts); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0} message GetDataContractsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { + object.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(message.dataContracts, options); + if (options.oneofs) + object.result = "dataContracts"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.GetDataContractsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractsResponseV0; + })(); + + return GetDataContractsResponse; + })(); + + v0.GetDataContractHistoryRequest = (function() { + + /** + * Properties of a GetDataContractHistoryRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractHistoryRequest + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null} [v0] GetDataContractHistoryRequest v0 + */ + + /** + * Constructs a new GetDataContractHistoryRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractHistoryRequest. + * @implements IGetDataContractHistoryRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set + */ + function GetDataContractHistoryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractHistoryRequest v0. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + */ + GetDataContractHistoryRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + */ + Object.defineProperty(GetDataContractHistoryRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest instance + */ + GetDataContractHistoryRequest.create = function create(properties) { + return new GetDataContractHistoryRequest(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryRequest} message GetDataContractHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} GetDataContractHistoryRequest + */ + GetDataContractHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest} message GetDataContractHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractHistoryRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 = (function() { + + /** + * Properties of a GetDataContractHistoryRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @interface IGetDataContractHistoryRequestV0 + * @property {Uint8Array|null} [id] GetDataContractHistoryRequestV0 id + * @property {google.protobuf.IUInt32Value|null} [limit] GetDataContractHistoryRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetDataContractHistoryRequestV0 offset + * @property {number|Long|null} [startAtMs] GetDataContractHistoryRequestV0 startAtMs + * @property {boolean|null} [prove] GetDataContractHistoryRequestV0 prove + */ + + /** + * Constructs a new GetDataContractHistoryRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest + * @classdesc Represents a GetDataContractHistoryRequestV0. + * @implements IGetDataContractHistoryRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set + */ + function GetDataContractHistoryRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractHistoryRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetDataContractHistoryRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.limit = null; + + /** + * GetDataContractHistoryRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.offset = null; + + /** + * GetDataContractHistoryRequestV0 startAtMs. + * @member {number|Long} startAtMs + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.startAtMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetDataContractHistoryRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + */ + GetDataContractHistoryRequestV0.prototype.prove = false; + + /** + * Creates a new GetDataContractHistoryRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 instance + */ + GetDataContractHistoryRequestV0.create = function create(properties) { + return new GetDataContractHistoryRequestV0(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startAtMs != null && Object.hasOwnProperty.call(message, "startAtMs")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startAtMs); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.IGetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 3: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.startAtMs = reader.uint64(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) + if (!$util.isInteger(message.startAtMs) && !(message.startAtMs && $util.isInteger(message.startAtMs.low) && $util.isInteger(message.startAtMs.high))) + return "startAtMs: integer|Long expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractHistoryRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} GetDataContractHistoryRequestV0 + */ + GetDataContractHistoryRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.startAtMs != null) + if ($util.Long) + (message.startAtMs = $util.Long.fromValue(object.startAtMs)).unsigned = true; + else if (typeof object.startAtMs === "string") + message.startAtMs = parseInt(object.startAtMs, 10); + else if (typeof object.startAtMs === "number") + message.startAtMs = object.startAtMs; + else if (typeof object.startAtMs === "object") + message.startAtMs = new $util.LongBits(object.startAtMs.low >>> 0, object.startAtMs.high >>> 0).toNumber(true); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0} message GetDataContractHistoryRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.limit = null; + object.offset = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startAtMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startAtMs = options.longs === String ? "0" : 0; + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.startAtMs != null && message.hasOwnProperty("startAtMs")) + if (typeof message.startAtMs === "number") + object.startAtMs = options.longs === String ? String(message.startAtMs) : message.startAtMs; + else + object.startAtMs = options.longs === String ? $util.Long.prototype.toString.call(message.startAtMs) : options.longs === Number ? new $util.LongBits(message.startAtMs.low >>> 0, message.startAtMs.high >>> 0).toNumber(true) : message.startAtMs; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractHistoryRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryRequest.GetDataContractHistoryRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractHistoryRequestV0; + })(); + + return GetDataContractHistoryRequest; + })(); + + v0.GetDataContractHistoryResponse = (function() { + + /** + * Properties of a GetDataContractHistoryResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractHistoryResponse + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null} [v0] GetDataContractHistoryResponse v0 + */ + + /** + * Constructs a new GetDataContractHistoryResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractHistoryResponse. + * @implements IGetDataContractHistoryResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set + */ + function GetDataContractHistoryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractHistoryResponse v0. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + */ + GetDataContractHistoryResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + */ + Object.defineProperty(GetDataContractHistoryResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse instance + */ + GetDataContractHistoryResponse.create = function create(properties) { + return new GetDataContractHistoryResponse(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractHistoryResponse} message GetDataContractHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDataContractHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} GetDataContractHistoryResponse + */ + GetDataContractHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse} message GetDataContractHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDataContractHistoryResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 = (function() { + + /** + * Properties of a GetDataContractHistoryResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @interface IGetDataContractHistoryResponseV0 + * @property {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null} [dataContractHistory] GetDataContractHistoryResponseV0 dataContractHistory + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractHistoryResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractHistoryResponseV0 metadata + */ + + /** + * Constructs a new GetDataContractHistoryResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse + * @classdesc Represents a GetDataContractHistoryResponseV0. + * @implements IGetDataContractHistoryResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set + */ + function GetDataContractHistoryResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractHistoryResponseV0 dataContractHistory. + * @member {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory|null|undefined} dataContractHistory + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.dataContractHistory = null; + + /** + * GetDataContractHistoryResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.proof = null; + + /** + * GetDataContractHistoryResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + GetDataContractHistoryResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractHistoryResponseV0 result. + * @member {"dataContractHistory"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + */ + Object.defineProperty(GetDataContractHistoryResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContractHistory", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractHistoryResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 instance + */ + GetDataContractHistoryResponseV0.create = function create(properties) { + return new GetDataContractHistoryResponseV0(properties); + }; + + /** + * Encodes the specified GetDataContractHistoryResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractHistory != null && Object.hasOwnProperty.call(message, "dataContractHistory")) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.encode(message.dataContractHistory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractHistoryResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.IGetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractHistoryResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractHistoryResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractHistoryResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractHistoryResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractHistoryResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify(message.dataContractHistory); + if (error) + return "dataContractHistory." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractHistoryResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} GetDataContractHistoryResponseV0 + */ + GetDataContractHistoryResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0(); + if (object.dataContractHistory != null) { + if (typeof object.dataContractHistory !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.dataContractHistory: object expected"); + message.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.fromObject(object.dataContractHistory); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractHistoryResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0} message GetDataContractHistoryResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractHistoryResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContractHistory != null && message.hasOwnProperty("dataContractHistory")) { + object.dataContractHistory = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.toObject(message.dataContractHistory, options); + if (options.oneofs) + object.result = "dataContractHistory"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractHistoryResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDataContractHistoryResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractHistoryResponseV0.DataContractHistoryEntry = (function() { + + /** + * Properties of a DataContractHistoryEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @interface IDataContractHistoryEntry + * @property {number|Long|null} [date] DataContractHistoryEntry date + * @property {Uint8Array|null} [value] DataContractHistoryEntry value + */ + + /** + * Constructs a new DataContractHistoryEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @classdesc Represents a DataContractHistoryEntry. + * @implements IDataContractHistoryEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set + */ + function DataContractHistoryEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContractHistoryEntry date. + * @member {number|Long} date + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + */ + DataContractHistoryEntry.prototype.date = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DataContractHistoryEntry value. + * @member {Uint8Array} value + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + */ + DataContractHistoryEntry.prototype.value = $util.newBuffer([]); + + /** + * Creates a new DataContractHistoryEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry instance + */ + DataContractHistoryEntry.create = function create(properties) { + return new DataContractHistoryEntry(properties); + }; + + /** + * Encodes the specified DataContractHistoryEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistoryEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.date != null && Object.hasOwnProperty.call(message, "date")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.date); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified DataContractHistoryEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistoryEntry} message DataContractHistoryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistoryEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractHistoryEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistoryEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.date = reader.uint64(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractHistoryEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistoryEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractHistoryEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractHistoryEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.date != null && message.hasOwnProperty("date")) + if (!$util.isInteger(message.date) && !(message.date && $util.isInteger(message.date.low) && $util.isInteger(message.date.high))) + return "date: integer|Long expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a DataContractHistoryEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} DataContractHistoryEntry + */ + DataContractHistoryEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry(); + if (object.date != null) + if ($util.Long) + (message.date = $util.Long.fromValue(object.date)).unsigned = true; + else if (typeof object.date === "string") + message.date = parseInt(object.date, 10); + else if (typeof object.date === "number") + message.date = object.date; + else if (typeof object.date === "object") + message.date = new $util.LongBits(object.date.low >>> 0, object.date.high >>> 0).toNumber(true); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a DataContractHistoryEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry} message DataContractHistoryEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractHistoryEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.date = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.date != null && message.hasOwnProperty("date")) + if (typeof message.date === "number") + object.date = options.longs === String ? String(message.date) : message.date; + else + object.date = options.longs === String ? $util.Long.prototype.toString.call(message.date) : options.longs === Number ? new $util.LongBits(message.date.low >>> 0, message.date.high >>> 0).toNumber(true) : message.date; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this DataContractHistoryEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry + * @instance + * @returns {Object.} JSON object + */ + DataContractHistoryEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractHistoryEntry; + })(); + + GetDataContractHistoryResponseV0.DataContractHistory = (function() { + + /** + * Properties of a DataContractHistory. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @interface IDataContractHistory + * @property {Array.|null} [dataContractEntries] DataContractHistory dataContractEntries + */ + + /** + * Constructs a new DataContractHistory. + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0 + * @classdesc Represents a DataContractHistory. + * @implements IDataContractHistory + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set + */ + function DataContractHistory(properties) { + this.dataContractEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContractHistory dataContractEntries. + * @member {Array.} dataContractEntries + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @instance + */ + DataContractHistory.prototype.dataContractEntries = $util.emptyArray; + + /** + * Creates a new DataContractHistory instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory instance + */ + DataContractHistory.create = function create(properties) { + return new DataContractHistory(properties); + }; + + /** + * Encodes the specified DataContractHistory message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractEntries != null && message.dataContractEntries.length) + for (var i = 0; i < message.dataContractEntries.length; ++i) + $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContractHistory message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.IDataContractHistory} message DataContractHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractHistory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractHistory message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataContractEntries && message.dataContractEntries.length)) + message.dataContractEntries = []; + message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractHistory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractHistory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractHistory message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractHistory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { + if (!Array.isArray(message.dataContractEntries)) + return "dataContractEntries: array expected"; + for (var i = 0; i < message.dataContractEntries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.verify(message.dataContractEntries[i]); + if (error) + return "dataContractEntries." + error; + } + } + return null; + }; + + /** + * Creates a DataContractHistory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} DataContractHistory + */ + DataContractHistory.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory(); + if (object.dataContractEntries) { + if (!Array.isArray(object.dataContractEntries)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: array expected"); + message.dataContractEntries = []; + for (var i = 0; i < object.dataContractEntries.length; ++i) { + if (typeof object.dataContractEntries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory.dataContractEntries: object expected"); + message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.fromObject(object.dataContractEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataContractHistory message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory} message DataContractHistory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractHistory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataContractEntries = []; + if (message.dataContractEntries && message.dataContractEntries.length) { + object.dataContractEntries = []; + for (var j = 0; j < message.dataContractEntries.length; ++j) + object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistoryEntry.toObject(message.dataContractEntries[j], options); + } + return object; + }; + + /** + * Converts this DataContractHistory to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractHistoryResponse.GetDataContractHistoryResponseV0.DataContractHistory + * @instance + * @returns {Object.} JSON object + */ + DataContractHistory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractHistory; + })(); + + return GetDataContractHistoryResponseV0; + })(); + + return GetDataContractHistoryResponse; + })(); + + v0.GetDocumentsRequest = (function() { + + /** + * Properties of a GetDocumentsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsRequest + * @property {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null} [v0] GetDocumentsRequest v0 + */ + + /** + * Constructs a new GetDocumentsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsRequest. + * @implements IGetDocumentsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + */ + function GetDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsRequest v0. + * @member {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + Object.defineProperty(GetDocumentsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest instance + */ + GetDocumentsRequest.create = function create(properties) { + return new GetDocumentsRequest(properties); + }; + + /** + * Encodes the specified GetDocumentsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + */ + GetDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest} message GetDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDocumentsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsRequest.GetDocumentsRequestV0 = (function() { + + /** + * Properties of a GetDocumentsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @interface IGetDocumentsRequestV0 + * @property {Uint8Array|null} [dataContractId] GetDocumentsRequestV0 dataContractId + * @property {string|null} [documentType] GetDocumentsRequestV0 documentType + * @property {Uint8Array|null} [where] GetDocumentsRequestV0 where + * @property {Uint8Array|null} [orderBy] GetDocumentsRequestV0 orderBy + * @property {number|null} [limit] GetDocumentsRequestV0 limit + * @property {Uint8Array|null} [startAfter] GetDocumentsRequestV0 startAfter + * @property {Uint8Array|null} [startAt] GetDocumentsRequestV0 startAt + * @property {boolean|null} [prove] GetDocumentsRequestV0 prove + */ + + /** + * Constructs a new GetDocumentsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @classdesc Represents a GetDocumentsRequestV0. + * @implements IGetDocumentsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set + */ + function GetDocumentsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsRequestV0 dataContractId. + * @member {Uint8Array} dataContractId + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.dataContractId = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 documentType. + * @member {string} documentType + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.documentType = ""; + + /** + * GetDocumentsRequestV0 where. + * @member {Uint8Array} where + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.where = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 orderBy. + * @member {Uint8Array} orderBy + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.orderBy = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.limit = 0; + + /** + * GetDocumentsRequestV0 startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.startAfter = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.startAt = $util.newBuffer([]); + + /** + * GetDocumentsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + GetDocumentsRequestV0.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsRequestV0 start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + */ + Object.defineProperty(GetDocumentsRequestV0.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 instance + */ + GetDocumentsRequestV0.create = function create(properties) { + return new GetDocumentsRequestV0(properties); + }; + + /** + * Encodes the specified GetDocumentsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); + if (message.where != null && Object.hasOwnProperty.call(message, "where")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDocumentsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.IGetDocumentsRequestV0} message GetDocumentsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractId = reader.bytes(); + break; + case 2: + message.documentType = reader.string(); + break; + case 3: + message.where = reader.bytes(); + break; + case 4: + message.orderBy = reader.bytes(); + break; + case 5: + message.limit = reader.uint32(); + break; + case 6: + message.startAfter = reader.bytes(); + break; + case 7: + message.startAt = reader.bytes(); + break; + case 8: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) + return "dataContractId: buffer expected"; + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; + if (message.where != null && message.hasOwnProperty("where")) + if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) + return "where: buffer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) + return "orderBy: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDocumentsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} GetDocumentsRequestV0 + */ + GetDocumentsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0(); + if (object.dataContractId != null) + if (typeof object.dataContractId === "string") + $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); + else if (object.dataContractId.length >= 0) + message.dataContractId = object.dataContractId; + if (object.documentType != null) + message.documentType = String(object.documentType); + if (object.where != null) + if (typeof object.where === "string") + $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); + else if (object.where.length >= 0) + message.where = object.where; + if (object.orderBy != null) + if (typeof object.orderBy === "string") + $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); + else if (object.orderBy.length >= 0) + message.orderBy = object.orderBy; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0} message GetDocumentsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.dataContractId = ""; + else { + object.dataContractId = []; + if (options.bytes !== Array) + object.dataContractId = $util.newBuffer(object.dataContractId); + } + object.documentType = ""; + if (options.bytes === String) + object.where = ""; + else { + object.where = []; + if (options.bytes !== Array) + object.where = $util.newBuffer(object.where); + } + if (options.bytes === String) + object.orderBy = ""; + else { + object.orderBy = []; + if (options.bytes !== Array) + object.orderBy = $util.newBuffer(object.orderBy); + } + object.limit = 0; + object.prove = false; + } + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; + if (message.where != null && message.hasOwnProperty("where")) + object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (options.oneofs) + object.start = "startAfter"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; + if (options.oneofs) + object.start = "startAt"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDocumentsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDocumentsRequestV0; + })(); + + return GetDocumentsRequest; + })(); + + v0.GetDocumentsResponse = (function() { + + /** + * Properties of a GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsResponse + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null} [v0] GetDocumentsResponse v0 + */ + + /** + * Constructs a new GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsResponse. + * @implements IGetDocumentsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + */ + function GetDocumentsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsResponse v0. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + Object.defineProperty(GetDocumentsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance + */ + GetDocumentsResponse.create = function create(properties) { + return new GetDocumentsResponse(properties); + }; + + /** + * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + */ + GetDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetDocumentsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsResponse.GetDocumentsResponseV0 = (function() { + + /** + * Properties of a GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @interface IGetDocumentsResponseV0 + * @property {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null} [documents] GetDocumentsResponseV0 documents + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponseV0 metadata + */ + + /** + * Constructs a new GetDocumentsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @classdesc Represents a GetDocumentsResponseV0. + * @implements IGetDocumentsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set + */ + function GetDocumentsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsResponseV0 documents. + * @member {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments|null|undefined} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.documents = null; + + /** + * GetDocumentsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.proof = null; + + /** + * GetDocumentsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + GetDocumentsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsResponseV0 result. + * @member {"documents"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + */ + Object.defineProperty(GetDocumentsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["documents", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 instance + */ + GetDocumentsResponseV0.create = function create(properties) { + return new GetDocumentsResponseV0(properties); + }; + + /** + * Encodes the specified GetDocumentsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && Object.hasOwnProperty.call(message, "documents")) + $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.encode(message.documents, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.IGetDocumentsResponseV0} message GetDocumentsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.documents != null && message.hasOwnProperty("documents")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify(message.documents); + if (error) + return "documents." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDocumentsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} GetDocumentsResponseV0 + */ + GetDocumentsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0(); + if (object.documents != null) { + if (typeof object.documents !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.documents: object expected"); + message.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.fromObject(object.documents); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0} message GetDocumentsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.documents != null && message.hasOwnProperty("documents")) { + object.documents = $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.toObject(message.documents, options); + if (options.oneofs) + object.result = "documents"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDocumentsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDocumentsResponseV0.Documents = (function() { + + /** + * Properties of a Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ + + /** + * Constructs a new Documents. + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + */ + function Documents(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Documents documents. + * @member {Array.} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; + + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; + + /** + * Encodes the specified Documents message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); + return writer; + }; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documents message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) + return "documents: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + if (typeof object.documents[i] === "string") + $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); + else if (object.documents[i].length >= 0) + message.documents[i] = object.documents[i]; + } + return message; + }; + + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; + } + return object; + }; + + /** + * Converts this Documents to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Documents; + })(); + + return GetDocumentsResponseV0; + })(); + + return GetDocumentsResponse; + })(); + + v0.GetIdentityByPublicKeyHashRequest = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityByPublicKeyHashRequest + * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null} [v0] GetIdentityByPublicKeyHashRequest v0 + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityByPublicKeyHashRequest. + * @implements IGetIdentityByPublicKeyHashRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + */ + GetIdentityByPublicKeyHashRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest instance + */ + GetIdentityByPublicKeyHashRequest.create = function create(properties) { + return new GetIdentityByPublicKeyHashRequest(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} GetIdentityByPublicKeyHashRequest + */ + GetIdentityByPublicKeyHashRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest} message GetIdentityByPublicKeyHashRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @interface IGetIdentityByPublicKeyHashRequestV0 + * @property {Uint8Array|null} [publicKeyHash] GetIdentityByPublicKeyHashRequestV0 publicKeyHash + * @property {boolean|null} [prove] GetIdentityByPublicKeyHashRequestV0 prove + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest + * @classdesc Represents a GetIdentityByPublicKeyHashRequestV0. + * @implements IGetIdentityByPublicKeyHashRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashRequestV0 publicKeyHash. + * @member {Uint8Array} publicKeyHash + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + */ + GetIdentityByPublicKeyHashRequestV0.prototype.publicKeyHash = $util.newBuffer([]); + + /** + * GetIdentityByPublicKeyHashRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + */ + GetIdentityByPublicKeyHashRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityByPublicKeyHashRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 instance + */ + GetIdentityByPublicKeyHashRequestV0.create = function create(properties) { + return new GetIdentityByPublicKeyHashRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKeyHash != null && Object.hasOwnProperty.call(message, "publicKeyHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKeyHash); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.IGetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKeyHash = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) + if (!(message.publicKeyHash && typeof message.publicKeyHash.length === "number" || $util.isString(message.publicKeyHash))) + return "publicKeyHash: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} GetIdentityByPublicKeyHashRequestV0 + */ + GetIdentityByPublicKeyHashRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0(); + if (object.publicKeyHash != null) + if (typeof object.publicKeyHash === "string") + $util.base64.decode(object.publicKeyHash, message.publicKeyHash = $util.newBuffer($util.base64.length(object.publicKeyHash)), 0); + else if (object.publicKeyHash.length >= 0) + message.publicKeyHash = object.publicKeyHash; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0} message GetIdentityByPublicKeyHashRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.publicKeyHash = ""; + else { + object.publicKeyHash = []; + if (options.bytes !== Array) + object.publicKeyHash = $util.newBuffer(object.publicKeyHash); + } + object.prove = false; + } + if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) + object.publicKeyHash = options.bytes === String ? $util.base64.encode(message.publicKeyHash, 0, message.publicKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeyHash) : message.publicKeyHash; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityByPublicKeyHashRequestV0; + })(); + + return GetIdentityByPublicKeyHashRequest; + })(); + + v0.GetIdentityByPublicKeyHashResponse = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityByPublicKeyHashResponse + * @property {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null} [v0] GetIdentityByPublicKeyHashResponse v0 + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityByPublicKeyHashResponse. + * @implements IGetIdentityByPublicKeyHashResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + */ + GetIdentityByPublicKeyHashResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse instance + */ + GetIdentityByPublicKeyHashResponse.create = function create(properties) { + return new GetIdentityByPublicKeyHashResponse(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} GetIdentityByPublicKeyHashResponse + */ + GetIdentityByPublicKeyHashResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse} message GetIdentityByPublicKeyHashResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @interface IGetIdentityByPublicKeyHashResponseV0 + * @property {Uint8Array|null} [identity] GetIdentityByPublicKeyHashResponseV0 identity + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityByPublicKeyHashResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityByPublicKeyHashResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse + * @classdesc Represents a GetIdentityByPublicKeyHashResponseV0. + * @implements IGetIdentityByPublicKeyHashResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashResponseV0 identity. + * @member {Uint8Array} identity + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.identity = $util.newBuffer([]); + + /** + * GetIdentityByPublicKeyHashResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.proof = null; + + /** + * GetIdentityByPublicKeyHashResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + GetIdentityByPublicKeyHashResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashResponseV0 result. + * @member {"identity"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 instance + */ + GetIdentityByPublicKeyHashResponseV0.create = function create(properties) { + return new GetIdentityByPublicKeyHashResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.IGetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identity != null && message.hasOwnProperty("identity")) { + properties.result = 1; + if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) + return "identity: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} GetIdentityByPublicKeyHashResponseV0 + */ + GetIdentityByPublicKeyHashResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0(); + if (object.identity != null) + if (typeof object.identity === "string") + $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); + else if (object.identity.length >= 0) + message.identity = object.identity; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0} message GetIdentityByPublicKeyHashResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identity != null && message.hasOwnProperty("identity")) { + object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; + if (options.oneofs) + object.result = "identity"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityByPublicKeyHashResponseV0; + })(); + + return GetIdentityByPublicKeyHashResponse; + })(); + + v0.WaitForStateTransitionResultRequest = (function() { + + /** + * Properties of a WaitForStateTransitionResultRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IWaitForStateTransitionResultRequest + * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null} [v0] WaitForStateTransitionResultRequest v0 + */ + + /** + * Constructs a new WaitForStateTransitionResultRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a WaitForStateTransitionResultRequest. + * @implements IWaitForStateTransitionResultRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + */ + function WaitForStateTransitionResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultRequest v0. + * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + */ + WaitForStateTransitionResultRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest instance + */ + WaitForStateTransitionResultRequest.create = function create(properties) { + return new WaitForStateTransitionResultRequest(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + */ + WaitForStateTransitionResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this WaitForStateTransitionResultRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 = (function() { + + /** + * Properties of a WaitForStateTransitionResultRequestV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @interface IWaitForStateTransitionResultRequestV0 + * @property {Uint8Array|null} [stateTransitionHash] WaitForStateTransitionResultRequestV0 stateTransitionHash + * @property {boolean|null} [prove] WaitForStateTransitionResultRequestV0 prove + */ + + /** + * Constructs a new WaitForStateTransitionResultRequestV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @classdesc Represents a WaitForStateTransitionResultRequestV0. + * @implements IWaitForStateTransitionResultRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set + */ + function WaitForStateTransitionResultRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultRequestV0 stateTransitionHash. + * @member {Uint8Array} stateTransitionHash + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + */ + WaitForStateTransitionResultRequestV0.prototype.stateTransitionHash = $util.newBuffer([]); + + /** + * WaitForStateTransitionResultRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + */ + WaitForStateTransitionResultRequestV0.prototype.prove = false; + + /** + * Creates a new WaitForStateTransitionResultRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 instance + */ + WaitForStateTransitionResultRequestV0.create = function create(properties) { + return new WaitForStateTransitionResultRequestV0(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransitionHash); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.IWaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransitionHash = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) + if (!(message.stateTransitionHash && typeof message.stateTransitionHash.length === "number" || $util.isString(message.stateTransitionHash))) + return "stateTransitionHash: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a WaitForStateTransitionResultRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} WaitForStateTransitionResultRequestV0 + */ + WaitForStateTransitionResultRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0(); + if (object.stateTransitionHash != null) + if (typeof object.stateTransitionHash === "string") + $util.base64.decode(object.stateTransitionHash, message.stateTransitionHash = $util.newBuffer($util.base64.length(object.stateTransitionHash)), 0); + else if (object.stateTransitionHash.length >= 0) + message.stateTransitionHash = object.stateTransitionHash; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0} message WaitForStateTransitionResultRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.stateTransitionHash = ""; + else { + object.stateTransitionHash = []; + if (options.bytes !== Array) + object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); + } + object.prove = false; + } + if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) + object.stateTransitionHash = options.bytes === String ? $util.base64.encode(message.stateTransitionHash, 0, message.stateTransitionHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransitionHash) : message.stateTransitionHash; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this WaitForStateTransitionResultRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0 + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitForStateTransitionResultRequestV0; + })(); + + return WaitForStateTransitionResultRequest; + })(); + + v0.WaitForStateTransitionResultResponse = (function() { + + /** + * Properties of a WaitForStateTransitionResultResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IWaitForStateTransitionResultResponse + * @property {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null} [v0] WaitForStateTransitionResultResponse v0 + */ + + /** + * Constructs a new WaitForStateTransitionResultResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a WaitForStateTransitionResultResponse. + * @implements IWaitForStateTransitionResultResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + */ + function WaitForStateTransitionResultResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultResponse v0. + * @member {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + WaitForStateTransitionResultResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse instance + */ + WaitForStateTransitionResultResponse.create = function create(properties) { + return new WaitForStateTransitionResultResponse(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + */ + WaitForStateTransitionResultResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this WaitForStateTransitionResultResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 = (function() { + + /** + * Properties of a WaitForStateTransitionResultResponseV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @interface IWaitForStateTransitionResultResponseV0 + * @property {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null} [error] WaitForStateTransitionResultResponseV0 error + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] WaitForStateTransitionResultResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] WaitForStateTransitionResultResponseV0 metadata + */ + + /** + * Constructs a new WaitForStateTransitionResultResponseV0. + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @classdesc Represents a WaitForStateTransitionResultResponseV0. + * @implements IWaitForStateTransitionResultResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set + */ + function WaitForStateTransitionResultResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultResponseV0 error. + * @member {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null|undefined} error + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.error = null; + + /** + * WaitForStateTransitionResultResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.proof = null; + + /** + * WaitForStateTransitionResultResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + WaitForStateTransitionResultResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultResponseV0 result. + * @member {"error"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 instance + */ + WaitForStateTransitionResultResponseV0.create = function create(properties) { + return new WaitForStateTransitionResultResponseV0(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.IWaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} WaitForStateTransitionResultResponseV0 + */ + WaitForStateTransitionResultResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.error: object expected"); + message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.fromObject(object.error); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0} message WaitForStateTransitionResultResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this WaitForStateTransitionResultResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0 + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitForStateTransitionResultResponseV0; + })(); + + return WaitForStateTransitionResultResponse; + })(); + + v0.GetConsensusParamsRequest = (function() { + + /** + * Properties of a GetConsensusParamsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetConsensusParamsRequest + * @property {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null} [v0] GetConsensusParamsRequest v0 + */ + + /** + * Constructs a new GetConsensusParamsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetConsensusParamsRequest. + * @implements IGetConsensusParamsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + */ + function GetConsensusParamsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsRequest v0. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + */ + GetConsensusParamsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetConsensusParamsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + */ + Object.defineProperty(GetConsensusParamsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetConsensusParamsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest instance + */ + GetConsensusParamsRequest.create = function create(properties) { + return new GetConsensusParamsRequest(properties); + }; + + /** + * Encodes the specified GetConsensusParamsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetConsensusParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + */ + GetConsensusParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest} message GetConsensusParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetConsensusParamsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetConsensusParamsRequest.GetConsensusParamsRequestV0 = (function() { + + /** + * Properties of a GetConsensusParamsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @interface IGetConsensusParamsRequestV0 + * @property {number|null} [height] GetConsensusParamsRequestV0 height + * @property {boolean|null} [prove] GetConsensusParamsRequestV0 prove + */ + + /** + * Constructs a new GetConsensusParamsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @classdesc Represents a GetConsensusParamsRequestV0. + * @implements IGetConsensusParamsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set + */ + function GetConsensusParamsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsRequestV0 height. + * @member {number} height + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + */ + GetConsensusParamsRequestV0.prototype.height = 0; + + /** + * GetConsensusParamsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + */ + GetConsensusParamsRequestV0.prototype.prove = false; + + /** + * Creates a new GetConsensusParamsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 instance + */ + GetConsensusParamsRequestV0.create = function create(properties) { + return new GetConsensusParamsRequestV0(properties); + }; + + /** + * Encodes the specified GetConsensusParamsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.height); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.IGetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int32(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetConsensusParamsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} GetConsensusParamsRequestV0 + */ + GetConsensusParamsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0(); + if (object.height != null) + message.height = object.height | 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0} message GetConsensusParamsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.height = 0; + object.prove = false; + } + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetConsensusParamsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest.GetConsensusParamsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetConsensusParamsRequestV0; + })(); + + return GetConsensusParamsRequest; + })(); + + v0.GetConsensusParamsResponse = (function() { + + /** + * Properties of a GetConsensusParamsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetConsensusParamsResponse + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null} [v0] GetConsensusParamsResponse v0 + */ + + /** + * Constructs a new GetConsensusParamsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetConsensusParamsResponse. + * @implements IGetConsensusParamsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + */ + function GetConsensusParamsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsResponse v0. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + */ + GetConsensusParamsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetConsensusParamsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + */ + Object.defineProperty(GetConsensusParamsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetConsensusParamsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse instance + */ + GetConsensusParamsResponse.create = function create(properties) { + return new GetConsensusParamsResponse(properties); + }; + + /** + * Encodes the specified GetConsensusParamsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetConsensusParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + */ + GetConsensusParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} message GetConsensusParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetConsensusParamsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetConsensusParamsResponse.ConsensusParamsBlock = (function() { + + /** + * Properties of a ConsensusParamsBlock. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IConsensusParamsBlock + * @property {string|null} [maxBytes] ConsensusParamsBlock maxBytes + * @property {string|null} [maxGas] ConsensusParamsBlock maxGas + * @property {string|null} [timeIotaMs] ConsensusParamsBlock timeIotaMs + */ + + /** + * Constructs a new ConsensusParamsBlock. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a ConsensusParamsBlock. + * @implements IConsensusParamsBlock + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set + */ + function ConsensusParamsBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParamsBlock maxBytes. + * @member {string} maxBytes + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.maxBytes = ""; + + /** + * ConsensusParamsBlock maxGas. + * @member {string} maxGas + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.maxGas = ""; + + /** + * ConsensusParamsBlock timeIotaMs. + * @member {string} timeIotaMs + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.timeIotaMs = ""; + + /** + * Creates a new ConsensusParamsBlock instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock instance + */ + ConsensusParamsBlock.create = function create(properties) { + return new ConsensusParamsBlock(properties); + }; + + /** + * Encodes the specified ConsensusParamsBlock message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxGas); + if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeIotaMs); + return writer; + }; + + /** + * Encodes the specified ConsensusParamsBlock message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParamsBlock message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.string(); + break; + case 2: + message.maxGas = reader.string(); + break; + case 3: + message.timeIotaMs = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParamsBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParamsBlock message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParamsBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isString(message.maxBytes)) + return "maxBytes: string expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isString(message.maxGas)) + return "maxGas: string expected"; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (!$util.isString(message.timeIotaMs)) + return "timeIotaMs: string expected"; + return null; + }; + + /** + * Creates a ConsensusParamsBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} ConsensusParamsBlock + */ + ConsensusParamsBlock.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock(); + if (object.maxBytes != null) + message.maxBytes = String(object.maxBytes); + if (object.maxGas != null) + message.maxGas = String(object.maxGas); + if (object.timeIotaMs != null) + message.timeIotaMs = String(object.timeIotaMs); + return message; + }; + + /** + * Creates a plain object from a ConsensusParamsBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock} message ConsensusParamsBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParamsBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxBytes = ""; + object.maxGas = ""; + object.timeIotaMs = ""; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + object.maxBytes = message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + object.maxGas = message.maxGas; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + object.timeIotaMs = message.timeIotaMs; + return object; + }; + + /** + * Converts this ConsensusParamsBlock to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock + * @instance + * @returns {Object.} JSON object + */ + ConsensusParamsBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParamsBlock; + })(); + + GetConsensusParamsResponse.ConsensusParamsEvidence = (function() { + + /** + * Properties of a ConsensusParamsEvidence. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IConsensusParamsEvidence + * @property {string|null} [maxAgeNumBlocks] ConsensusParamsEvidence maxAgeNumBlocks + * @property {string|null} [maxAgeDuration] ConsensusParamsEvidence maxAgeDuration + * @property {string|null} [maxBytes] ConsensusParamsEvidence maxBytes + */ + + /** + * Constructs a new ConsensusParamsEvidence. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a ConsensusParamsEvidence. + * @implements IConsensusParamsEvidence + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set + */ + function ConsensusParamsEvidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParamsEvidence maxAgeNumBlocks. + * @member {string} maxAgeNumBlocks + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxAgeNumBlocks = ""; + + /** + * ConsensusParamsEvidence maxAgeDuration. + * @member {string} maxAgeDuration + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxAgeDuration = ""; + + /** + * ConsensusParamsEvidence maxBytes. + * @member {string} maxBytes + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxBytes = ""; + + /** + * Creates a new ConsensusParamsEvidence instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence instance + */ + ConsensusParamsEvidence.create = function create(properties) { + return new ConsensusParamsEvidence(properties); + }; + + /** + * Encodes the specified ConsensusParamsEvidence message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxAgeNumBlocks); + if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxAgeDuration); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxBytes); + return writer; + }; + + /** + * Encodes the specified ConsensusParamsEvidence message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParamsEvidence message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.string(); + break; + case 2: + message.maxAgeDuration = reader.string(); + break; + case 3: + message.maxBytes = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParamsEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParamsEvidence message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParamsEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (!$util.isString(message.maxAgeNumBlocks)) + return "maxAgeNumBlocks: string expected"; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + if (!$util.isString(message.maxAgeDuration)) + return "maxAgeDuration: string expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isString(message.maxBytes)) + return "maxBytes: string expected"; + return null; + }; + + /** + * Creates a ConsensusParamsEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} ConsensusParamsEvidence + */ + ConsensusParamsEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence(); + if (object.maxAgeNumBlocks != null) + message.maxAgeNumBlocks = String(object.maxAgeNumBlocks); + if (object.maxAgeDuration != null) + message.maxAgeDuration = String(object.maxAgeDuration); + if (object.maxBytes != null) + message.maxBytes = String(object.maxBytes); + return message; + }; + + /** + * Creates a plain object from a ConsensusParamsEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence} message ConsensusParamsEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParamsEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxAgeNumBlocks = ""; + object.maxAgeDuration = ""; + object.maxBytes = ""; + } + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + object.maxAgeNumBlocks = message.maxAgeNumBlocks; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + object.maxAgeDuration = message.maxAgeDuration; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + object.maxBytes = message.maxBytes; + return object; + }; + + /** + * Converts this ConsensusParamsEvidence to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence + * @instance + * @returns {Object.} JSON object + */ + ConsensusParamsEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParamsEvidence; + })(); + + GetConsensusParamsResponse.GetConsensusParamsResponseV0 = (function() { + + /** + * Properties of a GetConsensusParamsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @interface IGetConsensusParamsResponseV0 + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null} [block] GetConsensusParamsResponseV0 block + * @property {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null} [evidence] GetConsensusParamsResponseV0 evidence + */ + + /** + * Constructs a new GetConsensusParamsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @classdesc Represents a GetConsensusParamsResponseV0. + * @implements IGetConsensusParamsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set + */ + function GetConsensusParamsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsResponseV0 block. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsBlock|null|undefined} block + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + */ + GetConsensusParamsResponseV0.prototype.block = null; + + /** + * GetConsensusParamsResponseV0 evidence. + * @member {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IConsensusParamsEvidence|null|undefined} evidence + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + */ + GetConsensusParamsResponseV0.prototype.evidence = null; + + /** + * Creates a new GetConsensusParamsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 instance + */ + GetConsensusParamsResponseV0.create = function create(properties) { + return new GetConsensusParamsResponseV0(properties); + }; + + /** + * Encodes the specified GetConsensusParamsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.IGetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.verify(message.evidence); + if (error) + return "evidence." + error; + } + return null; + }; + + /** + * Creates a GetConsensusParamsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} GetConsensusParamsResponseV0 + */ + GetConsensusParamsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.block: object expected"); + message.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0.evidence: object expected"); + message.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.fromObject(object.evidence); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0} message GetConsensusParamsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsBlock.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse.ConsensusParamsEvidence.toObject(message.evidence, options); + return object; + }; + + /** + * Converts this GetConsensusParamsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse.GetConsensusParamsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetConsensusParamsResponseV0; + })(); + + return GetConsensusParamsResponse; + })(); + + v0.GetProtocolVersionUpgradeStateRequest = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeStateRequest + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null} [v0] GetProtocolVersionUpgradeStateRequest v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeStateRequest. + * @implements IGetProtocolVersionUpgradeStateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeStateRequest v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + */ + GetProtocolVersionUpgradeStateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest instance + */ + GetProtocolVersionUpgradeStateRequest.create = function create(properties) { + return new GetProtocolVersionUpgradeStateRequest(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} GetProtocolVersionUpgradeStateRequest + */ + GetProtocolVersionUpgradeStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest} message GetProtocolVersionUpgradeStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @interface IGetProtocolVersionUpgradeStateRequestV0 + * @property {boolean|null} [prove] GetProtocolVersionUpgradeStateRequestV0 prove + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest + * @classdesc Represents a GetProtocolVersionUpgradeStateRequestV0. + * @implements IGetProtocolVersionUpgradeStateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeStateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @instance + */ + GetProtocolVersionUpgradeStateRequestV0.prototype.prove = false; + + /** + * Creates a new GetProtocolVersionUpgradeStateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 instance + */ + GetProtocolVersionUpgradeStateRequestV0.create = function create(properties) { + return new GetProtocolVersionUpgradeStateRequestV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.IGetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} GetProtocolVersionUpgradeStateRequestV0 + */ + GetProtocolVersionUpgradeStateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0} message GetProtocolVersionUpgradeStateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prove = false; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateRequest.GetProtocolVersionUpgradeStateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProtocolVersionUpgradeStateRequestV0; + })(); + + return GetProtocolVersionUpgradeStateRequest; + })(); + + v0.GetProtocolVersionUpgradeStateResponse = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeStateResponse + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null} [v0] GetProtocolVersionUpgradeStateResponse v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeStateResponse. + * @implements IGetProtocolVersionUpgradeStateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeStateResponse v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + */ + GetProtocolVersionUpgradeStateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse instance + */ + GetProtocolVersionUpgradeStateResponse.create = function create(properties) { + return new GetProtocolVersionUpgradeStateResponse(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} GetProtocolVersionUpgradeStateResponse + */ + GetProtocolVersionUpgradeStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse} message GetProtocolVersionUpgradeStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @interface IGetProtocolVersionUpgradeStateResponseV0 + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null} [versions] GetProtocolVersionUpgradeStateResponseV0 versions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeStateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeStateResponseV0 metadata + */ + + /** + * Constructs a new GetProtocolVersionUpgradeStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse + * @classdesc Represents a GetProtocolVersionUpgradeStateResponseV0. + * @implements IGetProtocolVersionUpgradeStateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeStateResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeStateResponseV0 versions. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions|null|undefined} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.versions = null; + + /** + * GetProtocolVersionUpgradeStateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.proof = null; + + /** + * GetProtocolVersionUpgradeStateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeStateResponseV0 result. + * @member {"versions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeStateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeStateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 instance + */ + GetProtocolVersionUpgradeStateResponseV0.create = function create(properties) { + return new GetProtocolVersionUpgradeStateResponseV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.IGetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeStateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeStateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeStateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeStateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.versions != null && message.hasOwnProperty("versions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify(message.versions); + if (error) + return "versions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeStateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} GetProtocolVersionUpgradeStateResponseV0 + */ + GetProtocolVersionUpgradeStateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0(); + if (object.versions != null) { + if (typeof object.versions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.versions: object expected"); + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.fromObject(object.versions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeStateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0} message GetProtocolVersionUpgradeStateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeStateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.versions != null && message.hasOwnProperty("versions")) { + object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.toObject(message.versions, options); + if (options.oneofs) + object.result = "versions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeStateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeStateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeStateResponseV0.Versions = (function() { + + /** + * Properties of a Versions. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @interface IVersions + * @property {Array.|null} [versions] Versions versions + */ + + /** + * Constructs a new Versions. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @classdesc Represents a Versions. + * @implements IVersions + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set + */ + function Versions(properties) { + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Versions versions. + * @member {Array.} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @instance + */ + Versions.prototype.versions = $util.emptyArray; + + /** + * Creates a new Versions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions instance + */ + Versions.create = function create(properties) { + return new Versions(properties); + }; + + /** + * Encodes the specified Versions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Versions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.encode(message.versions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Versions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersions} message Versions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Versions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Versions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Versions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Versions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Versions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Versions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Versions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + return null; + }; + + /** + * Creates a Versions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} Versions + */ + Versions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions.versions: object expected"); + message.versions[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.fromObject(object.versions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Versions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions} message Versions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Versions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.toObject(message.versions[j], options); + } + return object; + }; + + /** + * Converts this Versions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.Versions + * @instance + * @returns {Object.} JSON object + */ + Versions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Versions; + })(); + + GetProtocolVersionUpgradeStateResponseV0.VersionEntry = (function() { + + /** + * Properties of a VersionEntry. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @interface IVersionEntry + * @property {number|null} [versionNumber] VersionEntry versionNumber + * @property {number|null} [voteCount] VersionEntry voteCount + */ + + /** + * Constructs a new VersionEntry. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0 + * @classdesc Represents a VersionEntry. + * @implements IVersionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set + */ + function VersionEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionEntry versionNumber. + * @member {number} versionNumber + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + */ + VersionEntry.prototype.versionNumber = 0; + + /** + * VersionEntry voteCount. + * @member {number} voteCount + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + */ + VersionEntry.prototype.voteCount = 0; + + /** + * Creates a new VersionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry instance + */ + VersionEntry.create = function create(properties) { + return new VersionEntry(properties); + }; + + /** + * Encodes the specified VersionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.versionNumber); + if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); + return writer; + }; + + /** + * Encodes the specified VersionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.IVersionEntry} message VersionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versionNumber = reader.uint32(); + break; + case 2: + message.voteCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + if (!$util.isInteger(message.versionNumber)) + return "versionNumber: integer expected"; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + if (!$util.isInteger(message.voteCount)) + return "voteCount: integer expected"; + return null; + }; + + /** + * Creates a VersionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} VersionEntry + */ + VersionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry(); + if (object.versionNumber != null) + message.versionNumber = object.versionNumber >>> 0; + if (object.voteCount != null) + message.voteCount = object.voteCount >>> 0; + return message; + }; + + /** + * Creates a plain object from a VersionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry} message VersionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.versionNumber = 0; + object.voteCount = 0; + } + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + object.versionNumber = message.versionNumber; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + object.voteCount = message.voteCount; + return object; + }; + + /** + * Converts this VersionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeStateResponse.GetProtocolVersionUpgradeStateResponseV0.VersionEntry + * @instance + * @returns {Object.} JSON object + */ + VersionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionEntry; + })(); + + return GetProtocolVersionUpgradeStateResponseV0; + })(); + + return GetProtocolVersionUpgradeStateResponse; + })(); + + v0.GetProtocolVersionUpgradeVoteStatusRequest = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeVoteStatusRequest + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null} [v0] GetProtocolVersionUpgradeVoteStatusRequest v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequest. + * @implements IGetProtocolVersionUpgradeVoteStatusRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusRequest v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest instance + */ + GetProtocolVersionUpgradeVoteStatusRequest.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusRequest(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} GetProtocolVersionUpgradeVoteStatusRequest + */ + GetProtocolVersionUpgradeVoteStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest} message GetProtocolVersionUpgradeVoteStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @interface IGetProtocolVersionUpgradeVoteStatusRequestV0 + * @property {Uint8Array|null} [startProTxHash] GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash + * @property {number|null} [count] GetProtocolVersionUpgradeVoteStatusRequestV0 count + * @property {boolean|null} [prove] GetProtocolVersionUpgradeVoteStatusRequestV0 prove + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusRequestV0. + * @implements IGetProtocolVersionUpgradeVoteStatusRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 startProTxHash. + * @member {Uint8Array} startProTxHash + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.startProTxHash = $util.newBuffer([]); + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.count = 0; + + /** + * GetProtocolVersionUpgradeVoteStatusRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.prove = false; + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 instance + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusRequestV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startProTxHash != null && Object.hasOwnProperty.call(message, "startProTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startProTxHash); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.IGetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startProTxHash = reader.bytes(); + break; + case 2: + message.count = reader.uint32(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) + if (!(message.startProTxHash && typeof message.startProTxHash.length === "number" || $util.isString(message.startProTxHash))) + return "startProTxHash: buffer expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} GetProtocolVersionUpgradeVoteStatusRequestV0 + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0(); + if (object.startProTxHash != null) + if (typeof object.startProTxHash === "string") + $util.base64.decode(object.startProTxHash, message.startProTxHash = $util.newBuffer($util.base64.length(object.startProTxHash)), 0); + else if (object.startProTxHash.length >= 0) + message.startProTxHash = object.startProTxHash; + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0} message GetProtocolVersionUpgradeVoteStatusRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startProTxHash = ""; + else { + object.startProTxHash = []; + if (options.bytes !== Array) + object.startProTxHash = $util.newBuffer(object.startProTxHash); + } + object.count = 0; + object.prove = false; + } + if (message.startProTxHash != null && message.hasOwnProperty("startProTxHash")) + object.startProTxHash = options.bytes === String ? $util.base64.encode(message.startProTxHash, 0, message.startProTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.startProTxHash) : message.startProTxHash; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusRequest.GetProtocolVersionUpgradeVoteStatusRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProtocolVersionUpgradeVoteStatusRequestV0; + })(); + + return GetProtocolVersionUpgradeVoteStatusRequest; + })(); + + v0.GetProtocolVersionUpgradeVoteStatusResponse = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetProtocolVersionUpgradeVoteStatusResponse + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null} [v0] GetProtocolVersionUpgradeVoteStatusResponse v0 + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponse. + * @implements IGetProtocolVersionUpgradeVoteStatusResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusResponse v0. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse instance + */ + GetProtocolVersionUpgradeVoteStatusResponse.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusResponse(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} GetProtocolVersionUpgradeVoteStatusResponse + */ + GetProtocolVersionUpgradeVoteStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse} message GetProtocolVersionUpgradeVoteStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 = (function() { + + /** + * Properties of a GetProtocolVersionUpgradeVoteStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @interface IGetProtocolVersionUpgradeVoteStatusResponseV0 + * @property {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null} [versions] GetProtocolVersionUpgradeVoteStatusResponseV0 versions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetProtocolVersionUpgradeVoteStatusResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetProtocolVersionUpgradeVoteStatusResponseV0 metadata + */ + + /** + * Constructs a new GetProtocolVersionUpgradeVoteStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse + * @classdesc Represents a GetProtocolVersionUpgradeVoteStatusResponseV0. + * @implements IGetProtocolVersionUpgradeVoteStatusResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set + */ + function GetProtocolVersionUpgradeVoteStatusResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 versions. + * @member {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals|null|undefined} versions + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.versions = null; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.proof = null; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetProtocolVersionUpgradeVoteStatusResponseV0 result. + * @member {"versions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + */ + Object.defineProperty(GetProtocolVersionUpgradeVoteStatusResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["versions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetProtocolVersionUpgradeVoteStatusResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 instance + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.create = function create(properties) { + return new GetProtocolVersionUpgradeVoteStatusResponseV0(properties); + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && Object.hasOwnProperty.call(message, "versions")) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.encode(message.versions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetProtocolVersionUpgradeVoteStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.IGetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProtocolVersionUpgradeVoteStatusResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProtocolVersionUpgradeVoteStatusResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.versions != null && message.hasOwnProperty("versions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify(message.versions); + if (error) + return "versions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetProtocolVersionUpgradeVoteStatusResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} GetProtocolVersionUpgradeVoteStatusResponseV0 + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0(); + if (object.versions != null) { + if (typeof object.versions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.versions: object expected"); + message.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.fromObject(object.versions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetProtocolVersionUpgradeVoteStatusResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0} message GetProtocolVersionUpgradeVoteStatusResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.versions != null && message.hasOwnProperty("versions")) { + object.versions = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.toObject(message.versions, options); + if (options.oneofs) + object.result = "versions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetProtocolVersionUpgradeVoteStatusResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetProtocolVersionUpgradeVoteStatusResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals = (function() { + + /** + * Properties of a VersionSignals. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @interface IVersionSignals + * @property {Array.|null} [versionSignals] VersionSignals versionSignals + */ + + /** + * Constructs a new VersionSignals. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @classdesc Represents a VersionSignals. + * @implements IVersionSignals + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set + */ + function VersionSignals(properties) { + this.versionSignals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionSignals versionSignals. + * @member {Array.} versionSignals + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @instance + */ + VersionSignals.prototype.versionSignals = $util.emptyArray; + + /** + * Creates a new VersionSignals instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals instance + */ + VersionSignals.create = function create(properties) { + return new VersionSignals(properties); + }; + + /** + * Encodes the specified VersionSignals message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignals.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionSignals != null && message.versionSignals.length) + for (var i = 0; i < message.versionSignals.length; ++i) + $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.encode(message.versionSignals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VersionSignals message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignals} message VersionSignals message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignals.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionSignals message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignals.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.versionSignals && message.versionSignals.length)) + message.versionSignals = []; + message.versionSignals.push($root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionSignals message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignals.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionSignals message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionSignals.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionSignals != null && message.hasOwnProperty("versionSignals")) { + if (!Array.isArray(message.versionSignals)) + return "versionSignals: array expected"; + for (var i = 0; i < message.versionSignals.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify(message.versionSignals[i]); + if (error) + return "versionSignals." + error; + } + } + return null; + }; + + /** + * Creates a VersionSignals message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} VersionSignals + */ + VersionSignals.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals(); + if (object.versionSignals) { + if (!Array.isArray(object.versionSignals)) + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: array expected"); + message.versionSignals = []; + for (var i = 0; i < object.versionSignals.length; ++i) { + if (typeof object.versionSignals[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals.versionSignals: object expected"); + message.versionSignals[i] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.fromObject(object.versionSignals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VersionSignals message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals} message VersionSignals + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionSignals.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionSignals = []; + if (message.versionSignals && message.versionSignals.length) { + object.versionSignals = []; + for (var j = 0; j < message.versionSignals.length; ++j) + object.versionSignals[j] = $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.toObject(message.versionSignals[j], options); + } + return object; + }; + + /** + * Converts this VersionSignals to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignals + * @instance + * @returns {Object.} JSON object + */ + VersionSignals.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionSignals; + })(); + + GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal = (function() { + + /** + * Properties of a VersionSignal. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @interface IVersionSignal + * @property {Uint8Array|null} [proTxHash] VersionSignal proTxHash + * @property {number|null} [version] VersionSignal version + */ + + /** + * Constructs a new VersionSignal. + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0 + * @classdesc Represents a VersionSignal. + * @implements IVersionSignal + * @constructor + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set + */ + function VersionSignal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionSignal proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + */ + VersionSignal.prototype.proTxHash = $util.newBuffer([]); + + /** + * VersionSignal version. + * @member {number} version + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + */ + VersionSignal.prototype.version = 0; + + /** + * Creates a new VersionSignal instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal instance + */ + VersionSignal.create = function create(properties) { + return new VersionSignal(properties); + }; + + /** + * Encodes the specified VersionSignal message. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.version); + return writer; + }; + + /** + * Encodes the specified VersionSignal message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.IVersionSignal} message VersionSignal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionSignal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionSignal message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.version = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionSignal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionSignal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionSignal message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionSignal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + return null; + }; + + /** + * Creates a VersionSignal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} VersionSignal + */ + VersionSignal.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.version != null) + message.version = object.version >>> 0; + return message; + }; + + /** + * Creates a plain object from a VersionSignal message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @static + * @param {org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal} message VersionSignal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionSignal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + object.version = 0; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this VersionSignal to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetProtocolVersionUpgradeVoteStatusResponse.GetProtocolVersionUpgradeVoteStatusResponseV0.VersionSignal + * @instance + * @returns {Object.} JSON object + */ + VersionSignal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VersionSignal; + })(); + + return GetProtocolVersionUpgradeVoteStatusResponseV0; + })(); + + return GetProtocolVersionUpgradeVoteStatusResponse; + })(); + + v0.GetEpochsInfoRequest = (function() { + + /** + * Properties of a GetEpochsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEpochsInfoRequest + * @property {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null} [v0] GetEpochsInfoRequest v0 + */ + + /** + * Constructs a new GetEpochsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEpochsInfoRequest. + * @implements IGetEpochsInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set + */ + function GetEpochsInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEpochsInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + */ + GetEpochsInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + */ + Object.defineProperty(GetEpochsInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest instance + */ + GetEpochsInfoRequest.create = function create(properties) { + return new GetEpochsInfoRequest(properties); + }; + + /** + * Encodes the specified GetEpochsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoRequest} message GetEpochsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEpochsInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest} GetEpochsInfoRequest + */ + GetEpochsInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest} message GetEpochsInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEpochsInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoRequest.GetEpochsInfoRequestV0 = (function() { + + /** + * Properties of a GetEpochsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @interface IGetEpochsInfoRequestV0 + * @property {google.protobuf.IUInt32Value|null} [startEpoch] GetEpochsInfoRequestV0 startEpoch + * @property {number|null} [count] GetEpochsInfoRequestV0 count + * @property {boolean|null} [ascending] GetEpochsInfoRequestV0 ascending + * @property {boolean|null} [prove] GetEpochsInfoRequestV0 prove + */ + + /** + * Constructs a new GetEpochsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest + * @classdesc Represents a GetEpochsInfoRequestV0. + * @implements IGetEpochsInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set + */ + function GetEpochsInfoRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEpochsInfoRequestV0 startEpoch. + * @member {google.protobuf.IUInt32Value|null|undefined} startEpoch + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.startEpoch = null; + + /** + * GetEpochsInfoRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.count = 0; + + /** + * GetEpochsInfoRequestV0 ascending. + * @member {boolean} ascending + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.ascending = false; + + /** + * GetEpochsInfoRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + */ + GetEpochsInfoRequestV0.prototype.prove = false; + + /** + * Creates a new GetEpochsInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 instance + */ + GetEpochsInfoRequestV0.create = function create(properties) { + return new GetEpochsInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetEpochsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startEpoch != null && Object.hasOwnProperty.call(message, "startEpoch")) + $root.google.protobuf.UInt32Value.encode(message.startEpoch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.count); + if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ascending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.IGetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startEpoch = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 2: + message.count = reader.uint32(); + break; + case 3: + message.ascending = reader.bool(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) { + var error = $root.google.protobuf.UInt32Value.verify(message.startEpoch); + if (error) + return "startEpoch." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.ascending != null && message.hasOwnProperty("ascending")) + if (typeof message.ascending !== "boolean") + return "ascending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetEpochsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} GetEpochsInfoRequestV0 + */ + GetEpochsInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0(); + if (object.startEpoch != null) { + if (typeof object.startEpoch !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0.startEpoch: object expected"); + message.startEpoch = $root.google.protobuf.UInt32Value.fromObject(object.startEpoch); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.ascending != null) + message.ascending = Boolean(object.ascending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0} message GetEpochsInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startEpoch = null; + object.count = 0; + object.ascending = false; + object.prove = false; + } + if (message.startEpoch != null && message.hasOwnProperty("startEpoch")) + object.startEpoch = $root.google.protobuf.UInt32Value.toObject(message.startEpoch, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.ascending != null && message.hasOwnProperty("ascending")) + object.ascending = message.ascending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetEpochsInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEpochsInfoRequestV0; + })(); + + return GetEpochsInfoRequest; + })(); + + v0.GetEpochsInfoResponse = (function() { + + /** + * Properties of a GetEpochsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetEpochsInfoResponse + * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null} [v0] GetEpochsInfoResponse v0 + */ + + /** + * Constructs a new GetEpochsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetEpochsInfoResponse. + * @implements IGetEpochsInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set + */ + function GetEpochsInfoResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEpochsInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + */ + GetEpochsInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + */ + Object.defineProperty(GetEpochsInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse instance + */ + GetEpochsInfoResponse.create = function create(properties) { + return new GetEpochsInfoResponse(properties); + }; + + /** + * Encodes the specified GetEpochsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetEpochsInfoResponse} message GetEpochsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetEpochsInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse} GetEpochsInfoResponse + */ + GetEpochsInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse} message GetEpochsInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetEpochsInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoResponse.GetEpochsInfoResponseV0 = (function() { + + /** + * Properties of a GetEpochsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @interface IGetEpochsInfoResponseV0 + * @property {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null} [epochs] GetEpochsInfoResponseV0 epochs + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetEpochsInfoResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetEpochsInfoResponseV0 metadata + */ + + /** + * Constructs a new GetEpochsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse + * @classdesc Represents a GetEpochsInfoResponseV0. + * @implements IGetEpochsInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set + */ + function GetEpochsInfoResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEpochsInfoResponseV0 epochs. + * @member {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos|null|undefined} epochs + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.epochs = null; + + /** + * GetEpochsInfoResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.proof = null; + + /** + * GetEpochsInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + GetEpochsInfoResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetEpochsInfoResponseV0 result. + * @member {"epochs"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + */ + Object.defineProperty(GetEpochsInfoResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["epochs", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetEpochsInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 instance + */ + GetEpochsInfoResponseV0.create = function create(properties) { + return new GetEpochsInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetEpochsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochs != null && Object.hasOwnProperty.call(message, "epochs")) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.encode(message.epochs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetEpochsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.IGetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEpochsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEpochsInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEpochsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEpochsInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEpochsInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.epochs != null && message.hasOwnProperty("epochs")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify(message.epochs); + if (error) + return "epochs." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetEpochsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} GetEpochsInfoResponseV0 + */ + GetEpochsInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0(); + if (object.epochs != null) { + if (typeof object.epochs !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.epochs: object expected"); + message.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.fromObject(object.epochs); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetEpochsInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0} message GetEpochsInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEpochsInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.epochs != null && message.hasOwnProperty("epochs")) { + object.epochs = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.toObject(message.epochs, options); + if (options.oneofs) + object.result = "epochs"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetEpochsInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetEpochsInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetEpochsInfoResponseV0.EpochInfos = (function() { + + /** + * Properties of an EpochInfos. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @interface IEpochInfos + * @property {Array.|null} [epochInfos] EpochInfos epochInfos + */ + + /** + * Constructs a new EpochInfos. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @classdesc Represents an EpochInfos. + * @implements IEpochInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set + */ + function EpochInfos(properties) { + this.epochInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EpochInfos epochInfos. + * @member {Array.} epochInfos + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @instance + */ + EpochInfos.prototype.epochInfos = $util.emptyArray; + + /** + * Creates a new EpochInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos instance + */ + EpochInfos.create = function create(properties) { + return new EpochInfos(properties); + }; + + /** + * Encodes the specified EpochInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochInfos != null && message.epochInfos.length) + for (var i = 0; i < message.epochInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.encode(message.epochInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EpochInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfos} message EpochInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EpochInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfos.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.epochInfos && message.epochInfos.length)) + message.epochInfos = []; + message.epochInfos.push($root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EpochInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EpochInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EpochInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.epochInfos != null && message.hasOwnProperty("epochInfos")) { + if (!Array.isArray(message.epochInfos)) + return "epochInfos: array expected"; + for (var i = 0; i < message.epochInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify(message.epochInfos[i]); + if (error) + return "epochInfos." + error; + } + } + return null; + }; + + /** + * Creates an EpochInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} EpochInfos + */ + EpochInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos(); + if (object.epochInfos) { + if (!Array.isArray(object.epochInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: array expected"); + message.epochInfos = []; + for (var i = 0; i < object.epochInfos.length; ++i) { + if (typeof object.epochInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos.epochInfos: object expected"); + message.epochInfos[i] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.fromObject(object.epochInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EpochInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos} message EpochInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EpochInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.epochInfos = []; + if (message.epochInfos && message.epochInfos.length) { + object.epochInfos = []; + for (var j = 0; j < message.epochInfos.length; ++j) + object.epochInfos[j] = $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.toObject(message.epochInfos[j], options); + } + return object; + }; + + /** + * Converts this EpochInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos + * @instance + * @returns {Object.} JSON object + */ + EpochInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EpochInfos; + })(); + + GetEpochsInfoResponseV0.EpochInfo = (function() { + + /** + * Properties of an EpochInfo. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @interface IEpochInfo + * @property {number|null} [number] EpochInfo number + * @property {number|Long|null} [firstBlockHeight] EpochInfo firstBlockHeight + * @property {number|null} [firstCoreBlockHeight] EpochInfo firstCoreBlockHeight + * @property {number|Long|null} [startTime] EpochInfo startTime + * @property {number|null} [feeMultiplier] EpochInfo feeMultiplier + * @property {number|null} [protocolVersion] EpochInfo protocolVersion + */ + + /** + * Constructs a new EpochInfo. + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0 + * @classdesc Represents an EpochInfo. + * @implements IEpochInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set + */ + function EpochInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EpochInfo number. + * @member {number} number + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.number = 0; + + /** + * EpochInfo firstBlockHeight. + * @member {number|Long} firstBlockHeight + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.firstBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EpochInfo firstCoreBlockHeight. + * @member {number} firstCoreBlockHeight + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.firstCoreBlockHeight = 0; + + /** + * EpochInfo startTime. + * @member {number|Long} startTime + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EpochInfo feeMultiplier. + * @member {number} feeMultiplier + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.feeMultiplier = 0; + + /** + * EpochInfo protocolVersion. + * @member {number} protocolVersion + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + */ + EpochInfo.prototype.protocolVersion = 0; + + /** + * Creates a new EpochInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo instance + */ + EpochInfo.create = function create(properties) { + return new EpochInfo(properties); + }; + + /** + * Encodes the specified EpochInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.number); + if (message.firstBlockHeight != null && Object.hasOwnProperty.call(message, "firstBlockHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.firstBlockHeight); + if (message.firstCoreBlockHeight != null && Object.hasOwnProperty.call(message, "firstCoreBlockHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.firstCoreBlockHeight); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.startTime); + if (message.feeMultiplier != null && Object.hasOwnProperty.call(message, "feeMultiplier")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.feeMultiplier); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.protocolVersion); + return writer; + }; + + /** + * Encodes the specified EpochInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.IEpochInfo} message EpochInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EpochInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EpochInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.number = reader.uint32(); + break; + case 2: + message.firstBlockHeight = reader.uint64(); + break; + case 3: + message.firstCoreBlockHeight = reader.uint32(); + break; + case 4: + message.startTime = reader.uint64(); + break; + case 5: + message.feeMultiplier = reader.double(); + break; + case 6: + message.protocolVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EpochInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EpochInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EpochInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EpochInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) + if (!$util.isInteger(message.firstBlockHeight) && !(message.firstBlockHeight && $util.isInteger(message.firstBlockHeight.low) && $util.isInteger(message.firstBlockHeight.high))) + return "firstBlockHeight: integer|Long expected"; + if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) + if (!$util.isInteger(message.firstCoreBlockHeight)) + return "firstCoreBlockHeight: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) + if (typeof message.feeMultiplier !== "number") + return "feeMultiplier: number expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + if (!$util.isInteger(message.protocolVersion)) + return "protocolVersion: integer expected"; + return null; + }; + + /** + * Creates an EpochInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} EpochInfo + */ + EpochInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo(); + if (object.number != null) + message.number = object.number >>> 0; + if (object.firstBlockHeight != null) + if ($util.Long) + (message.firstBlockHeight = $util.Long.fromValue(object.firstBlockHeight)).unsigned = true; + else if (typeof object.firstBlockHeight === "string") + message.firstBlockHeight = parseInt(object.firstBlockHeight, 10); + else if (typeof object.firstBlockHeight === "number") + message.firstBlockHeight = object.firstBlockHeight; + else if (typeof object.firstBlockHeight === "object") + message.firstBlockHeight = new $util.LongBits(object.firstBlockHeight.low >>> 0, object.firstBlockHeight.high >>> 0).toNumber(true); + if (object.firstCoreBlockHeight != null) + message.firstCoreBlockHeight = object.firstCoreBlockHeight >>> 0; + if (object.startTime != null) + if ($util.Long) + (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = true; + else if (typeof object.startTime === "string") + message.startTime = parseInt(object.startTime, 10); + else if (typeof object.startTime === "number") + message.startTime = object.startTime; + else if (typeof object.startTime === "object") + message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(true); + if (object.feeMultiplier != null) + message.feeMultiplier = Number(object.feeMultiplier); + if (object.protocolVersion != null) + message.protocolVersion = object.protocolVersion >>> 0; + return message; + }; + + /** + * Creates a plain object from an EpochInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @static + * @param {org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo} message EpochInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EpochInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.firstBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.firstBlockHeight = options.longs === String ? "0" : 0; + object.firstCoreBlockHeight = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTime = options.longs === String ? "0" : 0; + object.feeMultiplier = 0; + object.protocolVersion = 0; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.firstBlockHeight != null && message.hasOwnProperty("firstBlockHeight")) + if (typeof message.firstBlockHeight === "number") + object.firstBlockHeight = options.longs === String ? String(message.firstBlockHeight) : message.firstBlockHeight; + else + object.firstBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.firstBlockHeight) : options.longs === Number ? new $util.LongBits(message.firstBlockHeight.low >>> 0, message.firstBlockHeight.high >>> 0).toNumber(true) : message.firstBlockHeight; + if (message.firstCoreBlockHeight != null && message.hasOwnProperty("firstCoreBlockHeight")) + object.firstCoreBlockHeight = message.firstCoreBlockHeight; + if (message.startTime != null && message.hasOwnProperty("startTime")) + if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber(true) : message.startTime; + if (message.feeMultiplier != null && message.hasOwnProperty("feeMultiplier")) + object.feeMultiplier = options.json && !isFinite(message.feeMultiplier) ? String(message.feeMultiplier) : message.feeMultiplier; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = message.protocolVersion; + return object; + }; + + /** + * Converts this EpochInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo + * @instance + * @returns {Object.} JSON object + */ + EpochInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EpochInfo; + })(); + + return GetEpochsInfoResponseV0; + })(); + + return GetEpochsInfoResponse; + })(); + + v0.GetContestedResourcesRequest = (function() { + + /** + * Properties of a GetContestedResourcesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourcesRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null} [v0] GetContestedResourcesRequest v0 + */ + + /** + * Constructs a new GetContestedResourcesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourcesRequest. + * @implements IGetContestedResourcesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set + */ + function GetContestedResourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourcesRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + */ + GetContestedResourcesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + */ + Object.defineProperty(GetContestedResourcesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest instance + */ + GetContestedResourcesRequest.create = function create(properties) { + return new GetContestedResourcesRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourcesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesRequest} message GetContestedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest} GetContestedResourcesRequest + */ + GetContestedResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest} message GetContestedResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourcesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesRequest.GetContestedResourcesRequestV0 = (function() { + + /** + * Properties of a GetContestedResourcesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @interface IGetContestedResourcesRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourcesRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourcesRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourcesRequestV0 indexName + * @property {Array.|null} [startIndexValues] GetContestedResourcesRequestV0 startIndexValues + * @property {Array.|null} [endIndexValues] GetContestedResourcesRequestV0 endIndexValues + * @property {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null} [startAtValueInfo] GetContestedResourcesRequestV0 startAtValueInfo + * @property {number|null} [count] GetContestedResourcesRequestV0 count + * @property {boolean|null} [orderAscending] GetContestedResourcesRequestV0 orderAscending + * @property {boolean|null} [prove] GetContestedResourcesRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourcesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest + * @classdesc Represents a GetContestedResourcesRequestV0. + * @implements IGetContestedResourcesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set + */ + function GetContestedResourcesRequestV0(properties) { + this.startIndexValues = []; + this.endIndexValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourcesRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourcesRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourcesRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourcesRequestV0 startIndexValues. + * @member {Array.} startIndexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.startIndexValues = $util.emptyArray; + + /** + * GetContestedResourcesRequestV0 endIndexValues. + * @member {Array.} endIndexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.endIndexValues = $util.emptyArray; + + /** + * GetContestedResourcesRequestV0 startAtValueInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo|null|undefined} startAtValueInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.startAtValueInfo = null; + + /** + * GetContestedResourcesRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.count = 0; + + /** + * GetContestedResourcesRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourcesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + */ + GetContestedResourcesRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourcesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 instance + */ + GetContestedResourcesRequestV0.create = function create(properties) { + return new GetContestedResourcesRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourcesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.startIndexValues != null && message.startIndexValues.length) + for (var i = 0; i < message.startIndexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.startIndexValues[i]); + if (message.endIndexValues != null && message.endIndexValues.length) + for (var i = 0; i < message.endIndexValues.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.endIndexValues[i]); + if (message.startAtValueInfo != null && Object.hasOwnProperty.call(message, "startAtValueInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.encode(message.startAtValueInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.IGetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.startIndexValues && message.startIndexValues.length)) + message.startIndexValues = []; + message.startIndexValues.push(reader.bytes()); + break; + case 5: + if (!(message.endIndexValues && message.endIndexValues.length)) + message.endIndexValues = []; + message.endIndexValues.push(reader.bytes()); + break; + case 6: + message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.decode(reader, reader.uint32()); + break; + case 7: + message.count = reader.uint32(); + break; + case 8: + message.orderAscending = reader.bool(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.startIndexValues != null && message.hasOwnProperty("startIndexValues")) { + if (!Array.isArray(message.startIndexValues)) + return "startIndexValues: array expected"; + for (var i = 0; i < message.startIndexValues.length; ++i) + if (!(message.startIndexValues[i] && typeof message.startIndexValues[i].length === "number" || $util.isString(message.startIndexValues[i]))) + return "startIndexValues: buffer[] expected"; + } + if (message.endIndexValues != null && message.hasOwnProperty("endIndexValues")) { + if (!Array.isArray(message.endIndexValues)) + return "endIndexValues: array expected"; + for (var i = 0; i < message.endIndexValues.length; ++i) + if (!(message.endIndexValues[i] && typeof message.endIndexValues[i].length === "number" || $util.isString(message.endIndexValues[i]))) + return "endIndexValues: buffer[] expected"; + } + if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify(message.startAtValueInfo); + if (error) + return "startAtValueInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourcesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} GetContestedResourcesRequestV0 + */ + GetContestedResourcesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.startIndexValues) { + if (!Array.isArray(object.startIndexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startIndexValues: array expected"); + message.startIndexValues = []; + for (var i = 0; i < object.startIndexValues.length; ++i) + if (typeof object.startIndexValues[i] === "string") + $util.base64.decode(object.startIndexValues[i], message.startIndexValues[i] = $util.newBuffer($util.base64.length(object.startIndexValues[i])), 0); + else if (object.startIndexValues[i].length >= 0) + message.startIndexValues[i] = object.startIndexValues[i]; + } + if (object.endIndexValues) { + if (!Array.isArray(object.endIndexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.endIndexValues: array expected"); + message.endIndexValues = []; + for (var i = 0; i < object.endIndexValues.length; ++i) + if (typeof object.endIndexValues[i] === "string") + $util.base64.decode(object.endIndexValues[i], message.endIndexValues[i] = $util.newBuffer($util.base64.length(object.endIndexValues[i])), 0); + else if (object.endIndexValues[i].length >= 0) + message.endIndexValues[i] = object.endIndexValues[i]; + } + if (object.startAtValueInfo != null) { + if (typeof object.startAtValueInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.startAtValueInfo: object expected"); + message.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.fromObject(object.startAtValueInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0} message GetContestedResourcesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startIndexValues = []; + object.endIndexValues = []; + } + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + object.startAtValueInfo = null; + object.count = 0; + object.orderAscending = false; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.startIndexValues && message.startIndexValues.length) { + object.startIndexValues = []; + for (var j = 0; j < message.startIndexValues.length; ++j) + object.startIndexValues[j] = options.bytes === String ? $util.base64.encode(message.startIndexValues[j], 0, message.startIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.startIndexValues[j]) : message.startIndexValues[j]; + } + if (message.endIndexValues && message.endIndexValues.length) { + object.endIndexValues = []; + for (var j = 0; j < message.endIndexValues.length; ++j) + object.endIndexValues[j] = options.bytes === String ? $util.base64.encode(message.endIndexValues[j], 0, message.endIndexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.endIndexValues[j]) : message.endIndexValues[j]; + } + if (message.startAtValueInfo != null && message.hasOwnProperty("startAtValueInfo")) + object.startAtValueInfo = $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.toObject(message.startAtValueInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourcesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesRequestV0.StartAtValueInfo = (function() { + + /** + * Properties of a StartAtValueInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @interface IStartAtValueInfo + * @property {Uint8Array|null} [startValue] StartAtValueInfo startValue + * @property {boolean|null} [startValueIncluded] StartAtValueInfo startValueIncluded + */ + + /** + * Constructs a new StartAtValueInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0 + * @classdesc Represents a StartAtValueInfo. + * @implements IStartAtValueInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set + */ + function StartAtValueInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtValueInfo startValue. + * @member {Uint8Array} startValue + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + */ + StartAtValueInfo.prototype.startValue = $util.newBuffer([]); + + /** + * StartAtValueInfo startValueIncluded. + * @member {boolean} startValueIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + */ + StartAtValueInfo.prototype.startValueIncluded = false; + + /** + * Creates a new StartAtValueInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo instance + */ + StartAtValueInfo.create = function create(properties) { + return new StartAtValueInfo(properties); + }; + + /** + * Encodes the specified StartAtValueInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtValueInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startValue != null && Object.hasOwnProperty.call(message, "startValue")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startValue); + if (message.startValueIncluded != null && Object.hasOwnProperty.call(message, "startValueIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startValueIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtValueInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.IStartAtValueInfo} message StartAtValueInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtValueInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtValueInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtValueInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startValue = reader.bytes(); + break; + case 2: + message.startValueIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtValueInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtValueInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtValueInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtValueInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startValue != null && message.hasOwnProperty("startValue")) + if (!(message.startValue && typeof message.startValue.length === "number" || $util.isString(message.startValue))) + return "startValue: buffer expected"; + if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) + if (typeof message.startValueIncluded !== "boolean") + return "startValueIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtValueInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} StartAtValueInfo + */ + StartAtValueInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo(); + if (object.startValue != null) + if (typeof object.startValue === "string") + $util.base64.decode(object.startValue, message.startValue = $util.newBuffer($util.base64.length(object.startValue)), 0); + else if (object.startValue.length >= 0) + message.startValue = object.startValue; + if (object.startValueIncluded != null) + message.startValueIncluded = Boolean(object.startValueIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtValueInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo} message StartAtValueInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtValueInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startValue = ""; + else { + object.startValue = []; + if (options.bytes !== Array) + object.startValue = $util.newBuffer(object.startValue); + } + object.startValueIncluded = false; + } + if (message.startValue != null && message.hasOwnProperty("startValue")) + object.startValue = options.bytes === String ? $util.base64.encode(message.startValue, 0, message.startValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValue) : message.startValue; + if (message.startValueIncluded != null && message.hasOwnProperty("startValueIncluded")) + object.startValueIncluded = message.startValueIncluded; + return object; + }; + + /** + * Converts this StartAtValueInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtValueInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtValueInfo; + })(); + + return GetContestedResourcesRequestV0; + })(); + + return GetContestedResourcesRequest; + })(); + + v0.GetContestedResourcesResponse = (function() { + + /** + * Properties of a GetContestedResourcesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourcesResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null} [v0] GetContestedResourcesResponse v0 + */ + + /** + * Constructs a new GetContestedResourcesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourcesResponse. + * @implements IGetContestedResourcesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set + */ + function GetContestedResourcesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourcesResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + */ + GetContestedResourcesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + */ + Object.defineProperty(GetContestedResourcesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse instance + */ + GetContestedResourcesResponse.create = function create(properties) { + return new GetContestedResourcesResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourcesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourcesResponse} message GetContestedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse} GetContestedResourcesResponse + */ + GetContestedResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse} message GetContestedResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourcesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesResponse.GetContestedResourcesResponseV0 = (function() { + + /** + * Properties of a GetContestedResourcesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @interface IGetContestedResourcesResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null} [contestedResourceValues] GetContestedResourcesResponseV0 contestedResourceValues + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourcesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourcesResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourcesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse + * @classdesc Represents a GetContestedResourcesResponseV0. + * @implements IGetContestedResourcesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set + */ + function GetContestedResourcesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourcesResponseV0 contestedResourceValues. + * @member {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues|null|undefined} contestedResourceValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.contestedResourceValues = null; + + /** + * GetContestedResourcesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.proof = null; + + /** + * GetContestedResourcesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + GetContestedResourcesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourcesResponseV0 result. + * @member {"contestedResourceValues"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourcesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceValues", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourcesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 instance + */ + GetContestedResourcesResponseV0.create = function create(properties) { + return new GetContestedResourcesResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourcesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceValues != null && Object.hasOwnProperty.call(message, "contestedResourceValues")) + $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.encode(message.contestedResourceValues, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourcesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.IGetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourcesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourcesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourcesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourcesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourcesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify(message.contestedResourceValues); + if (error) + return "contestedResourceValues." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourcesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} GetContestedResourcesResponseV0 + */ + GetContestedResourcesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0(); + if (object.contestedResourceValues != null) { + if (typeof object.contestedResourceValues !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.contestedResourceValues: object expected"); + message.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.fromObject(object.contestedResourceValues); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourcesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0} message GetContestedResourcesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourcesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + object.contestedResourceValues = $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.toObject(message.contestedResourceValues, options); + if (options.oneofs) + object.result = "contestedResourceValues"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourcesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourcesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourcesResponseV0.ContestedResourceValues = (function() { + + /** + * Properties of a ContestedResourceValues. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @interface IContestedResourceValues + * @property {Array.|null} [contestedResourceValues] ContestedResourceValues contestedResourceValues + */ + + /** + * Constructs a new ContestedResourceValues. + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0 + * @classdesc Represents a ContestedResourceValues. + * @implements IContestedResourceValues + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set + */ + function ContestedResourceValues(properties) { + this.contestedResourceValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceValues contestedResourceValues. + * @member {Array.} contestedResourceValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @instance + */ + ContestedResourceValues.prototype.contestedResourceValues = $util.emptyArray; + + /** + * Creates a new ContestedResourceValues instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues instance + */ + ContestedResourceValues.create = function create(properties) { + return new ContestedResourceValues(properties); + }; + + /** + * Encodes the specified ContestedResourceValues message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceValues != null && message.contestedResourceValues.length) + for (var i = 0; i < message.contestedResourceValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contestedResourceValues[i]); + return writer; + }; + + /** + * Encodes the specified ContestedResourceValues message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.IContestedResourceValues} message ContestedResourceValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceValues message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceValues.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contestedResourceValues && message.contestedResourceValues.length)) + message.contestedResourceValues = []; + message.contestedResourceValues.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceValues message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contestedResourceValues != null && message.hasOwnProperty("contestedResourceValues")) { + if (!Array.isArray(message.contestedResourceValues)) + return "contestedResourceValues: array expected"; + for (var i = 0; i < message.contestedResourceValues.length; ++i) + if (!(message.contestedResourceValues[i] && typeof message.contestedResourceValues[i].length === "number" || $util.isString(message.contestedResourceValues[i]))) + return "contestedResourceValues: buffer[] expected"; + } + return null; + }; + + /** + * Creates a ContestedResourceValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} ContestedResourceValues + */ + ContestedResourceValues.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues(); + if (object.contestedResourceValues) { + if (!Array.isArray(object.contestedResourceValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues.contestedResourceValues: array expected"); + message.contestedResourceValues = []; + for (var i = 0; i < object.contestedResourceValues.length; ++i) + if (typeof object.contestedResourceValues[i] === "string") + $util.base64.decode(object.contestedResourceValues[i], message.contestedResourceValues[i] = $util.newBuffer($util.base64.length(object.contestedResourceValues[i])), 0); + else if (object.contestedResourceValues[i].length >= 0) + message.contestedResourceValues[i] = object.contestedResourceValues[i]; + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceValues message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues} message ContestedResourceValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contestedResourceValues = []; + if (message.contestedResourceValues && message.contestedResourceValues.length) { + object.contestedResourceValues = []; + for (var j = 0; j < message.contestedResourceValues.length; ++j) + object.contestedResourceValues[j] = options.bytes === String ? $util.base64.encode(message.contestedResourceValues[j], 0, message.contestedResourceValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.contestedResourceValues[j]) : message.contestedResourceValues[j]; + } + return object; + }; + + /** + * Converts this ContestedResourceValues to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceValues; + })(); + + return GetContestedResourcesResponseV0; + })(); + + return GetContestedResourcesResponse; + })(); + + v0.GetVotePollsByEndDateRequest = (function() { + + /** + * Properties of a GetVotePollsByEndDateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetVotePollsByEndDateRequest + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null} [v0] GetVotePollsByEndDateRequest v0 + */ + + /** + * Constructs a new GetVotePollsByEndDateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetVotePollsByEndDateRequest. + * @implements IGetVotePollsByEndDateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set + */ + function GetVotePollsByEndDateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVotePollsByEndDateRequest v0. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + */ + GetVotePollsByEndDateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest instance + */ + GetVotePollsByEndDateRequest.create = function create(properties) { + return new GetVotePollsByEndDateRequest(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} GetVotePollsByEndDateRequest + */ + GetVotePollsByEndDateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest} message GetVotePollsByEndDateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetVotePollsByEndDateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 = (function() { + + /** + * Properties of a GetVotePollsByEndDateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @interface IGetVotePollsByEndDateRequestV0 + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null} [startTimeInfo] GetVotePollsByEndDateRequestV0 startTimeInfo + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null} [endTimeInfo] GetVotePollsByEndDateRequestV0 endTimeInfo + * @property {number|null} [limit] GetVotePollsByEndDateRequestV0 limit + * @property {number|null} [offset] GetVotePollsByEndDateRequestV0 offset + * @property {boolean|null} [ascending] GetVotePollsByEndDateRequestV0 ascending + * @property {boolean|null} [prove] GetVotePollsByEndDateRequestV0 prove + */ + + /** + * Constructs a new GetVotePollsByEndDateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest + * @classdesc Represents a GetVotePollsByEndDateRequestV0. + * @implements IGetVotePollsByEndDateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set + */ + function GetVotePollsByEndDateRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVotePollsByEndDateRequestV0 startTimeInfo. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo|null|undefined} startTimeInfo + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.startTimeInfo = null; + + /** + * GetVotePollsByEndDateRequestV0 endTimeInfo. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo|null|undefined} endTimeInfo + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.endTimeInfo = null; + + /** + * GetVotePollsByEndDateRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.limit = 0; + + /** + * GetVotePollsByEndDateRequestV0 offset. + * @member {number} offset + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.offset = 0; + + /** + * GetVotePollsByEndDateRequestV0 ascending. + * @member {boolean} ascending + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.ascending = false; + + /** + * GetVotePollsByEndDateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + */ + GetVotePollsByEndDateRequestV0.prototype.prove = false; + + /** + * Creates a new GetVotePollsByEndDateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 instance + */ + GetVotePollsByEndDateRequestV0.create = function create(properties) { + return new GetVotePollsByEndDateRequestV0(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeInfo != null && Object.hasOwnProperty.call(message, "startTimeInfo")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.encode(message.startTimeInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTimeInfo != null && Object.hasOwnProperty.call(message, "endTimeInfo")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.encode(message.endTimeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.offset); + if (message.ascending != null && Object.hasOwnProperty.call(message, "ascending")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ascending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.IGetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.decode(reader, reader.uint32()); + break; + case 2: + message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.limit = reader.uint32(); + break; + case 4: + message.offset = reader.uint32(); + break; + case 5: + message.ascending = reader.bool(); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify(message.startTimeInfo); + if (error) + return "startTimeInfo." + error; + } + if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify(message.endTimeInfo); + if (error) + return "endTimeInfo." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.ascending != null && message.hasOwnProperty("ascending")) + if (typeof message.ascending !== "boolean") + return "ascending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetVotePollsByEndDateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} GetVotePollsByEndDateRequestV0 + */ + GetVotePollsByEndDateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0(); + if (object.startTimeInfo != null) { + if (typeof object.startTimeInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.startTimeInfo: object expected"); + message.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.fromObject(object.startTimeInfo); + } + if (object.endTimeInfo != null) { + if (typeof object.endTimeInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.endTimeInfo: object expected"); + message.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.fromObject(object.endTimeInfo); + } + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.offset != null) + message.offset = object.offset >>> 0; + if (object.ascending != null) + message.ascending = Boolean(object.ascending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0} message GetVotePollsByEndDateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeInfo = null; + object.endTimeInfo = null; + object.limit = 0; + object.offset = 0; + object.ascending = false; + object.prove = false; + } + if (message.startTimeInfo != null && message.hasOwnProperty("startTimeInfo")) + object.startTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.toObject(message.startTimeInfo, options); + if (message.endTimeInfo != null && message.hasOwnProperty("endTimeInfo")) + object.endTimeInfo = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.toObject(message.endTimeInfo, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.ascending != null && message.hasOwnProperty("ascending")) + object.ascending = message.ascending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetVotePollsByEndDateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateRequestV0.StartAtTimeInfo = (function() { + + /** + * Properties of a StartAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @interface IStartAtTimeInfo + * @property {number|Long|null} [startTimeMs] StartAtTimeInfo startTimeMs + * @property {boolean|null} [startTimeIncluded] StartAtTimeInfo startTimeIncluded + */ + + /** + * Constructs a new StartAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @classdesc Represents a StartAtTimeInfo. + * @implements IStartAtTimeInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set + */ + function StartAtTimeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtTimeInfo startTimeMs. + * @member {number|Long} startTimeMs + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + */ + StartAtTimeInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StartAtTimeInfo startTimeIncluded. + * @member {boolean} startTimeIncluded + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + */ + StartAtTimeInfo.prototype.startTimeIncluded = false; + + /** + * Creates a new StartAtTimeInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo instance + */ + StartAtTimeInfo.create = function create(properties) { + return new StartAtTimeInfo(properties); + }; + + /** + * Encodes the specified StartAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtTimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); + if (message.startTimeIncluded != null && Object.hasOwnProperty.call(message, "startTimeIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startTimeIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IStartAtTimeInfo} message StartAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtTimeInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtTimeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeMs = reader.uint64(); + break; + case 2: + message.startTimeIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtTimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtTimeInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtTimeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) + return "startTimeMs: integer|Long expected"; + if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) + if (typeof message.startTimeIncluded !== "boolean") + return "startTimeIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtTimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} StartAtTimeInfo + */ + StartAtTimeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo(); + if (object.startTimeMs != null) + if ($util.Long) + (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; + else if (typeof object.startTimeMs === "string") + message.startTimeMs = parseInt(object.startTimeMs, 10); + else if (typeof object.startTimeMs === "number") + message.startTimeMs = object.startTimeMs; + else if (typeof object.startTimeMs === "object") + message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); + if (object.startTimeIncluded != null) + message.startTimeIncluded = Boolean(object.startTimeIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtTimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo} message StartAtTimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtTimeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTimeMs = options.longs === String ? "0" : 0; + object.startTimeIncluded = false; + } + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (typeof message.startTimeMs === "number") + object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; + else + object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; + if (message.startTimeIncluded != null && message.hasOwnProperty("startTimeIncluded")) + object.startTimeIncluded = message.startTimeIncluded; + return object; + }; + + /** + * Converts this StartAtTimeInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.StartAtTimeInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtTimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtTimeInfo; + })(); + + GetVotePollsByEndDateRequestV0.EndAtTimeInfo = (function() { + + /** + * Properties of an EndAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @interface IEndAtTimeInfo + * @property {number|Long|null} [endTimeMs] EndAtTimeInfo endTimeMs + * @property {boolean|null} [endTimeIncluded] EndAtTimeInfo endTimeIncluded + */ + + /** + * Constructs a new EndAtTimeInfo. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0 + * @classdesc Represents an EndAtTimeInfo. + * @implements IEndAtTimeInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set + */ + function EndAtTimeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndAtTimeInfo endTimeMs. + * @member {number|Long} endTimeMs + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + */ + EndAtTimeInfo.prototype.endTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * EndAtTimeInfo endTimeIncluded. + * @member {boolean} endTimeIncluded + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + */ + EndAtTimeInfo.prototype.endTimeIncluded = false; + + /** + * Creates a new EndAtTimeInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo instance + */ + EndAtTimeInfo.create = function create(properties) { + return new EndAtTimeInfo(properties); + }; + + /** + * Encodes the specified EndAtTimeInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndAtTimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endTimeMs != null && Object.hasOwnProperty.call(message, "endTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.endTimeMs); + if (message.endTimeIncluded != null && Object.hasOwnProperty.call(message, "endTimeIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.endTimeIncluded); + return writer; + }; + + /** + * Encodes the specified EndAtTimeInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.IEndAtTimeInfo} message EndAtTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndAtTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndAtTimeInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndAtTimeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.endTimeMs = reader.uint64(); + break; + case 2: + message.endTimeIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndAtTimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndAtTimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndAtTimeInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndAtTimeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) + if (!$util.isInteger(message.endTimeMs) && !(message.endTimeMs && $util.isInteger(message.endTimeMs.low) && $util.isInteger(message.endTimeMs.high))) + return "endTimeMs: integer|Long expected"; + if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) + if (typeof message.endTimeIncluded !== "boolean") + return "endTimeIncluded: boolean expected"; + return null; + }; + + /** + * Creates an EndAtTimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} EndAtTimeInfo + */ + EndAtTimeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo(); + if (object.endTimeMs != null) + if ($util.Long) + (message.endTimeMs = $util.Long.fromValue(object.endTimeMs)).unsigned = true; + else if (typeof object.endTimeMs === "string") + message.endTimeMs = parseInt(object.endTimeMs, 10); + else if (typeof object.endTimeMs === "number") + message.endTimeMs = object.endTimeMs; + else if (typeof object.endTimeMs === "object") + message.endTimeMs = new $util.LongBits(object.endTimeMs.low >>> 0, object.endTimeMs.high >>> 0).toNumber(true); + if (object.endTimeIncluded != null) + message.endTimeIncluded = Boolean(object.endTimeIncluded); + return message; + }; + + /** + * Creates a plain object from an EndAtTimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo} message EndAtTimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndAtTimeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.endTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endTimeMs = options.longs === String ? "0" : 0; + object.endTimeIncluded = false; + } + if (message.endTimeMs != null && message.hasOwnProperty("endTimeMs")) + if (typeof message.endTimeMs === "number") + object.endTimeMs = options.longs === String ? String(message.endTimeMs) : message.endTimeMs; + else + object.endTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeMs) : options.longs === Number ? new $util.LongBits(message.endTimeMs.low >>> 0, message.endTimeMs.high >>> 0).toNumber(true) : message.endTimeMs; + if (message.endTimeIncluded != null && message.hasOwnProperty("endTimeIncluded")) + object.endTimeIncluded = message.endTimeIncluded; + return object; + }; + + /** + * Converts this EndAtTimeInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateRequest.GetVotePollsByEndDateRequestV0.EndAtTimeInfo + * @instance + * @returns {Object.} JSON object + */ + EndAtTimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EndAtTimeInfo; + })(); + + return GetVotePollsByEndDateRequestV0; + })(); + + return GetVotePollsByEndDateRequest; + })(); + + v0.GetVotePollsByEndDateResponse = (function() { + + /** + * Properties of a GetVotePollsByEndDateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetVotePollsByEndDateResponse + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null} [v0] GetVotePollsByEndDateResponse v0 + */ + + /** + * Constructs a new GetVotePollsByEndDateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetVotePollsByEndDateResponse. + * @implements IGetVotePollsByEndDateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set + */ + function GetVotePollsByEndDateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVotePollsByEndDateResponse v0. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + */ + GetVotePollsByEndDateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse instance + */ + GetVotePollsByEndDateResponse.create = function create(properties) { + return new GetVotePollsByEndDateResponse(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} GetVotePollsByEndDateResponse + */ + GetVotePollsByEndDateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse} message GetVotePollsByEndDateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetVotePollsByEndDateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 = (function() { + + /** + * Properties of a GetVotePollsByEndDateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @interface IGetVotePollsByEndDateResponseV0 + * @property {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null} [votePollsByTimestamps] GetVotePollsByEndDateResponseV0 votePollsByTimestamps + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetVotePollsByEndDateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetVotePollsByEndDateResponseV0 metadata + */ + + /** + * Constructs a new GetVotePollsByEndDateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse + * @classdesc Represents a GetVotePollsByEndDateResponseV0. + * @implements IGetVotePollsByEndDateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set + */ + function GetVotePollsByEndDateResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVotePollsByEndDateResponseV0 votePollsByTimestamps. + * @member {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps|null|undefined} votePollsByTimestamps + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.votePollsByTimestamps = null; + + /** + * GetVotePollsByEndDateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.proof = null; + + /** + * GetVotePollsByEndDateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + GetVotePollsByEndDateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetVotePollsByEndDateResponseV0 result. + * @member {"votePollsByTimestamps"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + */ + Object.defineProperty(GetVotePollsByEndDateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["votePollsByTimestamps", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetVotePollsByEndDateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 instance + */ + GetVotePollsByEndDateResponseV0.create = function create(properties) { + return new GetVotePollsByEndDateResponseV0(properties); + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votePollsByTimestamps != null && Object.hasOwnProperty.call(message, "votePollsByTimestamps")) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.encode(message.votePollsByTimestamps, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetVotePollsByEndDateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.IGetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVotePollsByEndDateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVotePollsByEndDateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVotePollsByEndDateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVotePollsByEndDateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVotePollsByEndDateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify(message.votePollsByTimestamps); + if (error) + return "votePollsByTimestamps." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetVotePollsByEndDateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} GetVotePollsByEndDateResponseV0 + */ + GetVotePollsByEndDateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0(); + if (object.votePollsByTimestamps != null) { + if (typeof object.votePollsByTimestamps !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.votePollsByTimestamps: object expected"); + message.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.fromObject(object.votePollsByTimestamps); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetVotePollsByEndDateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0} message GetVotePollsByEndDateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVotePollsByEndDateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + object.votePollsByTimestamps = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.toObject(message.votePollsByTimestamps, options); + if (options.oneofs) + object.result = "votePollsByTimestamps"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetVotePollsByEndDateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetVotePollsByEndDateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp = (function() { + + /** + * Properties of a SerializedVotePollsByTimestamp. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @interface ISerializedVotePollsByTimestamp + * @property {number|Long|null} [timestamp] SerializedVotePollsByTimestamp timestamp + * @property {Array.|null} [serializedVotePolls] SerializedVotePollsByTimestamp serializedVotePolls + */ + + /** + * Constructs a new SerializedVotePollsByTimestamp. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @classdesc Represents a SerializedVotePollsByTimestamp. + * @implements ISerializedVotePollsByTimestamp + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set + */ + function SerializedVotePollsByTimestamp(properties) { + this.serializedVotePolls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerializedVotePollsByTimestamp timestamp. + * @member {number|Long} timestamp + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + */ + SerializedVotePollsByTimestamp.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SerializedVotePollsByTimestamp serializedVotePolls. + * @member {Array.} serializedVotePolls + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + */ + SerializedVotePollsByTimestamp.prototype.serializedVotePolls = $util.emptyArray; + + /** + * Creates a new SerializedVotePollsByTimestamp instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp instance + */ + SerializedVotePollsByTimestamp.create = function create(properties) { + return new SerializedVotePollsByTimestamp(properties); + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamp message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); + if (message.serializedVotePolls != null && message.serializedVotePolls.length) + for (var i = 0; i < message.serializedVotePolls.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.serializedVotePolls[i]); + return writer; + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamp message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + if (!(message.serializedVotePolls && message.serializedVotePolls.length)) + message.serializedVotePolls = []; + message.serializedVotePolls.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerializedVotePollsByTimestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerializedVotePollsByTimestamp message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerializedVotePollsByTimestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.serializedVotePolls != null && message.hasOwnProperty("serializedVotePolls")) { + if (!Array.isArray(message.serializedVotePolls)) + return "serializedVotePolls: array expected"; + for (var i = 0; i < message.serializedVotePolls.length; ++i) + if (!(message.serializedVotePolls[i] && typeof message.serializedVotePolls[i].length === "number" || $util.isString(message.serializedVotePolls[i]))) + return "serializedVotePolls: buffer[] expected"; + } + return null; + }; + + /** + * Creates a SerializedVotePollsByTimestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} SerializedVotePollsByTimestamp + */ + SerializedVotePollsByTimestamp.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.serializedVotePolls) { + if (!Array.isArray(object.serializedVotePolls)) + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.serializedVotePolls: array expected"); + message.serializedVotePolls = []; + for (var i = 0; i < object.serializedVotePolls.length; ++i) + if (typeof object.serializedVotePolls[i] === "string") + $util.base64.decode(object.serializedVotePolls[i], message.serializedVotePolls[i] = $util.newBuffer($util.base64.length(object.serializedVotePolls[i])), 0); + else if (object.serializedVotePolls[i].length >= 0) + message.serializedVotePolls[i] = object.serializedVotePolls[i]; + } + return message; + }; + + /** + * Creates a plain object from a SerializedVotePollsByTimestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp} message SerializedVotePollsByTimestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerializedVotePollsByTimestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serializedVotePolls = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.serializedVotePolls && message.serializedVotePolls.length) { + object.serializedVotePolls = []; + for (var j = 0; j < message.serializedVotePolls.length; ++j) + object.serializedVotePolls[j] = options.bytes === String ? $util.base64.encode(message.serializedVotePolls[j], 0, message.serializedVotePolls[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedVotePolls[j]) : message.serializedVotePolls[j]; + } + return object; + }; + + /** + * Converts this SerializedVotePollsByTimestamp to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp + * @instance + * @returns {Object.} JSON object + */ + SerializedVotePollsByTimestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerializedVotePollsByTimestamp; + })(); + + GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps = (function() { + + /** + * Properties of a SerializedVotePollsByTimestamps. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @interface ISerializedVotePollsByTimestamps + * @property {Array.|null} [votePollsByTimestamps] SerializedVotePollsByTimestamps votePollsByTimestamps + * @property {boolean|null} [finishedResults] SerializedVotePollsByTimestamps finishedResults + */ + + /** + * Constructs a new SerializedVotePollsByTimestamps. + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0 + * @classdesc Represents a SerializedVotePollsByTimestamps. + * @implements ISerializedVotePollsByTimestamps + * @constructor + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set + */ + function SerializedVotePollsByTimestamps(properties) { + this.votePollsByTimestamps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerializedVotePollsByTimestamps votePollsByTimestamps. + * @member {Array.} votePollsByTimestamps + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + */ + SerializedVotePollsByTimestamps.prototype.votePollsByTimestamps = $util.emptyArray; + + /** + * SerializedVotePollsByTimestamps finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + */ + SerializedVotePollsByTimestamps.prototype.finishedResults = false; + + /** + * Creates a new SerializedVotePollsByTimestamps instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps instance + */ + SerializedVotePollsByTimestamps.create = function create(properties) { + return new SerializedVotePollsByTimestamps(properties); + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamps message. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamps.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votePollsByTimestamps != null && message.votePollsByTimestamps.length) + for (var i = 0; i < message.votePollsByTimestamps.length; ++i) + $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.encode(message.votePollsByTimestamps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified SerializedVotePollsByTimestamps message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.ISerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedVotePollsByTimestamps.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamps.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.votePollsByTimestamps && message.votePollsByTimestamps.length)) + message.votePollsByTimestamps = []; + message.votePollsByTimestamps.push($root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.decode(reader, reader.uint32())); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerializedVotePollsByTimestamps message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedVotePollsByTimestamps.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerializedVotePollsByTimestamps message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerializedVotePollsByTimestamps.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.votePollsByTimestamps != null && message.hasOwnProperty("votePollsByTimestamps")) { + if (!Array.isArray(message.votePollsByTimestamps)) + return "votePollsByTimestamps: array expected"; + for (var i = 0; i < message.votePollsByTimestamps.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.verify(message.votePollsByTimestamps[i]); + if (error) + return "votePollsByTimestamps." + error; + } + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a SerializedVotePollsByTimestamps message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} SerializedVotePollsByTimestamps + */ + SerializedVotePollsByTimestamps.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps(); + if (object.votePollsByTimestamps) { + if (!Array.isArray(object.votePollsByTimestamps)) + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: array expected"); + message.votePollsByTimestamps = []; + for (var i = 0; i < object.votePollsByTimestamps.length; ++i) { + if (typeof object.votePollsByTimestamps[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps.votePollsByTimestamps: object expected"); + message.votePollsByTimestamps[i] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.fromObject(object.votePollsByTimestamps[i]); + } + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a SerializedVotePollsByTimestamps message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @static + * @param {org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps} message SerializedVotePollsByTimestamps + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerializedVotePollsByTimestamps.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.votePollsByTimestamps = []; + if (options.defaults) + object.finishedResults = false; + if (message.votePollsByTimestamps && message.votePollsByTimestamps.length) { + object.votePollsByTimestamps = []; + for (var j = 0; j < message.votePollsByTimestamps.length; ++j) + object.votePollsByTimestamps[j] = $root.org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamp.toObject(message.votePollsByTimestamps[j], options); + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this SerializedVotePollsByTimestamps to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetVotePollsByEndDateResponse.GetVotePollsByEndDateResponseV0.SerializedVotePollsByTimestamps + * @instance + * @returns {Object.} JSON object + */ + SerializedVotePollsByTimestamps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerializedVotePollsByTimestamps; + })(); + + return GetVotePollsByEndDateResponseV0; + })(); + + return GetVotePollsByEndDateResponse; + })(); + + v0.GetContestedResourceVoteStateRequest = (function() { + + /** + * Properties of a GetContestedResourceVoteStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVoteStateRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null} [v0] GetContestedResourceVoteStateRequest v0 + */ + + /** + * Constructs a new GetContestedResourceVoteStateRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVoteStateRequest. + * @implements IGetContestedResourceVoteStateRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set + */ + function GetContestedResourceVoteStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVoteStateRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + */ + GetContestedResourceVoteStateRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest instance + */ + GetContestedResourceVoteStateRequest.create = function create(properties) { + return new GetContestedResourceVoteStateRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} GetContestedResourceVoteStateRequest + */ + GetContestedResourceVoteStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest} message GetContestedResourceVoteStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceVoteStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @interface IGetContestedResourceVoteStateRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourceVoteStateRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourceVoteStateRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourceVoteStateRequestV0 indexName + * @property {Array.|null} [indexValues] GetContestedResourceVoteStateRequestV0 indexValues + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType|null} [resultType] GetContestedResourceVoteStateRequestV0 resultType + * @property {boolean|null} [allowIncludeLockedAndAbstainingVoteTally] GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo + * @property {number|null} [count] GetContestedResourceVoteStateRequestV0 count + * @property {boolean|null} [prove] GetContestedResourceVoteStateRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceVoteStateRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest + * @classdesc Represents a GetContestedResourceVoteStateRequestV0. + * @implements IGetContestedResourceVoteStateRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set + */ + function GetContestedResourceVoteStateRequestV0(properties) { + this.indexValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVoteStateRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourceVoteStateRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourceVoteStateRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourceVoteStateRequestV0 indexValues. + * @member {Array.} indexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.indexValues = $util.emptyArray; + + /** + * GetContestedResourceVoteStateRequestV0 resultType. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType} resultType + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.resultType = 0; + + /** + * GetContestedResourceVoteStateRequestV0 allowIncludeLockedAndAbstainingVoteTally. + * @member {boolean} allowIncludeLockedAndAbstainingVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.allowIncludeLockedAndAbstainingVoteTally = false; + + /** + * GetContestedResourceVoteStateRequestV0 startAtIdentifierInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.startAtIdentifierInfo = null; + + /** + * GetContestedResourceVoteStateRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.count = 0; + + /** + * GetContestedResourceVoteStateRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + */ + GetContestedResourceVoteStateRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceVoteStateRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 instance + */ + GetContestedResourceVoteStateRequestV0.create = function create(properties) { + return new GetContestedResourceVoteStateRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.indexValues != null && message.indexValues.length) + for (var i = 0; i < message.indexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); + if (message.resultType != null && Object.hasOwnProperty.call(message, "resultType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resultType); + if (message.allowIncludeLockedAndAbstainingVoteTally != null && Object.hasOwnProperty.call(message, "allowIncludeLockedAndAbstainingVoteTally")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowIncludeLockedAndAbstainingVoteTally); + if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.IGetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.indexValues && message.indexValues.length)) + message.indexValues = []; + message.indexValues.push(reader.bytes()); + break; + case 5: + message.resultType = reader.int32(); + break; + case 6: + message.allowIncludeLockedAndAbstainingVoteTally = reader.bool(); + break; + case 7: + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); + break; + case 8: + message.count = reader.uint32(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.indexValues != null && message.hasOwnProperty("indexValues")) { + if (!Array.isArray(message.indexValues)) + return "indexValues: array expected"; + for (var i = 0; i < message.indexValues.length; ++i) + if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) + return "indexValues: buffer[] expected"; + } + if (message.resultType != null && message.hasOwnProperty("resultType")) + switch (message.resultType) { + default: + return "resultType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) + if (typeof message.allowIncludeLockedAndAbstainingVoteTally !== "boolean") + return "allowIncludeLockedAndAbstainingVoteTally: boolean expected"; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); + if (error) + return "startAtIdentifierInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} GetContestedResourceVoteStateRequestV0 + */ + GetContestedResourceVoteStateRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.indexValues) { + if (!Array.isArray(object.indexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.indexValues: array expected"); + message.indexValues = []; + for (var i = 0; i < object.indexValues.length; ++i) + if (typeof object.indexValues[i] === "string") + $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); + else if (object.indexValues[i].length >= 0) + message.indexValues[i] = object.indexValues[i]; + } + switch (object.resultType) { + case "DOCUMENTS": + case 0: + message.resultType = 0; + break; + case "VOTE_TALLY": + case 1: + message.resultType = 1; + break; + case "DOCUMENTS_AND_VOTE_TALLY": + case 2: + message.resultType = 2; + break; + } + if (object.allowIncludeLockedAndAbstainingVoteTally != null) + message.allowIncludeLockedAndAbstainingVoteTally = Boolean(object.allowIncludeLockedAndAbstainingVoteTally); + if (object.startAtIdentifierInfo != null) { + if (typeof object.startAtIdentifierInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.startAtIdentifierInfo: object expected"); + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0} message GetContestedResourceVoteStateRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + object.resultType = options.enums === String ? "DOCUMENTS" : 0; + object.allowIncludeLockedAndAbstainingVoteTally = false; + object.startAtIdentifierInfo = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.indexValues && message.indexValues.length) { + object.indexValues = []; + for (var j = 0; j < message.indexValues.length; ++j) + object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; + } + if (message.resultType != null && message.hasOwnProperty("resultType")) + object.resultType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType[message.resultType] : message.resultType; + if (message.allowIncludeLockedAndAbstainingVoteTally != null && message.hasOwnProperty("allowIncludeLockedAndAbstainingVoteTally")) + object.allowIncludeLockedAndAbstainingVoteTally = message.allowIncludeLockedAndAbstainingVoteTally; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) + object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo = (function() { + + /** + * Properties of a StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @interface IStartAtIdentifierInfo + * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier + * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded + */ + + /** + * Constructs a new StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0 + * @classdesc Represents a StartAtIdentifierInfo. + * @implements IStartAtIdentifierInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + */ + function StartAtIdentifierInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtIdentifierInfo startIdentifier. + * @member {Uint8Array} startIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); + + /** + * StartAtIdentifierInfo startIdentifierIncluded. + * @member {boolean} startIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; + + /** + * Creates a new StartAtIdentifierInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance + */ + StartAtIdentifierInfo.create = function create(properties) { + return new StartAtIdentifierInfo(properties); + }; + + /** + * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); + if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startIdentifier = reader.bytes(); + break; + case 2: + message.startIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtIdentifierInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtIdentifierInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) + return "startIdentifier: buffer expected"; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + if (typeof message.startIdentifierIncluded !== "boolean") + return "startIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + */ + StartAtIdentifierInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo(); + if (object.startIdentifier != null) + if (typeof object.startIdentifier === "string") + $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); + else if (object.startIdentifier.length >= 0) + message.startIdentifier = object.startIdentifier; + if (object.startIdentifierIncluded != null) + message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtIdentifierInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startIdentifier = ""; + else { + object.startIdentifier = []; + if (options.bytes !== Array) + object.startIdentifier = $util.newBuffer(object.startIdentifier); + } + object.startIdentifierIncluded = false; + } + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + object.startIdentifierIncluded = message.startIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtIdentifierInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtIdentifierInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtIdentifierInfo; + })(); + + /** + * ResultType enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType + * @enum {number} + * @property {number} DOCUMENTS=0 DOCUMENTS value + * @property {number} VOTE_TALLY=1 VOTE_TALLY value + * @property {number} DOCUMENTS_AND_VOTE_TALLY=2 DOCUMENTS_AND_VOTE_TALLY value + */ + GetContestedResourceVoteStateRequestV0.ResultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENTS"] = 0; + values[valuesById[1] = "VOTE_TALLY"] = 1; + values[valuesById[2] = "DOCUMENTS_AND_VOTE_TALLY"] = 2; + return values; + })(); + + return GetContestedResourceVoteStateRequestV0; + })(); + + return GetContestedResourceVoteStateRequest; + })(); + + v0.GetContestedResourceVoteStateResponse = (function() { + + /** + * Properties of a GetContestedResourceVoteStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVoteStateResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null} [v0] GetContestedResourceVoteStateResponse v0 + */ + + /** + * Constructs a new GetContestedResourceVoteStateResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVoteStateResponse. + * @implements IGetContestedResourceVoteStateResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set + */ + function GetContestedResourceVoteStateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVoteStateResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + */ + GetContestedResourceVoteStateResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse instance + */ + GetContestedResourceVoteStateResponse.create = function create(properties) { + return new GetContestedResourceVoteStateResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} GetContestedResourceVoteStateResponse + */ + GetContestedResourceVoteStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse} message GetContestedResourceVoteStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceVoteStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @interface IGetContestedResourceVoteStateResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null} [contestedResourceContenders] GetContestedResourceVoteStateResponseV0 contestedResourceContenders + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVoteStateResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVoteStateResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceVoteStateResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse + * @classdesc Represents a GetContestedResourceVoteStateResponseV0. + * @implements IGetContestedResourceVoteStateResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set + */ + function GetContestedResourceVoteStateResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVoteStateResponseV0 contestedResourceContenders. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders|null|undefined} contestedResourceContenders + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.contestedResourceContenders = null; + + /** + * GetContestedResourceVoteStateResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.proof = null; + + /** + * GetContestedResourceVoteStateResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + GetContestedResourceVoteStateResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVoteStateResponseV0 result. + * @member {"contestedResourceContenders"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceVoteStateResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceContenders", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVoteStateResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 instance + */ + GetContestedResourceVoteStateResponseV0.create = function create(properties) { + return new GetContestedResourceVoteStateResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceContenders != null && Object.hasOwnProperty.call(message, "contestedResourceContenders")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.encode(message.contestedResourceContenders, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVoteStateResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.IGetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVoteStateResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVoteStateResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVoteStateResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVoteStateResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVoteStateResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify(message.contestedResourceContenders); + if (error) + return "contestedResourceContenders." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceVoteStateResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} GetContestedResourceVoteStateResponseV0 + */ + GetContestedResourceVoteStateResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0(); + if (object.contestedResourceContenders != null) { + if (typeof object.contestedResourceContenders !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.contestedResourceContenders: object expected"); + message.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.fromObject(object.contestedResourceContenders); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVoteStateResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0} message GetContestedResourceVoteStateResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVoteStateResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceContenders != null && message.hasOwnProperty("contestedResourceContenders")) { + object.contestedResourceContenders = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.toObject(message.contestedResourceContenders, options); + if (options.oneofs) + object.result = "contestedResourceContenders"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceVoteStateResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVoteStateResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVoteStateResponseV0.FinishedVoteInfo = (function() { + + /** + * Properties of a FinishedVoteInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IFinishedVoteInfo + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome|null} [finishedVoteOutcome] FinishedVoteInfo finishedVoteOutcome + * @property {Uint8Array|null} [wonByIdentityId] FinishedVoteInfo wonByIdentityId + * @property {number|Long|null} [finishedAtBlockHeight] FinishedVoteInfo finishedAtBlockHeight + * @property {number|null} [finishedAtCoreBlockHeight] FinishedVoteInfo finishedAtCoreBlockHeight + * @property {number|Long|null} [finishedAtBlockTimeMs] FinishedVoteInfo finishedAtBlockTimeMs + * @property {number|null} [finishedAtEpoch] FinishedVoteInfo finishedAtEpoch + */ + + /** + * Constructs a new FinishedVoteInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a FinishedVoteInfo. + * @implements IFinishedVoteInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set + */ + function FinishedVoteInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FinishedVoteInfo finishedVoteOutcome. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome} finishedVoteOutcome + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedVoteOutcome = 0; + + /** + * FinishedVoteInfo wonByIdentityId. + * @member {Uint8Array} wonByIdentityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.wonByIdentityId = $util.newBuffer([]); + + /** + * FinishedVoteInfo finishedAtBlockHeight. + * @member {number|Long} finishedAtBlockHeight + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * FinishedVoteInfo finishedAtCoreBlockHeight. + * @member {number} finishedAtCoreBlockHeight + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtCoreBlockHeight = 0; + + /** + * FinishedVoteInfo finishedAtBlockTimeMs. + * @member {number|Long} finishedAtBlockTimeMs + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtBlockTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * FinishedVoteInfo finishedAtEpoch. + * @member {number} finishedAtEpoch + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + */ + FinishedVoteInfo.prototype.finishedAtEpoch = 0; + + /** + * Creates a new FinishedVoteInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo instance + */ + FinishedVoteInfo.create = function create(properties) { + return new FinishedVoteInfo(properties); + }; + + /** + * Encodes the specified FinishedVoteInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishedVoteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finishedVoteOutcome != null && Object.hasOwnProperty.call(message, "finishedVoteOutcome")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.finishedVoteOutcome); + if (message.wonByIdentityId != null && Object.hasOwnProperty.call(message, "wonByIdentityId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.wonByIdentityId); + if (message.finishedAtBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtBlockHeight")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.finishedAtBlockHeight); + if (message.finishedAtCoreBlockHeight != null && Object.hasOwnProperty.call(message, "finishedAtCoreBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.finishedAtCoreBlockHeight); + if (message.finishedAtBlockTimeMs != null && Object.hasOwnProperty.call(message, "finishedAtBlockTimeMs")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.finishedAtBlockTimeMs); + if (message.finishedAtEpoch != null && Object.hasOwnProperty.call(message, "finishedAtEpoch")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.finishedAtEpoch); + return writer; + }; + + /** + * Encodes the specified FinishedVoteInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo} message FinishedVoteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinishedVoteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinishedVoteInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishedVoteInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.finishedVoteOutcome = reader.int32(); + break; + case 2: + message.wonByIdentityId = reader.bytes(); + break; + case 3: + message.finishedAtBlockHeight = reader.uint64(); + break; + case 4: + message.finishedAtCoreBlockHeight = reader.uint32(); + break; + case 5: + message.finishedAtBlockTimeMs = reader.uint64(); + break; + case 6: + message.finishedAtEpoch = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinishedVoteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinishedVoteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinishedVoteInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinishedVoteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) + switch (message.finishedVoteOutcome) { + default: + return "finishedVoteOutcome: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) + if (!(message.wonByIdentityId && typeof message.wonByIdentityId.length === "number" || $util.isString(message.wonByIdentityId))) + return "wonByIdentityId: buffer expected"; + if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) + if (!$util.isInteger(message.finishedAtBlockHeight) && !(message.finishedAtBlockHeight && $util.isInteger(message.finishedAtBlockHeight.low) && $util.isInteger(message.finishedAtBlockHeight.high))) + return "finishedAtBlockHeight: integer|Long expected"; + if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) + if (!$util.isInteger(message.finishedAtCoreBlockHeight)) + return "finishedAtCoreBlockHeight: integer expected"; + if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) + if (!$util.isInteger(message.finishedAtBlockTimeMs) && !(message.finishedAtBlockTimeMs && $util.isInteger(message.finishedAtBlockTimeMs.low) && $util.isInteger(message.finishedAtBlockTimeMs.high))) + return "finishedAtBlockTimeMs: integer|Long expected"; + if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) + if (!$util.isInteger(message.finishedAtEpoch)) + return "finishedAtEpoch: integer expected"; + return null; + }; + + /** + * Creates a FinishedVoteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} FinishedVoteInfo + */ + FinishedVoteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo(); + switch (object.finishedVoteOutcome) { + case "TOWARDS_IDENTITY": + case 0: + message.finishedVoteOutcome = 0; + break; + case "LOCKED": + case 1: + message.finishedVoteOutcome = 1; + break; + case "NO_PREVIOUS_WINNER": + case 2: + message.finishedVoteOutcome = 2; + break; + } + if (object.wonByIdentityId != null) + if (typeof object.wonByIdentityId === "string") + $util.base64.decode(object.wonByIdentityId, message.wonByIdentityId = $util.newBuffer($util.base64.length(object.wonByIdentityId)), 0); + else if (object.wonByIdentityId.length >= 0) + message.wonByIdentityId = object.wonByIdentityId; + if (object.finishedAtBlockHeight != null) + if ($util.Long) + (message.finishedAtBlockHeight = $util.Long.fromValue(object.finishedAtBlockHeight)).unsigned = true; + else if (typeof object.finishedAtBlockHeight === "string") + message.finishedAtBlockHeight = parseInt(object.finishedAtBlockHeight, 10); + else if (typeof object.finishedAtBlockHeight === "number") + message.finishedAtBlockHeight = object.finishedAtBlockHeight; + else if (typeof object.finishedAtBlockHeight === "object") + message.finishedAtBlockHeight = new $util.LongBits(object.finishedAtBlockHeight.low >>> 0, object.finishedAtBlockHeight.high >>> 0).toNumber(true); + if (object.finishedAtCoreBlockHeight != null) + message.finishedAtCoreBlockHeight = object.finishedAtCoreBlockHeight >>> 0; + if (object.finishedAtBlockTimeMs != null) + if ($util.Long) + (message.finishedAtBlockTimeMs = $util.Long.fromValue(object.finishedAtBlockTimeMs)).unsigned = true; + else if (typeof object.finishedAtBlockTimeMs === "string") + message.finishedAtBlockTimeMs = parseInt(object.finishedAtBlockTimeMs, 10); + else if (typeof object.finishedAtBlockTimeMs === "number") + message.finishedAtBlockTimeMs = object.finishedAtBlockTimeMs; + else if (typeof object.finishedAtBlockTimeMs === "object") + message.finishedAtBlockTimeMs = new $util.LongBits(object.finishedAtBlockTimeMs.low >>> 0, object.finishedAtBlockTimeMs.high >>> 0).toNumber(true); + if (object.finishedAtEpoch != null) + message.finishedAtEpoch = object.finishedAtEpoch >>> 0; + return message; + }; + + /** + * Creates a plain object from a FinishedVoteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo} message FinishedVoteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinishedVoteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finishedVoteOutcome = options.enums === String ? "TOWARDS_IDENTITY" : 0; + if (options.bytes === String) + object.wonByIdentityId = ""; + else { + object.wonByIdentityId = []; + if (options.bytes !== Array) + object.wonByIdentityId = $util.newBuffer(object.wonByIdentityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.finishedAtBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.finishedAtBlockHeight = options.longs === String ? "0" : 0; + object.finishedAtCoreBlockHeight = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.finishedAtBlockTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.finishedAtBlockTimeMs = options.longs === String ? "0" : 0; + object.finishedAtEpoch = 0; + } + if (message.finishedVoteOutcome != null && message.hasOwnProperty("finishedVoteOutcome")) + object.finishedVoteOutcome = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome[message.finishedVoteOutcome] : message.finishedVoteOutcome; + if (message.wonByIdentityId != null && message.hasOwnProperty("wonByIdentityId")) + object.wonByIdentityId = options.bytes === String ? $util.base64.encode(message.wonByIdentityId, 0, message.wonByIdentityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.wonByIdentityId) : message.wonByIdentityId; + if (message.finishedAtBlockHeight != null && message.hasOwnProperty("finishedAtBlockHeight")) + if (typeof message.finishedAtBlockHeight === "number") + object.finishedAtBlockHeight = options.longs === String ? String(message.finishedAtBlockHeight) : message.finishedAtBlockHeight; + else + object.finishedAtBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockHeight) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockHeight.low >>> 0, message.finishedAtBlockHeight.high >>> 0).toNumber(true) : message.finishedAtBlockHeight; + if (message.finishedAtCoreBlockHeight != null && message.hasOwnProperty("finishedAtCoreBlockHeight")) + object.finishedAtCoreBlockHeight = message.finishedAtCoreBlockHeight; + if (message.finishedAtBlockTimeMs != null && message.hasOwnProperty("finishedAtBlockTimeMs")) + if (typeof message.finishedAtBlockTimeMs === "number") + object.finishedAtBlockTimeMs = options.longs === String ? String(message.finishedAtBlockTimeMs) : message.finishedAtBlockTimeMs; + else + object.finishedAtBlockTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.finishedAtBlockTimeMs) : options.longs === Number ? new $util.LongBits(message.finishedAtBlockTimeMs.low >>> 0, message.finishedAtBlockTimeMs.high >>> 0).toNumber(true) : message.finishedAtBlockTimeMs; + if (message.finishedAtEpoch != null && message.hasOwnProperty("finishedAtEpoch")) + object.finishedAtEpoch = message.finishedAtEpoch; + return object; + }; + + /** + * Converts this FinishedVoteInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo + * @instance + * @returns {Object.} JSON object + */ + FinishedVoteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * FinishedVoteOutcome enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome + * @enum {number} + * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value + * @property {number} LOCKED=1 LOCKED value + * @property {number} NO_PREVIOUS_WINNER=2 NO_PREVIOUS_WINNER value + */ + FinishedVoteInfo.FinishedVoteOutcome = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; + values[valuesById[1] = "LOCKED"] = 1; + values[valuesById[2] = "NO_PREVIOUS_WINNER"] = 2; + return values; + })(); + + return FinishedVoteInfo; + })(); + + GetContestedResourceVoteStateResponseV0.ContestedResourceContenders = (function() { + + /** + * Properties of a ContestedResourceContenders. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IContestedResourceContenders + * @property {Array.|null} [contenders] ContestedResourceContenders contenders + * @property {number|null} [abstainVoteTally] ContestedResourceContenders abstainVoteTally + * @property {number|null} [lockVoteTally] ContestedResourceContenders lockVoteTally + * @property {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null} [finishedVoteInfo] ContestedResourceContenders finishedVoteInfo + */ + + /** + * Constructs a new ContestedResourceContenders. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a ContestedResourceContenders. + * @implements IContestedResourceContenders + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set + */ + function ContestedResourceContenders(properties) { + this.contenders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceContenders contenders. + * @member {Array.} contenders + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.contenders = $util.emptyArray; + + /** + * ContestedResourceContenders abstainVoteTally. + * @member {number} abstainVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.abstainVoteTally = 0; + + /** + * ContestedResourceContenders lockVoteTally. + * @member {number} lockVoteTally + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.lockVoteTally = 0; + + /** + * ContestedResourceContenders finishedVoteInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IFinishedVoteInfo|null|undefined} finishedVoteInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + */ + ContestedResourceContenders.prototype.finishedVoteInfo = null; + + /** + * Creates a new ContestedResourceContenders instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders instance + */ + ContestedResourceContenders.create = function create(properties) { + return new ContestedResourceContenders(properties); + }; + + /** + * Encodes the specified ContestedResourceContenders message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceContenders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contenders != null && message.contenders.length) + for (var i = 0; i < message.contenders.length; ++i) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.encode(message.contenders[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.abstainVoteTally != null && Object.hasOwnProperty.call(message, "abstainVoteTally")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.abstainVoteTally); + if (message.lockVoteTally != null && Object.hasOwnProperty.call(message, "lockVoteTally")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.lockVoteTally); + if (message.finishedVoteInfo != null && Object.hasOwnProperty.call(message, "finishedVoteInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.encode(message.finishedVoteInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContestedResourceContenders message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContestedResourceContenders} message ContestedResourceContenders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceContenders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceContenders message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceContenders.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contenders && message.contenders.length)) + message.contenders = []; + message.contenders.push($root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.decode(reader, reader.uint32())); + break; + case 2: + message.abstainVoteTally = reader.uint32(); + break; + case 3: + message.lockVoteTally = reader.uint32(); + break; + case 4: + message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceContenders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceContenders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceContenders message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceContenders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contenders != null && message.hasOwnProperty("contenders")) { + if (!Array.isArray(message.contenders)) + return "contenders: array expected"; + for (var i = 0; i < message.contenders.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify(message.contenders[i]); + if (error) + return "contenders." + error; + } + } + if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) + if (!$util.isInteger(message.abstainVoteTally)) + return "abstainVoteTally: integer expected"; + if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) + if (!$util.isInteger(message.lockVoteTally)) + return "lockVoteTally: integer expected"; + if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.verify(message.finishedVoteInfo); + if (error) + return "finishedVoteInfo." + error; + } + return null; + }; + + /** + * Creates a ContestedResourceContenders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} ContestedResourceContenders + */ + ContestedResourceContenders.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders(); + if (object.contenders) { + if (!Array.isArray(object.contenders)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: array expected"); + message.contenders = []; + for (var i = 0; i < object.contenders.length; ++i) { + if (typeof object.contenders[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.contenders: object expected"); + message.contenders[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.fromObject(object.contenders[i]); + } + } + if (object.abstainVoteTally != null) + message.abstainVoteTally = object.abstainVoteTally >>> 0; + if (object.lockVoteTally != null) + message.lockVoteTally = object.lockVoteTally >>> 0; + if (object.finishedVoteInfo != null) { + if (typeof object.finishedVoteInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders.finishedVoteInfo: object expected"); + message.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.fromObject(object.finishedVoteInfo); + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceContenders message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders} message ContestedResourceContenders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceContenders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contenders = []; + if (options.defaults) { + object.abstainVoteTally = 0; + object.lockVoteTally = 0; + object.finishedVoteInfo = null; + } + if (message.contenders && message.contenders.length) { + object.contenders = []; + for (var j = 0; j < message.contenders.length; ++j) + object.contenders[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.toObject(message.contenders[j], options); + } + if (message.abstainVoteTally != null && message.hasOwnProperty("abstainVoteTally")) + object.abstainVoteTally = message.abstainVoteTally; + if (message.lockVoteTally != null && message.hasOwnProperty("lockVoteTally")) + object.lockVoteTally = message.lockVoteTally; + if (message.finishedVoteInfo != null && message.hasOwnProperty("finishedVoteInfo")) + object.finishedVoteInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.toObject(message.finishedVoteInfo, options); + return object; + }; + + /** + * Converts this ContestedResourceContenders to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceContenders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceContenders; + })(); + + GetContestedResourceVoteStateResponseV0.Contender = (function() { + + /** + * Properties of a Contender. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @interface IContender + * @property {Uint8Array|null} [identifier] Contender identifier + * @property {number|null} [voteCount] Contender voteCount + * @property {Uint8Array|null} [document] Contender document + */ + + /** + * Constructs a new Contender. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0 + * @classdesc Represents a Contender. + * @implements IContender + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set + */ + function Contender(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Contender identifier. + * @member {Uint8Array} identifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.identifier = $util.newBuffer([]); + + /** + * Contender voteCount. + * @member {number} voteCount + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.voteCount = 0; + + /** + * Contender document. + * @member {Uint8Array} document + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + */ + Contender.prototype.document = $util.newBuffer([]); + + /** + * Creates a new Contender instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender instance + */ + Contender.create = function create(properties) { + return new Contender(properties); + }; + + /** + * Encodes the specified Contender message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contender.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identifier); + if (message.voteCount != null && Object.hasOwnProperty.call(message, "voteCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.voteCount); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.document); + return writer; + }; + + /** + * Encodes the specified Contender message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.IContender} message Contender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Contender.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Contender message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contender.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.bytes(); + break; + case 2: + message.voteCount = reader.uint32(); + break; + case 3: + message.document = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Contender message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Contender.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Contender message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Contender.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identifier != null && message.hasOwnProperty("identifier")) + if (!(message.identifier && typeof message.identifier.length === "number" || $util.isString(message.identifier))) + return "identifier: buffer expected"; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + if (!$util.isInteger(message.voteCount)) + return "voteCount: integer expected"; + if (message.document != null && message.hasOwnProperty("document")) + if (!(message.document && typeof message.document.length === "number" || $util.isString(message.document))) + return "document: buffer expected"; + return null; + }; + + /** + * Creates a Contender message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} Contender + */ + Contender.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender(); + if (object.identifier != null) + if (typeof object.identifier === "string") + $util.base64.decode(object.identifier, message.identifier = $util.newBuffer($util.base64.length(object.identifier)), 0); + else if (object.identifier.length >= 0) + message.identifier = object.identifier; + if (object.voteCount != null) + message.voteCount = object.voteCount >>> 0; + if (object.document != null) + if (typeof object.document === "string") + $util.base64.decode(object.document, message.document = $util.newBuffer($util.base64.length(object.document)), 0); + else if (object.document.length >= 0) + message.document = object.document; + return message; + }; + + /** + * Creates a plain object from a Contender message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender} message Contender + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Contender.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identifier = ""; + else { + object.identifier = []; + if (options.bytes !== Array) + object.identifier = $util.newBuffer(object.identifier); + } + object.voteCount = 0; + if (options.bytes === String) + object.document = ""; + else { + object.document = []; + if (options.bytes !== Array) + object.document = $util.newBuffer(object.document); + } + } + if (message.identifier != null && message.hasOwnProperty("identifier")) + object.identifier = options.bytes === String ? $util.base64.encode(message.identifier, 0, message.identifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.identifier) : message.identifier; + if (message.voteCount != null && message.hasOwnProperty("voteCount")) + object.voteCount = message.voteCount; + if (message.document != null && message.hasOwnProperty("document")) + object.document = options.bytes === String ? $util.base64.encode(message.document, 0, message.document.length) : options.bytes === Array ? Array.prototype.slice.call(message.document) : message.document; + return object; + }; + + /** + * Converts this Contender to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender + * @instance + * @returns {Object.} JSON object + */ + Contender.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Contender; + })(); + + return GetContestedResourceVoteStateResponseV0; + })(); + + return GetContestedResourceVoteStateResponse; + })(); + + v0.GetContestedResourceVotersForIdentityRequest = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVotersForIdentityRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null} [v0] GetContestedResourceVotersForIdentityRequest v0 + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVotersForIdentityRequest. + * @implements IGetContestedResourceVotersForIdentityRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVotersForIdentityRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + */ + GetContestedResourceVotersForIdentityRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest instance + */ + GetContestedResourceVotersForIdentityRequest.create = function create(properties) { + return new GetContestedResourceVotersForIdentityRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} GetContestedResourceVotersForIdentityRequest + */ + GetContestedResourceVotersForIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest} message GetContestedResourceVotersForIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @interface IGetContestedResourceVotersForIdentityRequestV0 + * @property {Uint8Array|null} [contractId] GetContestedResourceVotersForIdentityRequestV0 contractId + * @property {string|null} [documentTypeName] GetContestedResourceVotersForIdentityRequestV0 documentTypeName + * @property {string|null} [indexName] GetContestedResourceVotersForIdentityRequestV0 indexName + * @property {Array.|null} [indexValues] GetContestedResourceVotersForIdentityRequestV0 indexValues + * @property {Uint8Array|null} [contestantId] GetContestedResourceVotersForIdentityRequestV0 contestantId + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null} [startAtIdentifierInfo] GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo + * @property {number|null} [count] GetContestedResourceVotersForIdentityRequestV0 count + * @property {boolean|null} [orderAscending] GetContestedResourceVotersForIdentityRequestV0 orderAscending + * @property {boolean|null} [prove] GetContestedResourceVotersForIdentityRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest + * @classdesc Represents a GetContestedResourceVotersForIdentityRequestV0. + * @implements IGetContestedResourceVotersForIdentityRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityRequestV0(properties) { + this.indexValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVotersForIdentityRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetContestedResourceVotersForIdentityRequestV0 documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.documentTypeName = ""; + + /** + * GetContestedResourceVotersForIdentityRequestV0 indexName. + * @member {string} indexName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.indexName = ""; + + /** + * GetContestedResourceVotersForIdentityRequestV0 indexValues. + * @member {Array.} indexValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.indexValues = $util.emptyArray; + + /** + * GetContestedResourceVotersForIdentityRequestV0 contestantId. + * @member {Uint8Array} contestantId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.contestantId = $util.newBuffer([]); + + /** + * GetContestedResourceVotersForIdentityRequestV0 startAtIdentifierInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo|null|undefined} startAtIdentifierInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.startAtIdentifierInfo = null; + + /** + * GetContestedResourceVotersForIdentityRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.count = 0; + + /** + * GetContestedResourceVotersForIdentityRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourceVotersForIdentityRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceVotersForIdentityRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 instance + */ + GetContestedResourceVotersForIdentityRequestV0.create = function create(properties) { + return new GetContestedResourceVotersForIdentityRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexName); + if (message.indexValues != null && message.indexValues.length) + for (var i = 0; i < message.indexValues.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.indexValues[i]); + if (message.contestantId != null && Object.hasOwnProperty.call(message, "contestantId")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.contestantId); + if (message.startAtIdentifierInfo != null && Object.hasOwnProperty.call(message, "startAtIdentifierInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.encode(message.startAtIdentifierInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.count); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.orderAscending); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.IGetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + message.indexName = reader.string(); + break; + case 4: + if (!(message.indexValues && message.indexValues.length)) + message.indexValues = []; + message.indexValues.push(reader.bytes()); + break; + case 5: + message.contestantId = reader.bytes(); + break; + case 6: + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.decode(reader, reader.uint32()); + break; + case 7: + message.count = reader.uint32(); + break; + case 8: + message.orderAscending = reader.bool(); + break; + case 9: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + if (message.indexValues != null && message.hasOwnProperty("indexValues")) { + if (!Array.isArray(message.indexValues)) + return "indexValues: array expected"; + for (var i = 0; i < message.indexValues.length; ++i) + if (!(message.indexValues[i] && typeof message.indexValues[i].length === "number" || $util.isString(message.indexValues[i]))) + return "indexValues: buffer[] expected"; + } + if (message.contestantId != null && message.hasOwnProperty("contestantId")) + if (!(message.contestantId && typeof message.contestantId.length === "number" || $util.isString(message.contestantId))) + return "contestantId: buffer expected"; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify(message.startAtIdentifierInfo); + if (error) + return "startAtIdentifierInfo." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} GetContestedResourceVotersForIdentityRequestV0 + */ + GetContestedResourceVotersForIdentityRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.indexName != null) + message.indexName = String(object.indexName); + if (object.indexValues) { + if (!Array.isArray(object.indexValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.indexValues: array expected"); + message.indexValues = []; + for (var i = 0; i < object.indexValues.length; ++i) + if (typeof object.indexValues[i] === "string") + $util.base64.decode(object.indexValues[i], message.indexValues[i] = $util.newBuffer($util.base64.length(object.indexValues[i])), 0); + else if (object.indexValues[i].length >= 0) + message.indexValues[i] = object.indexValues[i]; + } + if (object.contestantId != null) + if (typeof object.contestantId === "string") + $util.base64.decode(object.contestantId, message.contestantId = $util.newBuffer($util.base64.length(object.contestantId)), 0); + else if (object.contestantId.length >= 0) + message.contestantId = object.contestantId; + if (object.startAtIdentifierInfo != null) { + if (typeof object.startAtIdentifierInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.startAtIdentifierInfo: object expected"); + message.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.fromObject(object.startAtIdentifierInfo); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0} message GetContestedResourceVotersForIdentityRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.indexName = ""; + if (options.bytes === String) + object.contestantId = ""; + else { + object.contestantId = []; + if (options.bytes !== Array) + object.contestantId = $util.newBuffer(object.contestantId); + } + object.startAtIdentifierInfo = null; + object.count = 0; + object.orderAscending = false; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; + if (message.indexValues && message.indexValues.length) { + object.indexValues = []; + for (var j = 0; j < message.indexValues.length; ++j) + object.indexValues[j] = options.bytes === String ? $util.base64.encode(message.indexValues[j], 0, message.indexValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.indexValues[j]) : message.indexValues[j]; + } + if (message.contestantId != null && message.hasOwnProperty("contestantId")) + object.contestantId = options.bytes === String ? $util.base64.encode(message.contestantId, 0, message.contestantId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contestantId) : message.contestantId; + if (message.startAtIdentifierInfo != null && message.hasOwnProperty("startAtIdentifierInfo")) + object.startAtIdentifierInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.toObject(message.startAtIdentifierInfo, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo = (function() { + + /** + * Properties of a StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @interface IStartAtIdentifierInfo + * @property {Uint8Array|null} [startIdentifier] StartAtIdentifierInfo startIdentifier + * @property {boolean|null} [startIdentifierIncluded] StartAtIdentifierInfo startIdentifierIncluded + */ + + /** + * Constructs a new StartAtIdentifierInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0 + * @classdesc Represents a StartAtIdentifierInfo. + * @implements IStartAtIdentifierInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + */ + function StartAtIdentifierInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtIdentifierInfo startIdentifier. + * @member {Uint8Array} startIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifier = $util.newBuffer([]); + + /** + * StartAtIdentifierInfo startIdentifierIncluded. + * @member {boolean} startIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + */ + StartAtIdentifierInfo.prototype.startIdentifierIncluded = false; + + /** + * Creates a new StartAtIdentifierInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo instance + */ + StartAtIdentifierInfo.create = function create(properties) { + return new StartAtIdentifierInfo(properties); + }; + + /** + * Encodes the specified StartAtIdentifierInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIdentifier != null && Object.hasOwnProperty.call(message, "startIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startIdentifier); + if (message.startIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtIdentifierInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.IStartAtIdentifierInfo} message StartAtIdentifierInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtIdentifierInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startIdentifier = reader.bytes(); + break; + case 2: + message.startIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtIdentifierInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtIdentifierInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtIdentifierInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtIdentifierInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + if (!(message.startIdentifier && typeof message.startIdentifier.length === "number" || $util.isString(message.startIdentifier))) + return "startIdentifier: buffer expected"; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + if (typeof message.startIdentifierIncluded !== "boolean") + return "startIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtIdentifierInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} StartAtIdentifierInfo + */ + StartAtIdentifierInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo(); + if (object.startIdentifier != null) + if (typeof object.startIdentifier === "string") + $util.base64.decode(object.startIdentifier, message.startIdentifier = $util.newBuffer($util.base64.length(object.startIdentifier)), 0); + else if (object.startIdentifier.length >= 0) + message.startIdentifier = object.startIdentifier; + if (object.startIdentifierIncluded != null) + message.startIdentifierIncluded = Boolean(object.startIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtIdentifierInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo} message StartAtIdentifierInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtIdentifierInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startIdentifier = ""; + else { + object.startIdentifier = []; + if (options.bytes !== Array) + object.startIdentifier = $util.newBuffer(object.startIdentifier); + } + object.startIdentifierIncluded = false; + } + if (message.startIdentifier != null && message.hasOwnProperty("startIdentifier")) + object.startIdentifier = options.bytes === String ? $util.base64.encode(message.startIdentifier, 0, message.startIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startIdentifier) : message.startIdentifier; + if (message.startIdentifierIncluded != null && message.hasOwnProperty("startIdentifierIncluded")) + object.startIdentifierIncluded = message.startIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtIdentifierInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityRequest.GetContestedResourceVotersForIdentityRequestV0.StartAtIdentifierInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtIdentifierInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtIdentifierInfo; + })(); + + return GetContestedResourceVotersForIdentityRequestV0; + })(); + + return GetContestedResourceVotersForIdentityRequest; + })(); + + v0.GetContestedResourceVotersForIdentityResponse = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceVotersForIdentityResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null} [v0] GetContestedResourceVotersForIdentityResponse v0 + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceVotersForIdentityResponse. + * @implements IGetContestedResourceVotersForIdentityResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVotersForIdentityResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + */ + GetContestedResourceVotersForIdentityResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse instance + */ + GetContestedResourceVotersForIdentityResponse.create = function create(properties) { + return new GetContestedResourceVotersForIdentityResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} GetContestedResourceVotersForIdentityResponse + */ + GetContestedResourceVotersForIdentityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse} message GetContestedResourceVotersForIdentityResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceVotersForIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @interface IGetContestedResourceVotersForIdentityResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null} [contestedResourceVoters] GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceVotersForIdentityResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceVotersForIdentityResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceVotersForIdentityResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse + * @classdesc Represents a GetContestedResourceVotersForIdentityResponseV0. + * @implements IGetContestedResourceVotersForIdentityResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set + */ + function GetContestedResourceVotersForIdentityResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceVotersForIdentityResponseV0 contestedResourceVoters. + * @member {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters|null|undefined} contestedResourceVoters + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.contestedResourceVoters = null; + + /** + * GetContestedResourceVotersForIdentityResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.proof = null; + + /** + * GetContestedResourceVotersForIdentityResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceVotersForIdentityResponseV0 result. + * @member {"contestedResourceVoters"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceVotersForIdentityResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["contestedResourceVoters", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceVotersForIdentityResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 instance + */ + GetContestedResourceVotersForIdentityResponseV0.create = function create(properties) { + return new GetContestedResourceVotersForIdentityResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceVoters != null && Object.hasOwnProperty.call(message, "contestedResourceVoters")) + $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.encode(message.contestedResourceVoters, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceVotersForIdentityResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.IGetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceVotersForIdentityResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceVotersForIdentityResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceVotersForIdentityResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceVotersForIdentityResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceVotersForIdentityResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify(message.contestedResourceVoters); + if (error) + return "contestedResourceVoters." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceVotersForIdentityResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} GetContestedResourceVotersForIdentityResponseV0 + */ + GetContestedResourceVotersForIdentityResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0(); + if (object.contestedResourceVoters != null) { + if (typeof object.contestedResourceVoters !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.contestedResourceVoters: object expected"); + message.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.fromObject(object.contestedResourceVoters); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceVotersForIdentityResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0} message GetContestedResourceVotersForIdentityResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceVotersForIdentityResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.contestedResourceVoters != null && message.hasOwnProperty("contestedResourceVoters")) { + object.contestedResourceVoters = $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.toObject(message.contestedResourceVoters, options); + if (options.oneofs) + object.result = "contestedResourceVoters"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceVotersForIdentityResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceVotersForIdentityResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters = (function() { + + /** + * Properties of a ContestedResourceVoters. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @interface IContestedResourceVoters + * @property {Array.|null} [voters] ContestedResourceVoters voters + * @property {boolean|null} [finishedResults] ContestedResourceVoters finishedResults + */ + + /** + * Constructs a new ContestedResourceVoters. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0 + * @classdesc Represents a ContestedResourceVoters. + * @implements IContestedResourceVoters + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set + */ + function ContestedResourceVoters(properties) { + this.voters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceVoters voters. + * @member {Array.} voters + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + */ + ContestedResourceVoters.prototype.voters = $util.emptyArray; + + /** + * ContestedResourceVoters finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + */ + ContestedResourceVoters.prototype.finishedResults = false; + + /** + * Creates a new ContestedResourceVoters instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters instance + */ + ContestedResourceVoters.create = function create(properties) { + return new ContestedResourceVoters(properties); + }; + + /** + * Encodes the specified ContestedResourceVoters message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceVoters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voters != null && message.voters.length) + for (var i = 0; i < message.voters.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.voters[i]); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified ContestedResourceVoters message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.IContestedResourceVoters} message ContestedResourceVoters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceVoters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceVoters message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceVoters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.voters && message.voters.length)) + message.voters = []; + message.voters.push(reader.bytes()); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceVoters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceVoters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceVoters message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceVoters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voters != null && message.hasOwnProperty("voters")) { + if (!Array.isArray(message.voters)) + return "voters: array expected"; + for (var i = 0; i < message.voters.length; ++i) + if (!(message.voters[i] && typeof message.voters[i].length === "number" || $util.isString(message.voters[i]))) + return "voters: buffer[] expected"; + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a ContestedResourceVoters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} ContestedResourceVoters + */ + ContestedResourceVoters.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters(); + if (object.voters) { + if (!Array.isArray(object.voters)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters.voters: array expected"); + message.voters = []; + for (var i = 0; i < object.voters.length; ++i) + if (typeof object.voters[i] === "string") + $util.base64.decode(object.voters[i], message.voters[i] = $util.newBuffer($util.base64.length(object.voters[i])), 0); + else if (object.voters[i].length >= 0) + message.voters[i] = object.voters[i]; + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a ContestedResourceVoters message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters} message ContestedResourceVoters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceVoters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.voters = []; + if (options.defaults) + object.finishedResults = false; + if (message.voters && message.voters.length) { + object.voters = []; + for (var j = 0; j < message.voters.length; ++j) + object.voters[j] = options.bytes === String ? $util.base64.encode(message.voters[j], 0, message.voters[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.voters[j]) : message.voters[j]; + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this ContestedResourceVoters to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceVotersForIdentityResponse.GetContestedResourceVotersForIdentityResponseV0.ContestedResourceVoters + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceVoters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceVoters; + })(); + + return GetContestedResourceVotersForIdentityResponseV0; + })(); + + return GetContestedResourceVotersForIdentityResponse; + })(); + + v0.GetContestedResourceIdentityVotesRequest = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceIdentityVotesRequest + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null} [v0] GetContestedResourceIdentityVotesRequest v0 + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceIdentityVotesRequest. + * @implements IGetContestedResourceIdentityVotesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceIdentityVotesRequest v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + */ + GetContestedResourceIdentityVotesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest instance + */ + GetContestedResourceIdentityVotesRequest.create = function create(properties) { + return new GetContestedResourceIdentityVotesRequest(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} GetContestedResourceIdentityVotesRequest + */ + GetContestedResourceIdentityVotesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest} message GetContestedResourceIdentityVotesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @interface IGetContestedResourceIdentityVotesRequestV0 + * @property {Uint8Array|null} [identityId] GetContestedResourceIdentityVotesRequestV0 identityId + * @property {google.protobuf.IUInt32Value|null} [limit] GetContestedResourceIdentityVotesRequestV0 limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetContestedResourceIdentityVotesRequestV0 offset + * @property {boolean|null} [orderAscending] GetContestedResourceIdentityVotesRequestV0 orderAscending + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null} [startAtVotePollIdInfo] GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo + * @property {boolean|null} [prove] GetContestedResourceIdentityVotesRequestV0 prove + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest + * @classdesc Represents a GetContestedResourceIdentityVotesRequestV0. + * @implements IGetContestedResourceIdentityVotesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceIdentityVotesRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetContestedResourceIdentityVotesRequestV0 limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.limit = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.offset = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 orderAscending. + * @member {boolean} orderAscending + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.orderAscending = false; + + /** + * GetContestedResourceIdentityVotesRequestV0 startAtVotePollIdInfo. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo|null|undefined} startAtVotePollIdInfo + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.startAtVotePollIdInfo = null; + + /** + * GetContestedResourceIdentityVotesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + */ + GetContestedResourceIdentityVotesRequestV0.prototype.prove = false; + + /** + * Creates a new GetContestedResourceIdentityVotesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 instance + */ + GetContestedResourceIdentityVotesRequestV0.create = function create(properties) { + return new GetContestedResourceIdentityVotesRequestV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.orderAscending != null && Object.hasOwnProperty.call(message, "orderAscending")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.orderAscending); + if (message.startAtVotePollIdInfo != null && Object.hasOwnProperty.call(message, "startAtVotePollIdInfo")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.encode(message.startAtVotePollIdInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.IGetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 3: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.orderAscending = reader.bool(); + break; + case 5: + message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.decode(reader, reader.uint32()); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + if (typeof message.orderAscending !== "boolean") + return "orderAscending: boolean expected"; + if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify(message.startAtVotePollIdInfo); + if (error) + return "startAtVotePollIdInfo." + error; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} GetContestedResourceIdentityVotesRequestV0 + */ + GetContestedResourceIdentityVotesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.orderAscending != null) + message.orderAscending = Boolean(object.orderAscending); + if (object.startAtVotePollIdInfo != null) { + if (typeof object.startAtVotePollIdInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.startAtVotePollIdInfo: object expected"); + message.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.fromObject(object.startAtVotePollIdInfo); + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0} message GetContestedResourceIdentityVotesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.limit = null; + object.offset = null; + object.orderAscending = false; + object.startAtVotePollIdInfo = null; + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.orderAscending != null && message.hasOwnProperty("orderAscending")) + object.orderAscending = message.orderAscending; + if (message.startAtVotePollIdInfo != null && message.hasOwnProperty("startAtVotePollIdInfo")) + object.startAtVotePollIdInfo = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.toObject(message.startAtVotePollIdInfo, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo = (function() { + + /** + * Properties of a StartAtVotePollIdInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @interface IStartAtVotePollIdInfo + * @property {Uint8Array|null} [startAtPollIdentifier] StartAtVotePollIdInfo startAtPollIdentifier + * @property {boolean|null} [startPollIdentifierIncluded] StartAtVotePollIdInfo startPollIdentifierIncluded + */ + + /** + * Constructs a new StartAtVotePollIdInfo. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0 + * @classdesc Represents a StartAtVotePollIdInfo. + * @implements IStartAtVotePollIdInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set + */ + function StartAtVotePollIdInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtVotePollIdInfo startAtPollIdentifier. + * @member {Uint8Array} startAtPollIdentifier + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + */ + StartAtVotePollIdInfo.prototype.startAtPollIdentifier = $util.newBuffer([]); + + /** + * StartAtVotePollIdInfo startPollIdentifierIncluded. + * @member {boolean} startPollIdentifierIncluded + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + */ + StartAtVotePollIdInfo.prototype.startPollIdentifierIncluded = false; + + /** + * Creates a new StartAtVotePollIdInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo instance + */ + StartAtVotePollIdInfo.create = function create(properties) { + return new StartAtVotePollIdInfo(properties); + }; + + /** + * Encodes the specified StartAtVotePollIdInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtVotePollIdInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startAtPollIdentifier != null && Object.hasOwnProperty.call(message, "startAtPollIdentifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startAtPollIdentifier); + if (message.startPollIdentifierIncluded != null && Object.hasOwnProperty.call(message, "startPollIdentifierIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startPollIdentifierIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtVotePollIdInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.IStartAtVotePollIdInfo} message StartAtVotePollIdInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtVotePollIdInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtVotePollIdInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startAtPollIdentifier = reader.bytes(); + break; + case 2: + message.startPollIdentifierIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtVotePollIdInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtVotePollIdInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtVotePollIdInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtVotePollIdInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) + if (!(message.startAtPollIdentifier && typeof message.startAtPollIdentifier.length === "number" || $util.isString(message.startAtPollIdentifier))) + return "startAtPollIdentifier: buffer expected"; + if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) + if (typeof message.startPollIdentifierIncluded !== "boolean") + return "startPollIdentifierIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtVotePollIdInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} StartAtVotePollIdInfo + */ + StartAtVotePollIdInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo(); + if (object.startAtPollIdentifier != null) + if (typeof object.startAtPollIdentifier === "string") + $util.base64.decode(object.startAtPollIdentifier, message.startAtPollIdentifier = $util.newBuffer($util.base64.length(object.startAtPollIdentifier)), 0); + else if (object.startAtPollIdentifier.length >= 0) + message.startAtPollIdentifier = object.startAtPollIdentifier; + if (object.startPollIdentifierIncluded != null) + message.startPollIdentifierIncluded = Boolean(object.startPollIdentifierIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtVotePollIdInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo} message StartAtVotePollIdInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtVotePollIdInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startAtPollIdentifier = ""; + else { + object.startAtPollIdentifier = []; + if (options.bytes !== Array) + object.startAtPollIdentifier = $util.newBuffer(object.startAtPollIdentifier); + } + object.startPollIdentifierIncluded = false; + } + if (message.startAtPollIdentifier != null && message.hasOwnProperty("startAtPollIdentifier")) + object.startAtPollIdentifier = options.bytes === String ? $util.base64.encode(message.startAtPollIdentifier, 0, message.startAtPollIdentifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAtPollIdentifier) : message.startAtPollIdentifier; + if (message.startPollIdentifierIncluded != null && message.hasOwnProperty("startPollIdentifierIncluded")) + object.startPollIdentifierIncluded = message.startPollIdentifierIncluded; + return object; + }; + + /** + * Converts this StartAtVotePollIdInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesRequest.GetContestedResourceIdentityVotesRequestV0.StartAtVotePollIdInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtVotePollIdInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtVotePollIdInfo; + })(); + + return GetContestedResourceIdentityVotesRequestV0; + })(); + + return GetContestedResourceIdentityVotesRequest; + })(); + + v0.GetContestedResourceIdentityVotesResponse = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetContestedResourceIdentityVotesResponse + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null} [v0] GetContestedResourceIdentityVotesResponse v0 + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetContestedResourceIdentityVotesResponse. + * @implements IGetContestedResourceIdentityVotesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceIdentityVotesResponse v0. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + */ + GetContestedResourceIdentityVotesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse instance + */ + GetContestedResourceIdentityVotesResponse.create = function create(properties) { + return new GetContestedResourceIdentityVotesResponse(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} GetContestedResourceIdentityVotesResponse + */ + GetContestedResourceIdentityVotesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse} message GetContestedResourceIdentityVotesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 = (function() { + + /** + * Properties of a GetContestedResourceIdentityVotesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @interface IGetContestedResourceIdentityVotesResponseV0 + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null} [votes] GetContestedResourceIdentityVotesResponseV0 votes + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetContestedResourceIdentityVotesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetContestedResourceIdentityVotesResponseV0 metadata + */ + + /** + * Constructs a new GetContestedResourceIdentityVotesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse + * @classdesc Represents a GetContestedResourceIdentityVotesResponseV0. + * @implements IGetContestedResourceIdentityVotesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set + */ + function GetContestedResourceIdentityVotesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContestedResourceIdentityVotesResponseV0 votes. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes|null|undefined} votes + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.votes = null; + + /** + * GetContestedResourceIdentityVotesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.proof = null; + + /** + * GetContestedResourceIdentityVotesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + GetContestedResourceIdentityVotesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetContestedResourceIdentityVotesResponseV0 result. + * @member {"votes"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + */ + Object.defineProperty(GetContestedResourceIdentityVotesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["votes", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetContestedResourceIdentityVotesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 instance + */ + GetContestedResourceIdentityVotesResponseV0.create = function create(properties) { + return new GetContestedResourceIdentityVotesResponseV0(properties); + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.votes != null && Object.hasOwnProperty.call(message, "votes")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.encode(message.votes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetContestedResourceIdentityVotesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.IGetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContestedResourceIdentityVotesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContestedResourceIdentityVotesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContestedResourceIdentityVotesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContestedResourceIdentityVotesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContestedResourceIdentityVotesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.votes != null && message.hasOwnProperty("votes")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify(message.votes); + if (error) + return "votes." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetContestedResourceIdentityVotesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} GetContestedResourceIdentityVotesResponseV0 + */ + GetContestedResourceIdentityVotesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0(); + if (object.votes != null) { + if (typeof object.votes !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.votes: object expected"); + message.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.fromObject(object.votes); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetContestedResourceIdentityVotesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0} message GetContestedResourceIdentityVotesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContestedResourceIdentityVotesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.votes != null && message.hasOwnProperty("votes")) { + object.votes = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.toObject(message.votes, options); + if (options.oneofs) + object.result = "votes"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetContestedResourceIdentityVotesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetContestedResourceIdentityVotesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes = (function() { + + /** + * Properties of a ContestedResourceIdentityVotes. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IContestedResourceIdentityVotes + * @property {Array.|null} [contestedResourceIdentityVotes] ContestedResourceIdentityVotes contestedResourceIdentityVotes + * @property {boolean|null} [finishedResults] ContestedResourceIdentityVotes finishedResults + */ + + /** + * Constructs a new ContestedResourceIdentityVotes. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ContestedResourceIdentityVotes. + * @implements IContestedResourceIdentityVotes + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set + */ + function ContestedResourceIdentityVotes(properties) { + this.contestedResourceIdentityVotes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceIdentityVotes contestedResourceIdentityVotes. + * @member {Array.} contestedResourceIdentityVotes + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + */ + ContestedResourceIdentityVotes.prototype.contestedResourceIdentityVotes = $util.emptyArray; + + /** + * ContestedResourceIdentityVotes finishedResults. + * @member {boolean} finishedResults + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + */ + ContestedResourceIdentityVotes.prototype.finishedResults = false; + + /** + * Creates a new ContestedResourceIdentityVotes instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes instance + */ + ContestedResourceIdentityVotes.create = function create(properties) { + return new ContestedResourceIdentityVotes(properties); + }; + + /** + * Encodes the specified ContestedResourceIdentityVotes message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVotes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contestedResourceIdentityVotes != null && message.contestedResourceIdentityVotes.length) + for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.encode(message.contestedResourceIdentityVotes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishedResults != null && Object.hasOwnProperty.call(message, "finishedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.finishedResults); + return writer; + }; + + /** + * Encodes the specified ContestedResourceIdentityVotes message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVotes} message ContestedResourceIdentityVotes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVotes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVotes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length)) + message.contestedResourceIdentityVotes = []; + message.contestedResourceIdentityVotes.push($root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.decode(reader, reader.uint32())); + break; + case 2: + message.finishedResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceIdentityVotes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVotes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceIdentityVotes message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceIdentityVotes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contestedResourceIdentityVotes != null && message.hasOwnProperty("contestedResourceIdentityVotes")) { + if (!Array.isArray(message.contestedResourceIdentityVotes)) + return "contestedResourceIdentityVotes: array expected"; + for (var i = 0; i < message.contestedResourceIdentityVotes.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify(message.contestedResourceIdentityVotes[i]); + if (error) + return "contestedResourceIdentityVotes." + error; + } + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + if (typeof message.finishedResults !== "boolean") + return "finishedResults: boolean expected"; + return null; + }; + + /** + * Creates a ContestedResourceIdentityVotes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} ContestedResourceIdentityVotes + */ + ContestedResourceIdentityVotes.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes(); + if (object.contestedResourceIdentityVotes) { + if (!Array.isArray(object.contestedResourceIdentityVotes)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: array expected"); + message.contestedResourceIdentityVotes = []; + for (var i = 0; i < object.contestedResourceIdentityVotes.length; ++i) { + if (typeof object.contestedResourceIdentityVotes[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes.contestedResourceIdentityVotes: object expected"); + message.contestedResourceIdentityVotes[i] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.fromObject(object.contestedResourceIdentityVotes[i]); + } + } + if (object.finishedResults != null) + message.finishedResults = Boolean(object.finishedResults); + return message; + }; + + /** + * Creates a plain object from a ContestedResourceIdentityVotes message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes} message ContestedResourceIdentityVotes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceIdentityVotes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contestedResourceIdentityVotes = []; + if (options.defaults) + object.finishedResults = false; + if (message.contestedResourceIdentityVotes && message.contestedResourceIdentityVotes.length) { + object.contestedResourceIdentityVotes = []; + for (var j = 0; j < message.contestedResourceIdentityVotes.length; ++j) + object.contestedResourceIdentityVotes[j] = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.toObject(message.contestedResourceIdentityVotes[j], options); + } + if (message.finishedResults != null && message.hasOwnProperty("finishedResults")) + object.finishedResults = message.finishedResults; + return object; + }; + + /** + * Converts this ContestedResourceIdentityVotes to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVotes + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceIdentityVotes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceIdentityVotes; + })(); + + GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice = (function() { + + /** + * Properties of a ResourceVoteChoice. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IResourceVoteChoice + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType|null} [voteChoiceType] ResourceVoteChoice voteChoiceType + * @property {Uint8Array|null} [identityId] ResourceVoteChoice identityId + */ + + /** + * Constructs a new ResourceVoteChoice. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ResourceVoteChoice. + * @implements IResourceVoteChoice + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set + */ + function ResourceVoteChoice(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceVoteChoice voteChoiceType. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType} voteChoiceType + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + */ + ResourceVoteChoice.prototype.voteChoiceType = 0; + + /** + * ResourceVoteChoice identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + */ + ResourceVoteChoice.prototype.identityId = $util.newBuffer([]); + + /** + * Creates a new ResourceVoteChoice instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice instance + */ + ResourceVoteChoice.create = function create(properties) { + return new ResourceVoteChoice(properties); + }; + + /** + * Encodes the specified ResourceVoteChoice message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceVoteChoice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voteChoiceType != null && Object.hasOwnProperty.call(message, "voteChoiceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.voteChoiceType); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityId); + return writer; + }; + + /** + * Encodes the specified ResourceVoteChoice message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice} message ResourceVoteChoice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceVoteChoice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceVoteChoice message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceVoteChoice.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteChoiceType = reader.int32(); + break; + case 2: + message.identityId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceVoteChoice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceVoteChoice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceVoteChoice message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceVoteChoice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) + switch (message.voteChoiceType) { + default: + return "voteChoiceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + return null; + }; + + /** + * Creates a ResourceVoteChoice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} ResourceVoteChoice + */ + ResourceVoteChoice.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice(); + switch (object.voteChoiceType) { + case "TOWARDS_IDENTITY": + case 0: + message.voteChoiceType = 0; + break; + case "ABSTAIN": + case 1: + message.voteChoiceType = 1; + break; + case "LOCK": + case 2: + message.voteChoiceType = 2; + break; + } + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + return message; + }; + + /** + * Creates a plain object from a ResourceVoteChoice message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice} message ResourceVoteChoice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceVoteChoice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.voteChoiceType = options.enums === String ? "TOWARDS_IDENTITY" : 0; + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + } + if (message.voteChoiceType != null && message.hasOwnProperty("voteChoiceType")) + object.voteChoiceType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType[message.voteChoiceType] : message.voteChoiceType; + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + return object; + }; + + /** + * Converts this ResourceVoteChoice to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice + * @instance + * @returns {Object.} JSON object + */ + ResourceVoteChoice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * VoteChoiceType enum. + * @name org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.VoteChoiceType + * @enum {number} + * @property {number} TOWARDS_IDENTITY=0 TOWARDS_IDENTITY value + * @property {number} ABSTAIN=1 ABSTAIN value + * @property {number} LOCK=2 LOCK value + */ + ResourceVoteChoice.VoteChoiceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOWARDS_IDENTITY"] = 0; + values[valuesById[1] = "ABSTAIN"] = 1; + values[valuesById[2] = "LOCK"] = 2; + return values; + })(); + + return ResourceVoteChoice; + })(); + + GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote = (function() { + + /** + * Properties of a ContestedResourceIdentityVote. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @interface IContestedResourceIdentityVote + * @property {Uint8Array|null} [contractId] ContestedResourceIdentityVote contractId + * @property {string|null} [documentTypeName] ContestedResourceIdentityVote documentTypeName + * @property {Array.|null} [serializedIndexStorageValues] ContestedResourceIdentityVote serializedIndexStorageValues + * @property {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null} [voteChoice] ContestedResourceIdentityVote voteChoice + */ + + /** + * Constructs a new ContestedResourceIdentityVote. + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0 + * @classdesc Represents a ContestedResourceIdentityVote. + * @implements IContestedResourceIdentityVote + * @constructor + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set + */ + function ContestedResourceIdentityVote(properties) { + this.serializedIndexStorageValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContestedResourceIdentityVote contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.contractId = $util.newBuffer([]); + + /** + * ContestedResourceIdentityVote documentTypeName. + * @member {string} documentTypeName + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.documentTypeName = ""; + + /** + * ContestedResourceIdentityVote serializedIndexStorageValues. + * @member {Array.} serializedIndexStorageValues + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.serializedIndexStorageValues = $util.emptyArray; + + /** + * ContestedResourceIdentityVote voteChoice. + * @member {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IResourceVoteChoice|null|undefined} voteChoice + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + */ + ContestedResourceIdentityVote.prototype.voteChoice = null; + + /** + * Creates a new ContestedResourceIdentityVote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote instance + */ + ContestedResourceIdentityVote.create = function create(properties) { + return new ContestedResourceIdentityVote(properties); + }; + + /** + * Encodes the specified ContestedResourceIdentityVote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.documentTypeName != null && Object.hasOwnProperty.call(message, "documentTypeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentTypeName); + if (message.serializedIndexStorageValues != null && message.serializedIndexStorageValues.length) + for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.serializedIndexStorageValues[i]); + if (message.voteChoice != null && Object.hasOwnProperty.call(message, "voteChoice")) + $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.encode(message.voteChoice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContestedResourceIdentityVote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.IContestedResourceIdentityVote} message ContestedResourceIdentityVote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContestedResourceIdentityVote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.documentTypeName = reader.string(); + break; + case 3: + if (!(message.serializedIndexStorageValues && message.serializedIndexStorageValues.length)) + message.serializedIndexStorageValues = []; + message.serializedIndexStorageValues.push(reader.bytes()); + break; + case 4: + message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContestedResourceIdentityVote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContestedResourceIdentityVote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContestedResourceIdentityVote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContestedResourceIdentityVote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + if (!$util.isString(message.documentTypeName)) + return "documentTypeName: string expected"; + if (message.serializedIndexStorageValues != null && message.hasOwnProperty("serializedIndexStorageValues")) { + if (!Array.isArray(message.serializedIndexStorageValues)) + return "serializedIndexStorageValues: array expected"; + for (var i = 0; i < message.serializedIndexStorageValues.length; ++i) + if (!(message.serializedIndexStorageValues[i] && typeof message.serializedIndexStorageValues[i].length === "number" || $util.isString(message.serializedIndexStorageValues[i]))) + return "serializedIndexStorageValues: buffer[] expected"; + } + if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) { + var error = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.verify(message.voteChoice); + if (error) + return "voteChoice." + error; + } + return null; + }; + + /** + * Creates a ContestedResourceIdentityVote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} ContestedResourceIdentityVote + */ + ContestedResourceIdentityVote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.documentTypeName != null) + message.documentTypeName = String(object.documentTypeName); + if (object.serializedIndexStorageValues) { + if (!Array.isArray(object.serializedIndexStorageValues)) + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.serializedIndexStorageValues: array expected"); + message.serializedIndexStorageValues = []; + for (var i = 0; i < object.serializedIndexStorageValues.length; ++i) + if (typeof object.serializedIndexStorageValues[i] === "string") + $util.base64.decode(object.serializedIndexStorageValues[i], message.serializedIndexStorageValues[i] = $util.newBuffer($util.base64.length(object.serializedIndexStorageValues[i])), 0); + else if (object.serializedIndexStorageValues[i].length >= 0) + message.serializedIndexStorageValues[i] = object.serializedIndexStorageValues[i]; + } + if (object.voteChoice != null) { + if (typeof object.voteChoice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote.voteChoice: object expected"); + message.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.fromObject(object.voteChoice); + } + return message; + }; + + /** + * Creates a plain object from a ContestedResourceIdentityVote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @static + * @param {org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote} message ContestedResourceIdentityVote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContestedResourceIdentityVote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serializedIndexStorageValues = []; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.documentTypeName = ""; + object.voteChoice = null; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.documentTypeName != null && message.hasOwnProperty("documentTypeName")) + object.documentTypeName = message.documentTypeName; + if (message.serializedIndexStorageValues && message.serializedIndexStorageValues.length) { + object.serializedIndexStorageValues = []; + for (var j = 0; j < message.serializedIndexStorageValues.length; ++j) + object.serializedIndexStorageValues[j] = options.bytes === String ? $util.base64.encode(message.serializedIndexStorageValues[j], 0, message.serializedIndexStorageValues[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedIndexStorageValues[j]) : message.serializedIndexStorageValues[j]; + } + if (message.voteChoice != null && message.hasOwnProperty("voteChoice")) + object.voteChoice = $root.org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ResourceVoteChoice.toObject(message.voteChoice, options); + return object; + }; + + /** + * Converts this ContestedResourceIdentityVote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetContestedResourceIdentityVotesResponse.GetContestedResourceIdentityVotesResponseV0.ContestedResourceIdentityVote + * @instance + * @returns {Object.} JSON object + */ + ContestedResourceIdentityVote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContestedResourceIdentityVote; + })(); + + return GetContestedResourceIdentityVotesResponseV0; + })(); + + return GetContestedResourceIdentityVotesResponse; + })(); + + v0.GetPrefundedSpecializedBalanceRequest = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPrefundedSpecializedBalanceRequest + * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null} [v0] GetPrefundedSpecializedBalanceRequest v0 + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPrefundedSpecializedBalanceRequest. + * @implements IGetPrefundedSpecializedBalanceRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrefundedSpecializedBalanceRequest v0. + * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + */ + GetPrefundedSpecializedBalanceRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest instance + */ + GetPrefundedSpecializedBalanceRequest.create = function create(properties) { + return new GetPrefundedSpecializedBalanceRequest(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} GetPrefundedSpecializedBalanceRequest + */ + GetPrefundedSpecializedBalanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest} message GetPrefundedSpecializedBalanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @interface IGetPrefundedSpecializedBalanceRequestV0 + * @property {Uint8Array|null} [id] GetPrefundedSpecializedBalanceRequestV0 id + * @property {boolean|null} [prove] GetPrefundedSpecializedBalanceRequestV0 prove + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest + * @classdesc Represents a GetPrefundedSpecializedBalanceRequestV0. + * @implements IGetPrefundedSpecializedBalanceRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrefundedSpecializedBalanceRequestV0 id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.id = $util.newBuffer([]); + + /** + * GetPrefundedSpecializedBalanceRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.prove = false; + + /** + * Creates a new GetPrefundedSpecializedBalanceRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 instance + */ + GetPrefundedSpecializedBalanceRequestV0.create = function create(properties) { + return new GetPrefundedSpecializedBalanceRequestV0(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.IGetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} GetPrefundedSpecializedBalanceRequestV0 + */ + GetPrefundedSpecializedBalanceRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0} message GetPrefundedSpecializedBalanceRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceRequest.GetPrefundedSpecializedBalanceRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPrefundedSpecializedBalanceRequestV0; + })(); + + return GetPrefundedSpecializedBalanceRequest; + })(); + + v0.GetPrefundedSpecializedBalanceResponse = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPrefundedSpecializedBalanceResponse + * @property {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null} [v0] GetPrefundedSpecializedBalanceResponse v0 + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPrefundedSpecializedBalanceResponse. + * @implements IGetPrefundedSpecializedBalanceResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrefundedSpecializedBalanceResponse v0. + * @member {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + */ + GetPrefundedSpecializedBalanceResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse instance + */ + GetPrefundedSpecializedBalanceResponse.create = function create(properties) { + return new GetPrefundedSpecializedBalanceResponse(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} GetPrefundedSpecializedBalanceResponse + */ + GetPrefundedSpecializedBalanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse} message GetPrefundedSpecializedBalanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 = (function() { + + /** + * Properties of a GetPrefundedSpecializedBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @interface IGetPrefundedSpecializedBalanceResponseV0 + * @property {number|Long|null} [balance] GetPrefundedSpecializedBalanceResponseV0 balance + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPrefundedSpecializedBalanceResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPrefundedSpecializedBalanceResponseV0 metadata + */ + + /** + * Constructs a new GetPrefundedSpecializedBalanceResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse + * @classdesc Represents a GetPrefundedSpecializedBalanceResponseV0. + * @implements IGetPrefundedSpecializedBalanceResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set + */ + function GetPrefundedSpecializedBalanceResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrefundedSpecializedBalanceResponseV0 balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetPrefundedSpecializedBalanceResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.proof = null; + + /** + * GetPrefundedSpecializedBalanceResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPrefundedSpecializedBalanceResponseV0 result. + * @member {"balance"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + */ + Object.defineProperty(GetPrefundedSpecializedBalanceResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["balance", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPrefundedSpecializedBalanceResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 instance + */ + GetPrefundedSpecializedBalanceResponseV0.create = function create(properties) { + return new GetPrefundedSpecializedBalanceResponseV0(properties); + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.balance); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPrefundedSpecializedBalanceResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.IGetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrefundedSpecializedBalanceResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPrefundedSpecializedBalanceResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrefundedSpecializedBalanceResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrefundedSpecializedBalanceResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrefundedSpecializedBalanceResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balance != null && message.hasOwnProperty("balance")) { + properties.result = 1; + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetPrefundedSpecializedBalanceResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} GetPrefundedSpecializedBalanceResponseV0 + */ + GetPrefundedSpecializedBalanceResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0(); + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetPrefundedSpecializedBalanceResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0} message GetPrefundedSpecializedBalanceResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrefundedSpecializedBalanceResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.balance != null && message.hasOwnProperty("balance")) { + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + if (options.oneofs) + object.result = "balance"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetPrefundedSpecializedBalanceResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPrefundedSpecializedBalanceResponse.GetPrefundedSpecializedBalanceResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetPrefundedSpecializedBalanceResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPrefundedSpecializedBalanceResponseV0; + })(); + + return GetPrefundedSpecializedBalanceResponse; + })(); + + v0.GetTotalCreditsInPlatformRequest = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTotalCreditsInPlatformRequest + * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null} [v0] GetTotalCreditsInPlatformRequest v0 + */ + + /** + * Constructs a new GetTotalCreditsInPlatformRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTotalCreditsInPlatformRequest. + * @implements IGetTotalCreditsInPlatformRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTotalCreditsInPlatformRequest v0. + * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + */ + GetTotalCreditsInPlatformRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest instance + */ + GetTotalCreditsInPlatformRequest.create = function create(properties) { + return new GetTotalCreditsInPlatformRequest(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} GetTotalCreditsInPlatformRequest + */ + GetTotalCreditsInPlatformRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest} message GetTotalCreditsInPlatformRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @interface IGetTotalCreditsInPlatformRequestV0 + * @property {boolean|null} [prove] GetTotalCreditsInPlatformRequestV0 prove + */ + + /** + * Constructs a new GetTotalCreditsInPlatformRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest + * @classdesc Represents a GetTotalCreditsInPlatformRequestV0. + * @implements IGetTotalCreditsInPlatformRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTotalCreditsInPlatformRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @instance + */ + GetTotalCreditsInPlatformRequestV0.prototype.prove = false; + + /** + * Creates a new GetTotalCreditsInPlatformRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 instance + */ + GetTotalCreditsInPlatformRequestV0.create = function create(properties) { + return new GetTotalCreditsInPlatformRequestV0(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.IGetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} GetTotalCreditsInPlatformRequestV0 + */ + GetTotalCreditsInPlatformRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0} message GetTotalCreditsInPlatformRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.prove = false; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTotalCreditsInPlatformRequestV0; + })(); + + return GetTotalCreditsInPlatformRequest; + })(); + + v0.GetTotalCreditsInPlatformResponse = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTotalCreditsInPlatformResponse + * @property {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null} [v0] GetTotalCreditsInPlatformResponse v0 + */ + + /** + * Constructs a new GetTotalCreditsInPlatformResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTotalCreditsInPlatformResponse. + * @implements IGetTotalCreditsInPlatformResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTotalCreditsInPlatformResponse v0. + * @member {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + */ + GetTotalCreditsInPlatformResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse instance + */ + GetTotalCreditsInPlatformResponse.create = function create(properties) { + return new GetTotalCreditsInPlatformResponse(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} GetTotalCreditsInPlatformResponse + */ + GetTotalCreditsInPlatformResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse} message GetTotalCreditsInPlatformResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 = (function() { + + /** + * Properties of a GetTotalCreditsInPlatformResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @interface IGetTotalCreditsInPlatformResponseV0 + * @property {number|Long|null} [credits] GetTotalCreditsInPlatformResponseV0 credits + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTotalCreditsInPlatformResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTotalCreditsInPlatformResponseV0 metadata + */ + + /** + * Constructs a new GetTotalCreditsInPlatformResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse + * @classdesc Represents a GetTotalCreditsInPlatformResponseV0. + * @implements IGetTotalCreditsInPlatformResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set + */ + function GetTotalCreditsInPlatformResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTotalCreditsInPlatformResponseV0 credits. + * @member {number|Long} credits + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.credits = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetTotalCreditsInPlatformResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.proof = null; + + /** + * GetTotalCreditsInPlatformResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + GetTotalCreditsInPlatformResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTotalCreditsInPlatformResponseV0 result. + * @member {"credits"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + */ + Object.defineProperty(GetTotalCreditsInPlatformResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["credits", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTotalCreditsInPlatformResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 instance + */ + GetTotalCreditsInPlatformResponseV0.create = function create(properties) { + return new GetTotalCreditsInPlatformResponseV0(properties); + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.credits != null && Object.hasOwnProperty.call(message, "credits")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.credits); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTotalCreditsInPlatformResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.IGetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTotalCreditsInPlatformResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.credits = reader.uint64(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTotalCreditsInPlatformResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTotalCreditsInPlatformResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTotalCreditsInPlatformResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTotalCreditsInPlatformResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.credits != null && message.hasOwnProperty("credits")) { + properties.result = 1; + if (!$util.isInteger(message.credits) && !(message.credits && $util.isInteger(message.credits.low) && $util.isInteger(message.credits.high))) + return "credits: integer|Long expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTotalCreditsInPlatformResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} GetTotalCreditsInPlatformResponseV0 + */ + GetTotalCreditsInPlatformResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0(); + if (object.credits != null) + if ($util.Long) + (message.credits = $util.Long.fromValue(object.credits)).unsigned = true; + else if (typeof object.credits === "string") + message.credits = parseInt(object.credits, 10); + else if (typeof object.credits === "number") + message.credits = object.credits; + else if (typeof object.credits === "object") + message.credits = new $util.LongBits(object.credits.low >>> 0, object.credits.high >>> 0).toNumber(true); + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTotalCreditsInPlatformResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0} message GetTotalCreditsInPlatformResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTotalCreditsInPlatformResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.credits != null && message.hasOwnProperty("credits")) { + if (typeof message.credits === "number") + object.credits = options.longs === String ? String(message.credits) : message.credits; + else + object.credits = options.longs === String ? $util.Long.prototype.toString.call(message.credits) : options.longs === Number ? new $util.LongBits(message.credits.low >>> 0, message.credits.high >>> 0).toNumber(true) : message.credits; + if (options.oneofs) + object.result = "credits"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTotalCreditsInPlatformResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTotalCreditsInPlatformResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTotalCreditsInPlatformResponseV0; + })(); + + return GetTotalCreditsInPlatformResponse; + })(); + + v0.GetPathElementsRequest = (function() { + + /** + * Properties of a GetPathElementsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPathElementsRequest + * @property {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null} [v0] GetPathElementsRequest v0 + */ + + /** + * Constructs a new GetPathElementsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPathElementsRequest. + * @implements IGetPathElementsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set + */ + function GetPathElementsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPathElementsRequest v0. + * @member {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + */ + GetPathElementsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + */ + Object.defineProperty(GetPathElementsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest instance + */ + GetPathElementsRequest.create = function create(properties) { + return new GetPathElementsRequest(properties); + }; + + /** + * Encodes the specified GetPathElementsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsRequest} message GetPathElementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPathElementsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest} GetPathElementsRequest + */ + GetPathElementsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest} message GetPathElementsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPathElementsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsRequest.GetPathElementsRequestV0 = (function() { + + /** + * Properties of a GetPathElementsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @interface IGetPathElementsRequestV0 + * @property {Array.|null} [path] GetPathElementsRequestV0 path + * @property {Array.|null} [keys] GetPathElementsRequestV0 keys + * @property {boolean|null} [prove] GetPathElementsRequestV0 prove + */ + + /** + * Constructs a new GetPathElementsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest + * @classdesc Represents a GetPathElementsRequestV0. + * @implements IGetPathElementsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set + */ + function GetPathElementsRequestV0(properties) { + this.path = []; + this.keys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPathElementsRequestV0 path. + * @member {Array.} path + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.path = $util.emptyArray; + + /** + * GetPathElementsRequestV0 keys. + * @member {Array.} keys + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.keys = $util.emptyArray; + + /** + * GetPathElementsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + */ + GetPathElementsRequestV0.prototype.prove = false; + + /** + * Creates a new GetPathElementsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 instance + */ + GetPathElementsRequestV0.create = function create(properties) { + return new GetPathElementsRequestV0(properties); + }; + + /** + * Encodes the specified GetPathElementsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) + for (var i = 0; i < message.path.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path[i]); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.keys[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetPathElementsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.IGetPathElementsRequestV0} message GetPathElementsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + message.path.push(reader.bytes()); + break; + case 2: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!(message.path[i] && typeof message.path[i].length === "number" || $util.isString(message.path[i]))) + return "path: buffer[] expected"; + } + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) + if (!(message.keys[i] && typeof message.keys[i].length === "number" || $util.isString(message.keys[i]))) + return "keys: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetPathElementsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} GetPathElementsRequestV0 + */ + GetPathElementsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + if (typeof object.path[i] === "string") + $util.base64.decode(object.path[i], message.path[i] = $util.newBuffer($util.base64.length(object.path[i])), 0); + else if (object.path[i].length >= 0) + message.path[i] = object.path[i]; + } + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) + if (typeof object.keys[i] === "string") + $util.base64.decode(object.keys[i], message.keys[i] = $util.newBuffer($util.base64.length(object.keys[i])), 0); + else if (object.keys[i].length >= 0) + message.keys[i] = object.keys[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetPathElementsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0} message GetPathElementsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.keys = []; + } + if (options.defaults) + object.prove = false; + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = options.bytes === String ? $util.base64.encode(message.path[j], 0, message.path[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.path[j]) : message.path[j]; + } + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = options.bytes === String ? $util.base64.encode(message.keys[j], 0, message.keys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keys[j]) : message.keys[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetPathElementsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsRequest.GetPathElementsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPathElementsRequestV0; + })(); + + return GetPathElementsRequest; + })(); + + v0.GetPathElementsResponse = (function() { + + /** + * Properties of a GetPathElementsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetPathElementsResponse + * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null} [v0] GetPathElementsResponse v0 + */ + + /** + * Constructs a new GetPathElementsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetPathElementsResponse. + * @implements IGetPathElementsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set + */ + function GetPathElementsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPathElementsResponse v0. + * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + */ + GetPathElementsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + */ + Object.defineProperty(GetPathElementsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse instance + */ + GetPathElementsResponse.create = function create(properties) { + return new GetPathElementsResponse(properties); + }; + + /** + * Encodes the specified GetPathElementsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetPathElementsResponse} message GetPathElementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetPathElementsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse} GetPathElementsResponse + */ + GetPathElementsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse} message GetPathElementsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetPathElementsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsResponse.GetPathElementsResponseV0 = (function() { + + /** + * Properties of a GetPathElementsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @interface IGetPathElementsResponseV0 + * @property {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null} [elements] GetPathElementsResponseV0 elements + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetPathElementsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetPathElementsResponseV0 metadata + */ + + /** + * Constructs a new GetPathElementsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse + * @classdesc Represents a GetPathElementsResponseV0. + * @implements IGetPathElementsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set + */ + function GetPathElementsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPathElementsResponseV0 elements. + * @member {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements|null|undefined} elements + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.elements = null; + + /** + * GetPathElementsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.proof = null; + + /** + * GetPathElementsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + GetPathElementsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetPathElementsResponseV0 result. + * @member {"elements"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + */ + Object.defineProperty(GetPathElementsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["elements", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetPathElementsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 instance + */ + GetPathElementsResponseV0.create = function create(properties) { + return new GetPathElementsResponseV0(properties); + }; + + /** + * Encodes the specified GetPathElementsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elements != null && Object.hasOwnProperty.call(message, "elements")) + $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.encode(message.elements, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPathElementsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.IGetPathElementsResponseV0} message GetPathElementsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPathElementsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPathElementsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPathElementsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPathElementsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPathElementsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.elements != null && message.hasOwnProperty("elements")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify(message.elements); + if (error) + return "elements." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetPathElementsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} GetPathElementsResponseV0 + */ + GetPathElementsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0(); + if (object.elements != null) { + if (typeof object.elements !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.elements: object expected"); + message.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.fromObject(object.elements); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetPathElementsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0} message GetPathElementsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPathElementsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.elements != null && message.hasOwnProperty("elements")) { + object.elements = $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.toObject(message.elements, options); + if (options.oneofs) + object.result = "elements"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetPathElementsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetPathElementsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetPathElementsResponseV0.Elements = (function() { + + /** + * Properties of an Elements. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @interface IElements + * @property {Array.|null} [elements] Elements elements + */ + + /** + * Constructs a new Elements. + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0 + * @classdesc Represents an Elements. + * @implements IElements + * @constructor + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set + */ + function Elements(properties) { + this.elements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Elements elements. + * @member {Array.} elements + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @instance + */ + Elements.prototype.elements = $util.emptyArray; + + /** + * Creates a new Elements instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements instance + */ + Elements.create = function create(properties) { + return new Elements(properties); + }; + + /** + * Encodes the specified Elements message. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Elements.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elements != null && message.elements.length) + for (var i = 0; i < message.elements.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.elements[i]); + return writer; + }; + + /** + * Encodes the specified Elements message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.IElements} message Elements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Elements.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Elements message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Elements.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.elements && message.elements.length)) + message.elements = []; + message.elements.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Elements message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Elements.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Elements message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Elements.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.elements != null && message.hasOwnProperty("elements")) { + if (!Array.isArray(message.elements)) + return "elements: array expected"; + for (var i = 0; i < message.elements.length; ++i) + if (!(message.elements[i] && typeof message.elements[i].length === "number" || $util.isString(message.elements[i]))) + return "elements: buffer[] expected"; + } + return null; + }; + + /** + * Creates an Elements message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} Elements + */ + Elements.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements(); + if (object.elements) { + if (!Array.isArray(object.elements)) + throw TypeError(".org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements.elements: array expected"); + message.elements = []; + for (var i = 0; i < object.elements.length; ++i) + if (typeof object.elements[i] === "string") + $util.base64.decode(object.elements[i], message.elements[i] = $util.newBuffer($util.base64.length(object.elements[i])), 0); + else if (object.elements[i].length >= 0) + message.elements[i] = object.elements[i]; + } + return message; + }; + + /** + * Creates a plain object from an Elements message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @static + * @param {org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements} message Elements + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Elements.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.elements = []; + if (message.elements && message.elements.length) { + object.elements = []; + for (var j = 0; j < message.elements.length; ++j) + object.elements[j] = options.bytes === String ? $util.base64.encode(message.elements[j], 0, message.elements[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.elements[j]) : message.elements[j]; + } + return object; + }; + + /** + * Converts this Elements to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetPathElementsResponse.GetPathElementsResponseV0.Elements + * @instance + * @returns {Object.} JSON object + */ + Elements.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Elements; + })(); + + return GetPathElementsResponseV0; + })(); + + return GetPathElementsResponse; + })(); + + v0.GetStatusRequest = (function() { + + /** + * Properties of a GetStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetStatusRequest + * @property {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null} [v0] GetStatusRequest v0 + */ + + /** + * Constructs a new GetStatusRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetStatusRequest. + * @implements IGetStatusRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set + */ + function GetStatusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStatusRequest v0. + * @member {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + */ + GetStatusRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetStatusRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + */ + Object.defineProperty(GetStatusRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetStatusRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest instance + */ + GetStatusRequest.create = function create(properties) { + return new GetStatusRequest(properties); + }; + + /** + * Encodes the specified GetStatusRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusRequest} message GetStatusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetStatusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusRequest} GetStatusRequest + */ + GetStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest} message GetStatusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetStatusRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @instance + * @returns {Object.} JSON object + */ + GetStatusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusRequest.GetStatusRequestV0 = (function() { + + /** + * Properties of a GetStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @interface IGetStatusRequestV0 + */ + + /** + * Constructs a new GetStatusRequestV0. + * @memberof org.dash.platform.dapi.v0.GetStatusRequest + * @classdesc Represents a GetStatusRequestV0. + * @implements IGetStatusRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set + */ + function GetStatusRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetStatusRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 instance + */ + GetStatusRequestV0.create = function create(properties) { + return new GetStatusRequestV0(properties); + }; + + /** + * Encodes the specified GetStatusRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetStatusRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.IGetStatusRequestV0} message GetStatusRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetStatusRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} GetStatusRequestV0 + */ + GetStatusRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0) + return object; + return new $root.org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0(); + }; + + /** + * Creates a plain object from a GetStatusRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0} message GetStatusRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusRequestV0.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetStatusRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetStatusRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetStatusRequestV0; + })(); + + return GetStatusRequest; + })(); + + v0.GetStatusResponse = (function() { + + /** + * Properties of a GetStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetStatusResponse + * @property {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null} [v0] GetStatusResponse v0 + */ + + /** + * Constructs a new GetStatusResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetStatusResponse. + * @implements IGetStatusResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set + */ + function GetStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStatusResponse v0. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + */ + GetStatusResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetStatusResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + */ + Object.defineProperty(GetStatusResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetStatusResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse instance + */ + GetStatusResponse.create = function create(properties) { + return new GetStatusResponse(properties); + }; + + /** + * Encodes the specified GetStatusResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetStatusResponse} message GetStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse} GetStatusResponse + */ + GetStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse} message GetStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetStatusResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @instance + * @returns {Object.} JSON object + */ + GetStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusResponse.GetStatusResponseV0 = (function() { + + /** + * Properties of a GetStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @interface IGetStatusResponseV0 + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null} [version] GetStatusResponseV0 version + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null} [node] GetStatusResponseV0 node + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null} [chain] GetStatusResponseV0 chain + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null} [network] GetStatusResponseV0 network + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null} [stateSync] GetStatusResponseV0 stateSync + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null} [time] GetStatusResponseV0 time + */ + + /** + * Constructs a new GetStatusResponseV0. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse + * @classdesc Represents a GetStatusResponseV0. + * @implements IGetStatusResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set + */ + function GetStatusResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStatusResponseV0 version. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion|null|undefined} version + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.version = null; + + /** + * GetStatusResponseV0 node. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode|null|undefined} node + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.node = null; + + /** + * GetStatusResponseV0 chain. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain|null|undefined} chain + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.chain = null; + + /** + * GetStatusResponseV0 network. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork|null|undefined} network + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.network = null; + + /** + * GetStatusResponseV0 stateSync. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync|null|undefined} stateSync + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.stateSync = null; + + /** + * GetStatusResponseV0 time. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime|null|undefined} time + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + */ + GetStatusResponseV0.prototype.time = null; + + /** + * Creates a new GetStatusResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 instance + */ + GetStatusResponseV0.create = function create(properties) { + return new GetStatusResponseV0(properties); + }; + + /** + * Encodes the specified GetStatusResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.encode(message.node, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.encode(message.chain, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.encode(message.network, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.stateSync != null && Object.hasOwnProperty.call(message, "stateSync")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.encode(message.stateSync, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.encode(message.time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStatusResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.IGetStatusResponseV0} message GetStatusResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.decode(reader, reader.uint32()); + break; + case 2: + message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.decode(reader, reader.uint32()); + break; + case 3: + message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.decode(reader, reader.uint32()); + break; + case 4: + message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.decode(reader, reader.uint32()); + break; + case 5: + message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.decode(reader, reader.uint32()); + break; + case 6: + message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify(message.version); + if (error) + return "version." + error; + } + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify(message.node); + if (error) + return "node." + error; + } + if (message.chain != null && message.hasOwnProperty("chain")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify(message.chain); + if (error) + return "chain." + error; + } + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify(message.network); + if (error) + return "network." + error; + } + if (message.stateSync != null && message.hasOwnProperty("stateSync")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify(message.stateSync); + if (error) + return "stateSync." + error; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify(message.time); + if (error) + return "time." + error; + } + return null; + }; + + /** + * Creates a GetStatusResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} GetStatusResponseV0 + */ + GetStatusResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.version: object expected"); + message.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.fromObject(object.version); + } + if (object.node != null) { + if (typeof object.node !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.node: object expected"); + message.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.fromObject(object.node); + } + if (object.chain != null) { + if (typeof object.chain !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.chain: object expected"); + message.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.fromObject(object.chain); + } + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.network: object expected"); + message.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.fromObject(object.network); + } + if (object.stateSync != null) { + if (typeof object.stateSync !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.stateSync: object expected"); + message.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.fromObject(object.stateSync); + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.time: object expected"); + message.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.fromObject(object.time); + } + return message; + }; + + /** + * Creates a plain object from a GetStatusResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0} message GetStatusResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.node = null; + object.chain = null; + object.network = null; + object.stateSync = null; + object.time = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.toObject(message.version, options); + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.toObject(message.node, options); + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.toObject(message.chain, options); + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.toObject(message.network, options); + if (message.stateSync != null && message.hasOwnProperty("stateSync")) + object.stateSync = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.toObject(message.stateSync, options); + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.toObject(message.time, options); + return object; + }; + + /** + * Converts this GetStatusResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetStatusResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetStatusResponseV0.Version = (function() { + + /** + * Properties of a Version. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IVersion + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null} [software] Version software + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null} [protocol] Version protocol + */ + + /** + * Constructs a new Version. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set + */ + function Version(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version software. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware|null|undefined} software + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + */ + Version.prototype.software = null; + + /** + * Version protocol. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol|null|undefined} protocol + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + */ + Version.prototype.protocol = null; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.software != null && Object.hasOwnProperty.call(message, "software")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.encode(message.software, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.encode(message.protocol, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.decode(reader, reader.uint32()); + break; + case 2: + message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.software != null && message.hasOwnProperty("software")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify(message.software); + if (error) + return "software." + error; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify(message.protocol); + if (error) + return "protocol." + error; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version(); + if (object.software != null) { + if (typeof object.software !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.software: object expected"); + message.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.fromObject(object.software); + } + if (object.protocol != null) { + if (typeof object.protocol !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.protocol: object expected"); + message.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.fromObject(object.protocol); + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.software = null; + object.protocol = null; + } + if (message.software != null && message.hasOwnProperty("software")) + object.software = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.toObject(message.software, options); + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.toObject(message.protocol, options); + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Version.Software = (function() { + + /** + * Properties of a Software. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @interface ISoftware + * @property {string|null} [dapi] Software dapi + * @property {string|null} [drive] Software drive + * @property {string|null} [tenderdash] Software tenderdash + */ + + /** + * Constructs a new Software. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @classdesc Represents a Software. + * @implements ISoftware + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set + */ + function Software(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Software dapi. + * @member {string} dapi + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.dapi = ""; + + /** + * Software drive. + * @member {string} drive + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.drive = ""; + + /** + * Software tenderdash. + * @member {string} tenderdash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + */ + Software.prototype.tenderdash = ""; + + /** + * Creates a new Software instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software instance + */ + Software.create = function create(properties) { + return new Software(properties); + }; + + /** + * Encodes the specified Software message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Software.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dapi != null && Object.hasOwnProperty.call(message, "dapi")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dapi); + if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.drive); + if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tenderdash); + return writer; + }; + + /** + * Encodes the specified Software message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.ISoftware} message Software message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Software.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Software message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Software.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dapi = reader.string(); + break; + case 2: + message.drive = reader.string(); + break; + case 3: + message.tenderdash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Software message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Software.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Software message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Software.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dapi != null && message.hasOwnProperty("dapi")) + if (!$util.isString(message.dapi)) + return "dapi: string expected"; + if (message.drive != null && message.hasOwnProperty("drive")) + if (!$util.isString(message.drive)) + return "drive: string expected"; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + if (!$util.isString(message.tenderdash)) + return "tenderdash: string expected"; + return null; + }; + + /** + * Creates a Software message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} Software + */ + Software.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software(); + if (object.dapi != null) + message.dapi = String(object.dapi); + if (object.drive != null) + message.drive = String(object.drive); + if (object.tenderdash != null) + message.tenderdash = String(object.tenderdash); + return message; + }; + + /** + * Creates a plain object from a Software message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software} message Software + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Software.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dapi = ""; + object.drive = ""; + object.tenderdash = ""; + } + if (message.dapi != null && message.hasOwnProperty("dapi")) + object.dapi = message.dapi; + if (message.drive != null && message.hasOwnProperty("drive")) + object.drive = message.drive; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + object.tenderdash = message.tenderdash; + return object; + }; + + /** + * Converts this Software to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software + * @instance + * @returns {Object.} JSON object + */ + Software.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Software; + })(); + + Version.Protocol = (function() { + + /** + * Properties of a Protocol. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @interface IProtocol + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null} [tenderdash] Protocol tenderdash + * @property {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null} [drive] Protocol drive + */ + + /** + * Constructs a new Protocol. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version + * @classdesc Represents a Protocol. + * @implements IProtocol + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set + */ + function Protocol(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Protocol tenderdash. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash|null|undefined} tenderdash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + */ + Protocol.prototype.tenderdash = null; + + /** + * Protocol drive. + * @member {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive|null|undefined} drive + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + */ + Protocol.prototype.drive = null; + + /** + * Creates a new Protocol instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol instance + */ + Protocol.create = function create(properties) { + return new Protocol(properties); + }; + + /** + * Encodes the specified Protocol message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Protocol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tenderdash != null && Object.hasOwnProperty.call(message, "tenderdash")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.encode(message.tenderdash, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.drive != null && Object.hasOwnProperty.call(message, "drive")) + $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.encode(message.drive, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Protocol message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.IProtocol} message Protocol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Protocol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Protocol message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Protocol.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.decode(reader, reader.uint32()); + break; + case 2: + message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Protocol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Protocol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Protocol message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Protocol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify(message.tenderdash); + if (error) + return "tenderdash." + error; + } + if (message.drive != null && message.hasOwnProperty("drive")) { + var error = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify(message.drive); + if (error) + return "drive." + error; + } + return null; + }; + + /** + * Creates a Protocol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} Protocol + */ + Protocol.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol(); + if (object.tenderdash != null) { + if (typeof object.tenderdash !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.tenderdash: object expected"); + message.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.fromObject(object.tenderdash); + } + if (object.drive != null) { + if (typeof object.drive !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.drive: object expected"); + message.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.fromObject(object.drive); + } + return message; + }; + + /** + * Creates a plain object from a Protocol message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol} message Protocol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Protocol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tenderdash = null; + object.drive = null; + } + if (message.tenderdash != null && message.hasOwnProperty("tenderdash")) + object.tenderdash = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.toObject(message.tenderdash, options); + if (message.drive != null && message.hasOwnProperty("drive")) + object.drive = $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.toObject(message.drive, options); + return object; + }; + + /** + * Converts this Protocol to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @instance + * @returns {Object.} JSON object + */ + Protocol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Protocol.Tenderdash = (function() { + + /** + * Properties of a Tenderdash. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @interface ITenderdash + * @property {number|null} [p2p] Tenderdash p2p + * @property {number|null} [block] Tenderdash block + */ + + /** + * Constructs a new Tenderdash. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @classdesc Represents a Tenderdash. + * @implements ITenderdash + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set + */ + function Tenderdash(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tenderdash p2p. + * @member {number} p2p + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + */ + Tenderdash.prototype.p2p = 0; + + /** + * Tenderdash block. + * @member {number} block + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + */ + Tenderdash.prototype.block = 0; + + /** + * Creates a new Tenderdash instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash instance + */ + Tenderdash.create = function create(properties) { + return new Tenderdash(properties); + }; + + /** + * Encodes the specified Tenderdash message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenderdash.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.p2p); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.block); + return writer; + }; + + /** + * Encodes the specified Tenderdash message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.ITenderdash} message Tenderdash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenderdash.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tenderdash message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenderdash.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p2p = reader.uint32(); + break; + case 2: + message.block = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tenderdash message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenderdash.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tenderdash message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tenderdash.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.p2p != null && message.hasOwnProperty("p2p")) + if (!$util.isInteger(message.p2p)) + return "p2p: integer expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block)) + return "block: integer expected"; + return null; + }; + + /** + * Creates a Tenderdash message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} Tenderdash + */ + Tenderdash.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash(); + if (object.p2p != null) + message.p2p = object.p2p >>> 0; + if (object.block != null) + message.block = object.block >>> 0; + return message; + }; + + /** + * Creates a plain object from a Tenderdash message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash} message Tenderdash + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tenderdash.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.p2p = 0; + object.block = 0; + } + if (message.p2p != null && message.hasOwnProperty("p2p")) + object.p2p = message.p2p; + if (message.block != null && message.hasOwnProperty("block")) + object.block = message.block; + return object; + }; + + /** + * Converts this Tenderdash to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash + * @instance + * @returns {Object.} JSON object + */ + Tenderdash.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Tenderdash; + })(); + + Protocol.Drive = (function() { + + /** + * Properties of a Drive. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @interface IDrive + * @property {number|null} [latest] Drive latest + * @property {number|null} [current] Drive current + */ + + /** + * Constructs a new Drive. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol + * @classdesc Represents a Drive. + * @implements IDrive + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set + */ + function Drive(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Drive latest. + * @member {number} latest + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + */ + Drive.prototype.latest = 0; + + /** + * Drive current. + * @member {number} current + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + */ + Drive.prototype.current = 0; + + /** + * Creates a new Drive instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive instance + */ + Drive.create = function create(properties) { + return new Drive(properties); + }; + + /** + * Encodes the specified Drive message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Drive.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latest != null && Object.hasOwnProperty.call(message, "latest")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.latest); + if (message.current != null && Object.hasOwnProperty.call(message, "current")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.current); + return writer; + }; + + /** + * Encodes the specified Drive message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.IDrive} message Drive message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Drive.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Drive message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Drive.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.latest = reader.uint32(); + break; + case 4: + message.current = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Drive message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Drive.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Drive message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Drive.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latest != null && message.hasOwnProperty("latest")) + if (!$util.isInteger(message.latest)) + return "latest: integer expected"; + if (message.current != null && message.hasOwnProperty("current")) + if (!$util.isInteger(message.current)) + return "current: integer expected"; + return null; + }; + + /** + * Creates a Drive message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} Drive + */ + Drive.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive(); + if (object.latest != null) + message.latest = object.latest >>> 0; + if (object.current != null) + message.current = object.current >>> 0; + return message; + }; + + /** + * Creates a plain object from a Drive message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive} message Drive + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Drive.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latest = 0; + object.current = 0; + } + if (message.latest != null && message.hasOwnProperty("latest")) + object.latest = message.latest; + if (message.current != null && message.hasOwnProperty("current")) + object.current = message.current; + return object; + }; + + /** + * Converts this Drive to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive + * @instance + * @returns {Object.} JSON object + */ + Drive.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Drive; + })(); + + return Protocol; + })(); + + return Version; + })(); + + GetStatusResponseV0.Time = (function() { + + /** + * Properties of a Time. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface ITime + * @property {number|Long|null} [local] Time local + * @property {number|Long|null} [block] Time block + * @property {number|Long|null} [genesis] Time genesis + * @property {number|null} [epoch] Time epoch + */ + + /** + * Constructs a new Time. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Time. + * @implements ITime + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set + */ + function Time(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Time local. + * @member {number|Long} local + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.local = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time block. + * @member {number|Long} block + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time genesis. + * @member {number|Long} genesis + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.genesis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Time epoch. + * @member {number} epoch + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + */ + Time.prototype.epoch = 0; + + /** + * Creates a new Time instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time instance + */ + Time.create = function create(properties) { + return new Time(properties); + }; + + /** + * Encodes the specified Time message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Time.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.local != null && Object.hasOwnProperty.call(message, "local")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.local); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block); + if (message.genesis != null && Object.hasOwnProperty.call(message, "genesis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.genesis); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.epoch); + return writer; + }; + + /** + * Encodes the specified Time message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.ITime} message Time message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Time.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Time message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Time.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.local = reader.uint64(); + break; + case 2: + message.block = reader.uint64(); + break; + case 3: + message.genesis = reader.uint64(); + break; + case 4: + message.epoch = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Time message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Time.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Time message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Time.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.local != null && message.hasOwnProperty("local")) + if (!$util.isInteger(message.local) && !(message.local && $util.isInteger(message.local.low) && $util.isInteger(message.local.high))) + return "local: integer|Long expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) + return "block: integer|Long expected"; + if (message.genesis != null && message.hasOwnProperty("genesis")) + if (!$util.isInteger(message.genesis) && !(message.genesis && $util.isInteger(message.genesis.low) && $util.isInteger(message.genesis.high))) + return "genesis: integer|Long expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + return null; + }; + + /** + * Creates a Time message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} Time + */ + Time.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time(); + if (object.local != null) + if ($util.Long) + (message.local = $util.Long.fromValue(object.local)).unsigned = true; + else if (typeof object.local === "string") + message.local = parseInt(object.local, 10); + else if (typeof object.local === "number") + message.local = object.local; + else if (typeof object.local === "object") + message.local = new $util.LongBits(object.local.low >>> 0, object.local.high >>> 0).toNumber(true); + if (object.block != null) + if ($util.Long) + (message.block = $util.Long.fromValue(object.block)).unsigned = true; + else if (typeof object.block === "string") + message.block = parseInt(object.block, 10); + else if (typeof object.block === "number") + message.block = object.block; + else if (typeof object.block === "object") + message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); + if (object.genesis != null) + if ($util.Long) + (message.genesis = $util.Long.fromValue(object.genesis)).unsigned = true; + else if (typeof object.genesis === "string") + message.genesis = parseInt(object.genesis, 10); + else if (typeof object.genesis === "number") + message.genesis = object.genesis; + else if (typeof object.genesis === "object") + message.genesis = new $util.LongBits(object.genesis.low >>> 0, object.genesis.high >>> 0).toNumber(true); + if (object.epoch != null) + message.epoch = object.epoch >>> 0; + return message; + }; + + /** + * Creates a plain object from a Time message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time} message Time + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Time.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.local = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.local = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.block = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.genesis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.genesis = options.longs === String ? "0" : 0; + object.epoch = 0; + } + if (message.local != null && message.hasOwnProperty("local")) + if (typeof message.local === "number") + object.local = options.longs === String ? String(message.local) : message.local; + else + object.local = options.longs === String ? $util.Long.prototype.toString.call(message.local) : options.longs === Number ? new $util.LongBits(message.local.low >>> 0, message.local.high >>> 0).toNumber(true) : message.local; + if (message.block != null && message.hasOwnProperty("block")) + if (typeof message.block === "number") + object.block = options.longs === String ? String(message.block) : message.block; + else + object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; + if (message.genesis != null && message.hasOwnProperty("genesis")) + if (typeof message.genesis === "number") + object.genesis = options.longs === String ? String(message.genesis) : message.genesis; + else + object.genesis = options.longs === String ? $util.Long.prototype.toString.call(message.genesis) : options.longs === Number ? new $util.LongBits(message.genesis.low >>> 0, message.genesis.high >>> 0).toNumber(true) : message.genesis; + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + return object; + }; + + /** + * Converts this Time to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time + * @instance + * @returns {Object.} JSON object + */ + Time.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Time; + })(); + + GetStatusResponseV0.Node = (function() { + + /** + * Properties of a Node. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface INode + * @property {Uint8Array|null} [id] Node id + * @property {Uint8Array|null} [proTxHash] Node proTxHash + */ + + /** + * Constructs a new Node. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + */ + Node.prototype.id = $util.newBuffer([]); + + /** + * Node proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + */ + Node.prototype.proTxHash = $util.newBuffer([]); + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proTxHash); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.bytes(); + break; + case 2: + message.proTxHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Node; + })(); + + GetStatusResponseV0.Chain = (function() { + + /** + * Properties of a Chain. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IChain + * @property {boolean|null} [catchingUp] Chain catchingUp + * @property {Uint8Array|null} [latestBlockHash] Chain latestBlockHash + * @property {Uint8Array|null} [latestAppHash] Chain latestAppHash + * @property {number|Long|null} [latestBlockHeight] Chain latestBlockHeight + * @property {Uint8Array|null} [earliestBlockHash] Chain earliestBlockHash + * @property {Uint8Array|null} [earliestAppHash] Chain earliestAppHash + * @property {number|Long|null} [earliestBlockHeight] Chain earliestBlockHeight + * @property {number|Long|null} [maxPeerBlockHeight] Chain maxPeerBlockHeight + * @property {number|null} [coreChainLockedHeight] Chain coreChainLockedHeight + */ + + /** + * Constructs a new Chain. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Chain. + * @implements IChain + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set + */ + function Chain(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chain catchingUp. + * @member {boolean} catchingUp + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.catchingUp = false; + + /** + * Chain latestBlockHash. + * @member {Uint8Array} latestBlockHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestBlockHash = $util.newBuffer([]); + + /** + * Chain latestAppHash. + * @member {Uint8Array} latestAppHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestAppHash = $util.newBuffer([]); + + /** + * Chain latestBlockHeight. + * @member {number|Long} latestBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.latestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain earliestBlockHash. + * @member {Uint8Array} earliestBlockHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestBlockHash = $util.newBuffer([]); + + /** + * Chain earliestAppHash. + * @member {Uint8Array} earliestAppHash + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestAppHash = $util.newBuffer([]); + + /** + * Chain earliestBlockHeight. + * @member {number|Long} earliestBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.earliestBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain maxPeerBlockHeight. + * @member {number|Long} maxPeerBlockHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.maxPeerBlockHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Chain coreChainLockedHeight. + * @member {number} coreChainLockedHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + */ + Chain.prototype.coreChainLockedHeight = 0; + + /** + * Creates a new Chain instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain instance + */ + Chain.create = function create(properties) { + return new Chain(properties); + }; + + /** + * Encodes the specified Chain message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catchingUp != null && Object.hasOwnProperty.call(message, "catchingUp")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.catchingUp); + if (message.latestBlockHash != null && Object.hasOwnProperty.call(message, "latestBlockHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.latestBlockHash); + if (message.latestAppHash != null && Object.hasOwnProperty.call(message, "latestAppHash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.latestAppHash); + if (message.latestBlockHeight != null && Object.hasOwnProperty.call(message, "latestBlockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.latestBlockHeight); + if (message.earliestBlockHash != null && Object.hasOwnProperty.call(message, "earliestBlockHash")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.earliestBlockHash); + if (message.earliestAppHash != null && Object.hasOwnProperty.call(message, "earliestAppHash")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.earliestAppHash); + if (message.earliestBlockHeight != null && Object.hasOwnProperty.call(message, "earliestBlockHeight")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.earliestBlockHeight); + if (message.maxPeerBlockHeight != null && Object.hasOwnProperty.call(message, "maxPeerBlockHeight")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.maxPeerBlockHeight); + if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.coreChainLockedHeight); + return writer; + }; + + /** + * Encodes the specified Chain message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IChain} message Chain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chain message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catchingUp = reader.bool(); + break; + case 2: + message.latestBlockHash = reader.bytes(); + break; + case 3: + message.latestAppHash = reader.bytes(); + break; + case 4: + message.latestBlockHeight = reader.uint64(); + break; + case 5: + message.earliestBlockHash = reader.bytes(); + break; + case 6: + message.earliestAppHash = reader.bytes(); + break; + case 7: + message.earliestBlockHeight = reader.uint64(); + break; + case 9: + message.maxPeerBlockHeight = reader.uint64(); + break; + case 10: + message.coreChainLockedHeight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chain message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) + if (typeof message.catchingUp !== "boolean") + return "catchingUp: boolean expected"; + if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) + if (!(message.latestBlockHash && typeof message.latestBlockHash.length === "number" || $util.isString(message.latestBlockHash))) + return "latestBlockHash: buffer expected"; + if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) + if (!(message.latestAppHash && typeof message.latestAppHash.length === "number" || $util.isString(message.latestAppHash))) + return "latestAppHash: buffer expected"; + if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) + if (!$util.isInteger(message.latestBlockHeight) && !(message.latestBlockHeight && $util.isInteger(message.latestBlockHeight.low) && $util.isInteger(message.latestBlockHeight.high))) + return "latestBlockHeight: integer|Long expected"; + if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) + if (!(message.earliestBlockHash && typeof message.earliestBlockHash.length === "number" || $util.isString(message.earliestBlockHash))) + return "earliestBlockHash: buffer expected"; + if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) + if (!(message.earliestAppHash && typeof message.earliestAppHash.length === "number" || $util.isString(message.earliestAppHash))) + return "earliestAppHash: buffer expected"; + if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) + if (!$util.isInteger(message.earliestBlockHeight) && !(message.earliestBlockHeight && $util.isInteger(message.earliestBlockHeight.low) && $util.isInteger(message.earliestBlockHeight.high))) + return "earliestBlockHeight: integer|Long expected"; + if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) + if (!$util.isInteger(message.maxPeerBlockHeight) && !(message.maxPeerBlockHeight && $util.isInteger(message.maxPeerBlockHeight.low) && $util.isInteger(message.maxPeerBlockHeight.high))) + return "maxPeerBlockHeight: integer|Long expected"; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + if (!$util.isInteger(message.coreChainLockedHeight)) + return "coreChainLockedHeight: integer expected"; + return null; + }; + + /** + * Creates a Chain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} Chain + */ + Chain.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain(); + if (object.catchingUp != null) + message.catchingUp = Boolean(object.catchingUp); + if (object.latestBlockHash != null) + if (typeof object.latestBlockHash === "string") + $util.base64.decode(object.latestBlockHash, message.latestBlockHash = $util.newBuffer($util.base64.length(object.latestBlockHash)), 0); + else if (object.latestBlockHash.length >= 0) + message.latestBlockHash = object.latestBlockHash; + if (object.latestAppHash != null) + if (typeof object.latestAppHash === "string") + $util.base64.decode(object.latestAppHash, message.latestAppHash = $util.newBuffer($util.base64.length(object.latestAppHash)), 0); + else if (object.latestAppHash.length >= 0) + message.latestAppHash = object.latestAppHash; + if (object.latestBlockHeight != null) + if ($util.Long) + (message.latestBlockHeight = $util.Long.fromValue(object.latestBlockHeight)).unsigned = true; + else if (typeof object.latestBlockHeight === "string") + message.latestBlockHeight = parseInt(object.latestBlockHeight, 10); + else if (typeof object.latestBlockHeight === "number") + message.latestBlockHeight = object.latestBlockHeight; + else if (typeof object.latestBlockHeight === "object") + message.latestBlockHeight = new $util.LongBits(object.latestBlockHeight.low >>> 0, object.latestBlockHeight.high >>> 0).toNumber(true); + if (object.earliestBlockHash != null) + if (typeof object.earliestBlockHash === "string") + $util.base64.decode(object.earliestBlockHash, message.earliestBlockHash = $util.newBuffer($util.base64.length(object.earliestBlockHash)), 0); + else if (object.earliestBlockHash.length >= 0) + message.earliestBlockHash = object.earliestBlockHash; + if (object.earliestAppHash != null) + if (typeof object.earliestAppHash === "string") + $util.base64.decode(object.earliestAppHash, message.earliestAppHash = $util.newBuffer($util.base64.length(object.earliestAppHash)), 0); + else if (object.earliestAppHash.length >= 0) + message.earliestAppHash = object.earliestAppHash; + if (object.earliestBlockHeight != null) + if ($util.Long) + (message.earliestBlockHeight = $util.Long.fromValue(object.earliestBlockHeight)).unsigned = true; + else if (typeof object.earliestBlockHeight === "string") + message.earliestBlockHeight = parseInt(object.earliestBlockHeight, 10); + else if (typeof object.earliestBlockHeight === "number") + message.earliestBlockHeight = object.earliestBlockHeight; + else if (typeof object.earliestBlockHeight === "object") + message.earliestBlockHeight = new $util.LongBits(object.earliestBlockHeight.low >>> 0, object.earliestBlockHeight.high >>> 0).toNumber(true); + if (object.maxPeerBlockHeight != null) + if ($util.Long) + (message.maxPeerBlockHeight = $util.Long.fromValue(object.maxPeerBlockHeight)).unsigned = true; + else if (typeof object.maxPeerBlockHeight === "string") + message.maxPeerBlockHeight = parseInt(object.maxPeerBlockHeight, 10); + else if (typeof object.maxPeerBlockHeight === "number") + message.maxPeerBlockHeight = object.maxPeerBlockHeight; + else if (typeof object.maxPeerBlockHeight === "object") + message.maxPeerBlockHeight = new $util.LongBits(object.maxPeerBlockHeight.low >>> 0, object.maxPeerBlockHeight.high >>> 0).toNumber(true); + if (object.coreChainLockedHeight != null) + message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; + return message; + }; + + /** + * Creates a plain object from a Chain message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain} message Chain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.catchingUp = false; + if (options.bytes === String) + object.latestBlockHash = ""; + else { + object.latestBlockHash = []; + if (options.bytes !== Array) + object.latestBlockHash = $util.newBuffer(object.latestBlockHash); + } + if (options.bytes === String) + object.latestAppHash = ""; + else { + object.latestAppHash = []; + if (options.bytes !== Array) + object.latestAppHash = $util.newBuffer(object.latestAppHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.latestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.latestBlockHeight = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.earliestBlockHash = ""; + else { + object.earliestBlockHash = []; + if (options.bytes !== Array) + object.earliestBlockHash = $util.newBuffer(object.earliestBlockHash); + } + if (options.bytes === String) + object.earliestAppHash = ""; + else { + object.earliestAppHash = []; + if (options.bytes !== Array) + object.earliestAppHash = $util.newBuffer(object.earliestAppHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.earliestBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.earliestBlockHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.maxPeerBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxPeerBlockHeight = options.longs === String ? "0" : 0; + object.coreChainLockedHeight = 0; + } + if (message.catchingUp != null && message.hasOwnProperty("catchingUp")) + object.catchingUp = message.catchingUp; + if (message.latestBlockHash != null && message.hasOwnProperty("latestBlockHash")) + object.latestBlockHash = options.bytes === String ? $util.base64.encode(message.latestBlockHash, 0, message.latestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestBlockHash) : message.latestBlockHash; + if (message.latestAppHash != null && message.hasOwnProperty("latestAppHash")) + object.latestAppHash = options.bytes === String ? $util.base64.encode(message.latestAppHash, 0, message.latestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.latestAppHash) : message.latestAppHash; + if (message.latestBlockHeight != null && message.hasOwnProperty("latestBlockHeight")) + if (typeof message.latestBlockHeight === "number") + object.latestBlockHeight = options.longs === String ? String(message.latestBlockHeight) : message.latestBlockHeight; + else + object.latestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.latestBlockHeight) : options.longs === Number ? new $util.LongBits(message.latestBlockHeight.low >>> 0, message.latestBlockHeight.high >>> 0).toNumber(true) : message.latestBlockHeight; + if (message.earliestBlockHash != null && message.hasOwnProperty("earliestBlockHash")) + object.earliestBlockHash = options.bytes === String ? $util.base64.encode(message.earliestBlockHash, 0, message.earliestBlockHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestBlockHash) : message.earliestBlockHash; + if (message.earliestAppHash != null && message.hasOwnProperty("earliestAppHash")) + object.earliestAppHash = options.bytes === String ? $util.base64.encode(message.earliestAppHash, 0, message.earliestAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.earliestAppHash) : message.earliestAppHash; + if (message.earliestBlockHeight != null && message.hasOwnProperty("earliestBlockHeight")) + if (typeof message.earliestBlockHeight === "number") + object.earliestBlockHeight = options.longs === String ? String(message.earliestBlockHeight) : message.earliestBlockHeight; + else + object.earliestBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.earliestBlockHeight) : options.longs === Number ? new $util.LongBits(message.earliestBlockHeight.low >>> 0, message.earliestBlockHeight.high >>> 0).toNumber(true) : message.earliestBlockHeight; + if (message.maxPeerBlockHeight != null && message.hasOwnProperty("maxPeerBlockHeight")) + if (typeof message.maxPeerBlockHeight === "number") + object.maxPeerBlockHeight = options.longs === String ? String(message.maxPeerBlockHeight) : message.maxPeerBlockHeight; + else + object.maxPeerBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.maxPeerBlockHeight) : options.longs === Number ? new $util.LongBits(message.maxPeerBlockHeight.low >>> 0, message.maxPeerBlockHeight.high >>> 0).toNumber(true) : message.maxPeerBlockHeight; + if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) + object.coreChainLockedHeight = message.coreChainLockedHeight; + return object; + }; + + /** + * Converts this Chain to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain + * @instance + * @returns {Object.} JSON object + */ + Chain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Chain; + })(); + + GetStatusResponseV0.Network = (function() { + + /** + * Properties of a Network. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface INetwork + * @property {string|null} [chainId] Network chainId + * @property {number|null} [peersCount] Network peersCount + * @property {boolean|null} [listening] Network listening + */ + + /** + * Constructs a new Network. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a Network. + * @implements INetwork + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set + */ + function Network(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Network chainId. + * @member {string} chainId + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.chainId = ""; + + /** + * Network peersCount. + * @member {number} peersCount + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.peersCount = 0; + + /** + * Network listening. + * @member {boolean} listening + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + */ + Network.prototype.listening = false; + + /** + * Creates a new Network instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network instance + */ + Network.create = function create(properties) { + return new Network(properties); + }; + + /** + * Encodes the specified Network message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.chainId); + if (message.peersCount != null && Object.hasOwnProperty.call(message, "peersCount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.peersCount); + if (message.listening != null && Object.hasOwnProperty.call(message, "listening")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.listening); + return writer; + }; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Network message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.peersCount = reader.uint32(); + break; + case 3: + message.listening = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Network message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Network.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chainId != null && message.hasOwnProperty("chainId")) + if (!$util.isString(message.chainId)) + return "chainId: string expected"; + if (message.peersCount != null && message.hasOwnProperty("peersCount")) + if (!$util.isInteger(message.peersCount)) + return "peersCount: integer expected"; + if (message.listening != null && message.hasOwnProperty("listening")) + if (typeof message.listening !== "boolean") + return "listening: boolean expected"; + return null; + }; + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} Network + */ + Network.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network(); + if (object.chainId != null) + message.chainId = String(object.chainId); + if (object.peersCount != null) + message.peersCount = object.peersCount >>> 0; + if (object.listening != null) + message.listening = Boolean(object.listening); + return message; + }; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network} message Network + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Network.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chainId = ""; + object.peersCount = 0; + object.listening = false; + } + if (message.chainId != null && message.hasOwnProperty("chainId")) + object.chainId = message.chainId; + if (message.peersCount != null && message.hasOwnProperty("peersCount")) + object.peersCount = message.peersCount; + if (message.listening != null && message.hasOwnProperty("listening")) + object.listening = message.listening; + return object; + }; + + /** + * Converts this Network to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network + * @instance + * @returns {Object.} JSON object + */ + Network.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Network; + })(); + + GetStatusResponseV0.StateSync = (function() { + + /** + * Properties of a StateSync. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @interface IStateSync + * @property {number|Long|null} [totalSyncedTime] StateSync totalSyncedTime + * @property {number|Long|null} [remainingTime] StateSync remainingTime + * @property {number|null} [totalSnapshots] StateSync totalSnapshots + * @property {number|Long|null} [chunkProcessAvgTime] StateSync chunkProcessAvgTime + * @property {number|Long|null} [snapshotHeight] StateSync snapshotHeight + * @property {number|Long|null} [snapshotChunksCount] StateSync snapshotChunksCount + * @property {number|Long|null} [backfilledBlocks] StateSync backfilledBlocks + * @property {number|Long|null} [backfillBlocksTotal] StateSync backfillBlocksTotal + */ + + /** + * Constructs a new StateSync. + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0 + * @classdesc Represents a StateSync. + * @implements IStateSync + * @constructor + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set + */ + function StateSync(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateSync totalSyncedTime. + * @member {number|Long} totalSyncedTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.totalSyncedTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync remainingTime. + * @member {number|Long} remainingTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.remainingTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync totalSnapshots. + * @member {number} totalSnapshots + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.totalSnapshots = 0; + + /** + * StateSync chunkProcessAvgTime. + * @member {number|Long} chunkProcessAvgTime + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.chunkProcessAvgTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync snapshotHeight. + * @member {number|Long} snapshotHeight + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.snapshotHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync snapshotChunksCount. + * @member {number|Long} snapshotChunksCount + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.snapshotChunksCount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync backfilledBlocks. + * @member {number|Long} backfilledBlocks + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.backfilledBlocks = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StateSync backfillBlocksTotal. + * @member {number|Long} backfillBlocksTotal + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + */ + StateSync.prototype.backfillBlocksTotal = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new StateSync instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync instance + */ + StateSync.create = function create(properties) { + return new StateSync(properties); + }; + + /** + * Encodes the specified StateSync message. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateSync.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalSyncedTime != null && Object.hasOwnProperty.call(message, "totalSyncedTime")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.totalSyncedTime); + if (message.remainingTime != null && Object.hasOwnProperty.call(message, "remainingTime")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.remainingTime); + if (message.totalSnapshots != null && Object.hasOwnProperty.call(message, "totalSnapshots")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.totalSnapshots); + if (message.chunkProcessAvgTime != null && Object.hasOwnProperty.call(message, "chunkProcessAvgTime")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.chunkProcessAvgTime); + if (message.snapshotHeight != null && Object.hasOwnProperty.call(message, "snapshotHeight")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.snapshotHeight); + if (message.snapshotChunksCount != null && Object.hasOwnProperty.call(message, "snapshotChunksCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.snapshotChunksCount); + if (message.backfilledBlocks != null && Object.hasOwnProperty.call(message, "backfilledBlocks")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.backfilledBlocks); + if (message.backfillBlocksTotal != null && Object.hasOwnProperty.call(message, "backfillBlocksTotal")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.backfillBlocksTotal); + return writer; + }; + + /** + * Encodes the specified StateSync message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.IStateSync} message StateSync message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateSync.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateSync message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateSync.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalSyncedTime = reader.uint64(); + break; + case 2: + message.remainingTime = reader.uint64(); + break; + case 3: + message.totalSnapshots = reader.uint32(); + break; + case 4: + message.chunkProcessAvgTime = reader.uint64(); + break; + case 5: + message.snapshotHeight = reader.uint64(); + break; + case 6: + message.snapshotChunksCount = reader.uint64(); + break; + case 7: + message.backfilledBlocks = reader.uint64(); + break; + case 8: + message.backfillBlocksTotal = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateSync message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateSync.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateSync message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateSync.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) + if (!$util.isInteger(message.totalSyncedTime) && !(message.totalSyncedTime && $util.isInteger(message.totalSyncedTime.low) && $util.isInteger(message.totalSyncedTime.high))) + return "totalSyncedTime: integer|Long expected"; + if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) + if (!$util.isInteger(message.remainingTime) && !(message.remainingTime && $util.isInteger(message.remainingTime.low) && $util.isInteger(message.remainingTime.high))) + return "remainingTime: integer|Long expected"; + if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) + if (!$util.isInteger(message.totalSnapshots)) + return "totalSnapshots: integer expected"; + if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) + if (!$util.isInteger(message.chunkProcessAvgTime) && !(message.chunkProcessAvgTime && $util.isInteger(message.chunkProcessAvgTime.low) && $util.isInteger(message.chunkProcessAvgTime.high))) + return "chunkProcessAvgTime: integer|Long expected"; + if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) + if (!$util.isInteger(message.snapshotHeight) && !(message.snapshotHeight && $util.isInteger(message.snapshotHeight.low) && $util.isInteger(message.snapshotHeight.high))) + return "snapshotHeight: integer|Long expected"; + if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) + if (!$util.isInteger(message.snapshotChunksCount) && !(message.snapshotChunksCount && $util.isInteger(message.snapshotChunksCount.low) && $util.isInteger(message.snapshotChunksCount.high))) + return "snapshotChunksCount: integer|Long expected"; + if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) + if (!$util.isInteger(message.backfilledBlocks) && !(message.backfilledBlocks && $util.isInteger(message.backfilledBlocks.low) && $util.isInteger(message.backfilledBlocks.high))) + return "backfilledBlocks: integer|Long expected"; + if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) + if (!$util.isInteger(message.backfillBlocksTotal) && !(message.backfillBlocksTotal && $util.isInteger(message.backfillBlocksTotal.low) && $util.isInteger(message.backfillBlocksTotal.high))) + return "backfillBlocksTotal: integer|Long expected"; + return null; + }; + + /** + * Creates a StateSync message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} StateSync + */ + StateSync.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync(); + if (object.totalSyncedTime != null) + if ($util.Long) + (message.totalSyncedTime = $util.Long.fromValue(object.totalSyncedTime)).unsigned = true; + else if (typeof object.totalSyncedTime === "string") + message.totalSyncedTime = parseInt(object.totalSyncedTime, 10); + else if (typeof object.totalSyncedTime === "number") + message.totalSyncedTime = object.totalSyncedTime; + else if (typeof object.totalSyncedTime === "object") + message.totalSyncedTime = new $util.LongBits(object.totalSyncedTime.low >>> 0, object.totalSyncedTime.high >>> 0).toNumber(true); + if (object.remainingTime != null) + if ($util.Long) + (message.remainingTime = $util.Long.fromValue(object.remainingTime)).unsigned = true; + else if (typeof object.remainingTime === "string") + message.remainingTime = parseInt(object.remainingTime, 10); + else if (typeof object.remainingTime === "number") + message.remainingTime = object.remainingTime; + else if (typeof object.remainingTime === "object") + message.remainingTime = new $util.LongBits(object.remainingTime.low >>> 0, object.remainingTime.high >>> 0).toNumber(true); + if (object.totalSnapshots != null) + message.totalSnapshots = object.totalSnapshots >>> 0; + if (object.chunkProcessAvgTime != null) + if ($util.Long) + (message.chunkProcessAvgTime = $util.Long.fromValue(object.chunkProcessAvgTime)).unsigned = true; + else if (typeof object.chunkProcessAvgTime === "string") + message.chunkProcessAvgTime = parseInt(object.chunkProcessAvgTime, 10); + else if (typeof object.chunkProcessAvgTime === "number") + message.chunkProcessAvgTime = object.chunkProcessAvgTime; + else if (typeof object.chunkProcessAvgTime === "object") + message.chunkProcessAvgTime = new $util.LongBits(object.chunkProcessAvgTime.low >>> 0, object.chunkProcessAvgTime.high >>> 0).toNumber(true); + if (object.snapshotHeight != null) + if ($util.Long) + (message.snapshotHeight = $util.Long.fromValue(object.snapshotHeight)).unsigned = true; + else if (typeof object.snapshotHeight === "string") + message.snapshotHeight = parseInt(object.snapshotHeight, 10); + else if (typeof object.snapshotHeight === "number") + message.snapshotHeight = object.snapshotHeight; + else if (typeof object.snapshotHeight === "object") + message.snapshotHeight = new $util.LongBits(object.snapshotHeight.low >>> 0, object.snapshotHeight.high >>> 0).toNumber(true); + if (object.snapshotChunksCount != null) + if ($util.Long) + (message.snapshotChunksCount = $util.Long.fromValue(object.snapshotChunksCount)).unsigned = true; + else if (typeof object.snapshotChunksCount === "string") + message.snapshotChunksCount = parseInt(object.snapshotChunksCount, 10); + else if (typeof object.snapshotChunksCount === "number") + message.snapshotChunksCount = object.snapshotChunksCount; + else if (typeof object.snapshotChunksCount === "object") + message.snapshotChunksCount = new $util.LongBits(object.snapshotChunksCount.low >>> 0, object.snapshotChunksCount.high >>> 0).toNumber(true); + if (object.backfilledBlocks != null) + if ($util.Long) + (message.backfilledBlocks = $util.Long.fromValue(object.backfilledBlocks)).unsigned = true; + else if (typeof object.backfilledBlocks === "string") + message.backfilledBlocks = parseInt(object.backfilledBlocks, 10); + else if (typeof object.backfilledBlocks === "number") + message.backfilledBlocks = object.backfilledBlocks; + else if (typeof object.backfilledBlocks === "object") + message.backfilledBlocks = new $util.LongBits(object.backfilledBlocks.low >>> 0, object.backfilledBlocks.high >>> 0).toNumber(true); + if (object.backfillBlocksTotal != null) + if ($util.Long) + (message.backfillBlocksTotal = $util.Long.fromValue(object.backfillBlocksTotal)).unsigned = true; + else if (typeof object.backfillBlocksTotal === "string") + message.backfillBlocksTotal = parseInt(object.backfillBlocksTotal, 10); + else if (typeof object.backfillBlocksTotal === "number") + message.backfillBlocksTotal = object.backfillBlocksTotal; + else if (typeof object.backfillBlocksTotal === "object") + message.backfillBlocksTotal = new $util.LongBits(object.backfillBlocksTotal.low >>> 0, object.backfillBlocksTotal.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a StateSync message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @static + * @param {org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync} message StateSync + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateSync.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalSyncedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalSyncedTime = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.remainingTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.remainingTime = options.longs === String ? "0" : 0; + object.totalSnapshots = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.chunkProcessAvgTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.chunkProcessAvgTime = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.snapshotHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.snapshotHeight = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.snapshotChunksCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.snapshotChunksCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.backfilledBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backfilledBlocks = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.backfillBlocksTotal = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backfillBlocksTotal = options.longs === String ? "0" : 0; + } + if (message.totalSyncedTime != null && message.hasOwnProperty("totalSyncedTime")) + if (typeof message.totalSyncedTime === "number") + object.totalSyncedTime = options.longs === String ? String(message.totalSyncedTime) : message.totalSyncedTime; + else + object.totalSyncedTime = options.longs === String ? $util.Long.prototype.toString.call(message.totalSyncedTime) : options.longs === Number ? new $util.LongBits(message.totalSyncedTime.low >>> 0, message.totalSyncedTime.high >>> 0).toNumber(true) : message.totalSyncedTime; + if (message.remainingTime != null && message.hasOwnProperty("remainingTime")) + if (typeof message.remainingTime === "number") + object.remainingTime = options.longs === String ? String(message.remainingTime) : message.remainingTime; + else + object.remainingTime = options.longs === String ? $util.Long.prototype.toString.call(message.remainingTime) : options.longs === Number ? new $util.LongBits(message.remainingTime.low >>> 0, message.remainingTime.high >>> 0).toNumber(true) : message.remainingTime; + if (message.totalSnapshots != null && message.hasOwnProperty("totalSnapshots")) + object.totalSnapshots = message.totalSnapshots; + if (message.chunkProcessAvgTime != null && message.hasOwnProperty("chunkProcessAvgTime")) + if (typeof message.chunkProcessAvgTime === "number") + object.chunkProcessAvgTime = options.longs === String ? String(message.chunkProcessAvgTime) : message.chunkProcessAvgTime; + else + object.chunkProcessAvgTime = options.longs === String ? $util.Long.prototype.toString.call(message.chunkProcessAvgTime) : options.longs === Number ? new $util.LongBits(message.chunkProcessAvgTime.low >>> 0, message.chunkProcessAvgTime.high >>> 0).toNumber(true) : message.chunkProcessAvgTime; + if (message.snapshotHeight != null && message.hasOwnProperty("snapshotHeight")) + if (typeof message.snapshotHeight === "number") + object.snapshotHeight = options.longs === String ? String(message.snapshotHeight) : message.snapshotHeight; + else + object.snapshotHeight = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotHeight) : options.longs === Number ? new $util.LongBits(message.snapshotHeight.low >>> 0, message.snapshotHeight.high >>> 0).toNumber(true) : message.snapshotHeight; + if (message.snapshotChunksCount != null && message.hasOwnProperty("snapshotChunksCount")) + if (typeof message.snapshotChunksCount === "number") + object.snapshotChunksCount = options.longs === String ? String(message.snapshotChunksCount) : message.snapshotChunksCount; + else + object.snapshotChunksCount = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotChunksCount) : options.longs === Number ? new $util.LongBits(message.snapshotChunksCount.low >>> 0, message.snapshotChunksCount.high >>> 0).toNumber(true) : message.snapshotChunksCount; + if (message.backfilledBlocks != null && message.hasOwnProperty("backfilledBlocks")) + if (typeof message.backfilledBlocks === "number") + object.backfilledBlocks = options.longs === String ? String(message.backfilledBlocks) : message.backfilledBlocks; + else + object.backfilledBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.backfilledBlocks) : options.longs === Number ? new $util.LongBits(message.backfilledBlocks.low >>> 0, message.backfilledBlocks.high >>> 0).toNumber(true) : message.backfilledBlocks; + if (message.backfillBlocksTotal != null && message.hasOwnProperty("backfillBlocksTotal")) + if (typeof message.backfillBlocksTotal === "number") + object.backfillBlocksTotal = options.longs === String ? String(message.backfillBlocksTotal) : message.backfillBlocksTotal; + else + object.backfillBlocksTotal = options.longs === String ? $util.Long.prototype.toString.call(message.backfillBlocksTotal) : options.longs === Number ? new $util.LongBits(message.backfillBlocksTotal.low >>> 0, message.backfillBlocksTotal.high >>> 0).toNumber(true) : message.backfillBlocksTotal; + return object; + }; + + /** + * Converts this StateSync to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync + * @instance + * @returns {Object.} JSON object + */ + StateSync.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StateSync; + })(); + + return GetStatusResponseV0; + })(); + + return GetStatusResponse; + })(); + + v0.GetCurrentQuorumsInfoRequest = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetCurrentQuorumsInfoRequest + * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null} [v0] GetCurrentQuorumsInfoRequest v0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetCurrentQuorumsInfoRequest. + * @implements IGetCurrentQuorumsInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + */ + GetCurrentQuorumsInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetCurrentQuorumsInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + */ + Object.defineProperty(GetCurrentQuorumsInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetCurrentQuorumsInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest instance + */ + GetCurrentQuorumsInfoRequest.create = function create(properties) { + return new GetCurrentQuorumsInfoRequest(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} GetCurrentQuorumsInfoRequest + */ + GetCurrentQuorumsInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest} message GetCurrentQuorumsInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @interface IGetCurrentQuorumsInfoRequestV0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest + * @classdesc Represents a GetCurrentQuorumsInfoRequestV0. + * @implements IGetCurrentQuorumsInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetCurrentQuorumsInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 instance + */ + GetCurrentQuorumsInfoRequestV0.create = function create(properties) { + return new GetCurrentQuorumsInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.IGetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} GetCurrentQuorumsInfoRequestV0 + */ + GetCurrentQuorumsInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0) + return object; + return new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0(); + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0} message GetCurrentQuorumsInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoRequestV0.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetCurrentQuorumsInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoRequest.GetCurrentQuorumsInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCurrentQuorumsInfoRequestV0; + })(); + + return GetCurrentQuorumsInfoRequest; + })(); + + v0.GetCurrentQuorumsInfoResponse = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetCurrentQuorumsInfoResponse + * @property {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null} [v0] GetCurrentQuorumsInfoResponse v0 + */ + + /** + * Constructs a new GetCurrentQuorumsInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetCurrentQuorumsInfoResponse. + * @implements IGetCurrentQuorumsInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + */ + GetCurrentQuorumsInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetCurrentQuorumsInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + */ + Object.defineProperty(GetCurrentQuorumsInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetCurrentQuorumsInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse instance + */ + GetCurrentQuorumsInfoResponse.create = function create(properties) { + return new GetCurrentQuorumsInfoResponse(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} GetCurrentQuorumsInfoResponse + */ + GetCurrentQuorumsInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse} message GetCurrentQuorumsInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetCurrentQuorumsInfoResponse.ValidatorV0 = (function() { + + /** + * Properties of a ValidatorV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IValidatorV0 + * @property {Uint8Array|null} [proTxHash] ValidatorV0 proTxHash + * @property {string|null} [nodeIp] ValidatorV0 nodeIp + * @property {boolean|null} [isBanned] ValidatorV0 isBanned + */ + + /** + * Constructs a new ValidatorV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a ValidatorV0. + * @implements IValidatorV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set + */ + function ValidatorV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorV0 proTxHash. + * @member {Uint8Array} proTxHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.proTxHash = $util.newBuffer([]); + + /** + * ValidatorV0 nodeIp. + * @member {string} nodeIp + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.nodeIp = ""; + + /** + * ValidatorV0 isBanned. + * @member {boolean} isBanned + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + */ + ValidatorV0.prototype.isBanned = false; + + /** + * Creates a new ValidatorV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 instance + */ + ValidatorV0.create = function create(properties) { + return new ValidatorV0(properties); + }; + + /** + * Encodes the specified ValidatorV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proTxHash != null && Object.hasOwnProperty.call(message, "proTxHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.proTxHash); + if (message.nodeIp != null && Object.hasOwnProperty.call(message, "nodeIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIp); + if (message.isBanned != null && Object.hasOwnProperty.call(message, "isBanned")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isBanned); + return writer; + }; + + /** + * Encodes the specified ValidatorV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorV0} message ValidatorV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proTxHash = reader.bytes(); + break; + case 2: + message.nodeIp = reader.string(); + break; + case 3: + message.isBanned = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + if (!(message.proTxHash && typeof message.proTxHash.length === "number" || $util.isString(message.proTxHash))) + return "proTxHash: buffer expected"; + if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) + if (!$util.isString(message.nodeIp)) + return "nodeIp: string expected"; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + if (typeof message.isBanned !== "boolean") + return "isBanned: boolean expected"; + return null; + }; + + /** + * Creates a ValidatorV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} ValidatorV0 + */ + ValidatorV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0(); + if (object.proTxHash != null) + if (typeof object.proTxHash === "string") + $util.base64.decode(object.proTxHash, message.proTxHash = $util.newBuffer($util.base64.length(object.proTxHash)), 0); + else if (object.proTxHash.length >= 0) + message.proTxHash = object.proTxHash; + if (object.nodeIp != null) + message.nodeIp = String(object.nodeIp); + if (object.isBanned != null) + message.isBanned = Boolean(object.isBanned); + return message; + }; + + /** + * Creates a plain object from a ValidatorV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0} message ValidatorV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.proTxHash = ""; + else { + object.proTxHash = []; + if (options.bytes !== Array) + object.proTxHash = $util.newBuffer(object.proTxHash); + } + object.nodeIp = ""; + object.isBanned = false; + } + if (message.proTxHash != null && message.hasOwnProperty("proTxHash")) + object.proTxHash = options.bytes === String ? $util.base64.encode(message.proTxHash, 0, message.proTxHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.proTxHash) : message.proTxHash; + if (message.nodeIp != null && message.hasOwnProperty("nodeIp")) + object.nodeIp = message.nodeIp; + if (message.isBanned != null && message.hasOwnProperty("isBanned")) + object.isBanned = message.isBanned; + return object; + }; + + /** + * Converts this ValidatorV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0 + * @instance + * @returns {Object.} JSON object + */ + ValidatorV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorV0; + })(); + + GetCurrentQuorumsInfoResponse.ValidatorSetV0 = (function() { + + /** + * Properties of a ValidatorSetV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IValidatorSetV0 + * @property {Uint8Array|null} [quorumHash] ValidatorSetV0 quorumHash + * @property {number|null} [coreHeight] ValidatorSetV0 coreHeight + * @property {Array.|null} [members] ValidatorSetV0 members + * @property {Uint8Array|null} [thresholdPublicKey] ValidatorSetV0 thresholdPublicKey + */ + + /** + * Constructs a new ValidatorSetV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a ValidatorSetV0. + * @implements IValidatorSetV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set + */ + function ValidatorSetV0(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidatorSetV0 quorumHash. + * @member {Uint8Array} quorumHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.quorumHash = $util.newBuffer([]); + + /** + * ValidatorSetV0 coreHeight. + * @member {number} coreHeight + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.coreHeight = 0; + + /** + * ValidatorSetV0 members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.members = $util.emptyArray; + + /** + * ValidatorSetV0 thresholdPublicKey. + * @member {Uint8Array} thresholdPublicKey + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + */ + ValidatorSetV0.prototype.thresholdPublicKey = $util.newBuffer([]); + + /** + * Creates a new ValidatorSetV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 instance + */ + ValidatorSetV0.create = function create(properties) { + return new ValidatorSetV0(properties); + }; + + /** + * Encodes the specified ValidatorSetV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSetV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHash); + if (message.coreHeight != null && Object.hasOwnProperty.call(message, "coreHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreHeight); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.encode(message.members[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.thresholdPublicKey != null && Object.hasOwnProperty.call(message, "thresholdPublicKey")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.thresholdPublicKey); + return writer; + }; + + /** + * Encodes the specified ValidatorSetV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IValidatorSetV0} message ValidatorSetV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidatorSetV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidatorSetV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSetV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorumHash = reader.bytes(); + break; + case 2: + message.coreHeight = reader.uint32(); + break; + case 3: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.decode(reader, reader.uint32())); + break; + case 4: + message.thresholdPublicKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidatorSetV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidatorSetV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidatorSetV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidatorSetV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) + return "quorumHash: buffer expected"; + if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) + if (!$util.isInteger(message.coreHeight)) + return "coreHeight: integer expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) + if (!(message.thresholdPublicKey && typeof message.thresholdPublicKey.length === "number" || $util.isString(message.thresholdPublicKey))) + return "thresholdPublicKey: buffer expected"; + return null; + }; + + /** + * Creates a ValidatorSetV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} ValidatorSetV0 + */ + ValidatorSetV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0(); + if (object.quorumHash != null) + if (typeof object.quorumHash === "string") + $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); + else if (object.quorumHash.length >= 0) + message.quorumHash = object.quorumHash; + if (object.coreHeight != null) + message.coreHeight = object.coreHeight >>> 0; + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.fromObject(object.members[i]); + } + } + if (object.thresholdPublicKey != null) + if (typeof object.thresholdPublicKey === "string") + $util.base64.decode(object.thresholdPublicKey, message.thresholdPublicKey = $util.newBuffer($util.base64.length(object.thresholdPublicKey)), 0); + else if (object.thresholdPublicKey.length >= 0) + message.thresholdPublicKey = object.thresholdPublicKey; + return message; + }; + + /** + * Creates a plain object from a ValidatorSetV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0} message ValidatorSetV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidatorSetV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + if (options.bytes === String) + object.quorumHash = ""; + else { + object.quorumHash = []; + if (options.bytes !== Array) + object.quorumHash = $util.newBuffer(object.quorumHash); + } + object.coreHeight = 0; + if (options.bytes === String) + object.thresholdPublicKey = ""; + else { + object.thresholdPublicKey = []; + if (options.bytes !== Array) + object.thresholdPublicKey = $util.newBuffer(object.thresholdPublicKey); + } + } + if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) + object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; + if (message.coreHeight != null && message.hasOwnProperty("coreHeight")) + object.coreHeight = message.coreHeight; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorV0.toObject(message.members[j], options); + } + if (message.thresholdPublicKey != null && message.hasOwnProperty("thresholdPublicKey")) + object.thresholdPublicKey = options.bytes === String ? $util.base64.encode(message.thresholdPublicKey, 0, message.thresholdPublicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.thresholdPublicKey) : message.thresholdPublicKey; + return object; + }; + + /** + * Converts this ValidatorSetV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0 + * @instance + * @returns {Object.} JSON object + */ + ValidatorSetV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidatorSetV0; + })(); + + GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 = (function() { + + /** + * Properties of a GetCurrentQuorumsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @interface IGetCurrentQuorumsInfoResponseV0 + * @property {Array.|null} [quorumHashes] GetCurrentQuorumsInfoResponseV0 quorumHashes + * @property {Uint8Array|null} [currentQuorumHash] GetCurrentQuorumsInfoResponseV0 currentQuorumHash + * @property {Array.|null} [validatorSets] GetCurrentQuorumsInfoResponseV0 validatorSets + * @property {Uint8Array|null} [lastBlockProposer] GetCurrentQuorumsInfoResponseV0 lastBlockProposer + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetCurrentQuorumsInfoResponseV0 metadata + */ + + /** + * Constructs a new GetCurrentQuorumsInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse + * @classdesc Represents a GetCurrentQuorumsInfoResponseV0. + * @implements IGetCurrentQuorumsInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set + */ + function GetCurrentQuorumsInfoResponseV0(properties) { + this.quorumHashes = []; + this.validatorSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCurrentQuorumsInfoResponseV0 quorumHashes. + * @member {Array.} quorumHashes + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.quorumHashes = $util.emptyArray; + + /** + * GetCurrentQuorumsInfoResponseV0 currentQuorumHash. + * @member {Uint8Array} currentQuorumHash + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.currentQuorumHash = $util.newBuffer([]); + + /** + * GetCurrentQuorumsInfoResponseV0 validatorSets. + * @member {Array.} validatorSets + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.validatorSets = $util.emptyArray; + + /** + * GetCurrentQuorumsInfoResponseV0 lastBlockProposer. + * @member {Uint8Array} lastBlockProposer + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.lastBlockProposer = $util.newBuffer([]); + + /** + * GetCurrentQuorumsInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + */ + GetCurrentQuorumsInfoResponseV0.prototype.metadata = null; + + /** + * Creates a new GetCurrentQuorumsInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 instance + */ + GetCurrentQuorumsInfoResponseV0.create = function create(properties) { + return new GetCurrentQuorumsInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumHashes != null && message.quorumHashes.length) + for (var i = 0; i < message.quorumHashes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorumHashes[i]); + if (message.currentQuorumHash != null && Object.hasOwnProperty.call(message, "currentQuorumHash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.currentQuorumHash); + if (message.validatorSets != null && message.validatorSets.length) + for (var i = 0; i < message.validatorSets.length; ++i) + $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.encode(message.validatorSets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastBlockProposer != null && Object.hasOwnProperty.call(message, "lastBlockProposer")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.lastBlockProposer); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetCurrentQuorumsInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.IGetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCurrentQuorumsInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quorumHashes && message.quorumHashes.length)) + message.quorumHashes = []; + message.quorumHashes.push(reader.bytes()); + break; + case 2: + message.currentQuorumHash = reader.bytes(); + break; + case 3: + if (!(message.validatorSets && message.validatorSets.length)) + message.validatorSets = []; + message.validatorSets.push($root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.decode(reader, reader.uint32())); + break; + case 4: + message.lastBlockProposer = reader.bytes(); + break; + case 5: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetCurrentQuorumsInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCurrentQuorumsInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCurrentQuorumsInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCurrentQuorumsInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumHashes != null && message.hasOwnProperty("quorumHashes")) { + if (!Array.isArray(message.quorumHashes)) + return "quorumHashes: array expected"; + for (var i = 0; i < message.quorumHashes.length; ++i) + if (!(message.quorumHashes[i] && typeof message.quorumHashes[i].length === "number" || $util.isString(message.quorumHashes[i]))) + return "quorumHashes: buffer[] expected"; + } + if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) + if (!(message.currentQuorumHash && typeof message.currentQuorumHash.length === "number" || $util.isString(message.currentQuorumHash))) + return "currentQuorumHash: buffer expected"; + if (message.validatorSets != null && message.hasOwnProperty("validatorSets")) { + if (!Array.isArray(message.validatorSets)) + return "validatorSets: array expected"; + for (var i = 0; i < message.validatorSets.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.verify(message.validatorSets[i]); + if (error) + return "validatorSets." + error; + } + } + if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) + if (!(message.lastBlockProposer && typeof message.lastBlockProposer.length === "number" || $util.isString(message.lastBlockProposer))) + return "lastBlockProposer: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetCurrentQuorumsInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} GetCurrentQuorumsInfoResponseV0 + */ + GetCurrentQuorumsInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0(); + if (object.quorumHashes) { + if (!Array.isArray(object.quorumHashes)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.quorumHashes: array expected"); + message.quorumHashes = []; + for (var i = 0; i < object.quorumHashes.length; ++i) + if (typeof object.quorumHashes[i] === "string") + $util.base64.decode(object.quorumHashes[i], message.quorumHashes[i] = $util.newBuffer($util.base64.length(object.quorumHashes[i])), 0); + else if (object.quorumHashes[i].length >= 0) + message.quorumHashes[i] = object.quorumHashes[i]; + } + if (object.currentQuorumHash != null) + if (typeof object.currentQuorumHash === "string") + $util.base64.decode(object.currentQuorumHash, message.currentQuorumHash = $util.newBuffer($util.base64.length(object.currentQuorumHash)), 0); + else if (object.currentQuorumHash.length >= 0) + message.currentQuorumHash = object.currentQuorumHash; + if (object.validatorSets) { + if (!Array.isArray(object.validatorSets)) + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: array expected"); + message.validatorSets = []; + for (var i = 0; i < object.validatorSets.length; ++i) { + if (typeof object.validatorSets[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.validatorSets: object expected"); + message.validatorSets[i] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.fromObject(object.validatorSets[i]); + } + } + if (object.lastBlockProposer != null) + if (typeof object.lastBlockProposer === "string") + $util.base64.decode(object.lastBlockProposer, message.lastBlockProposer = $util.newBuffer($util.base64.length(object.lastBlockProposer)), 0); + else if (object.lastBlockProposer.length >= 0) + message.lastBlockProposer = object.lastBlockProposer; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetCurrentQuorumsInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0} message GetCurrentQuorumsInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCurrentQuorumsInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quorumHashes = []; + object.validatorSets = []; + } + if (options.defaults) { + if (options.bytes === String) + object.currentQuorumHash = ""; + else { + object.currentQuorumHash = []; + if (options.bytes !== Array) + object.currentQuorumHash = $util.newBuffer(object.currentQuorumHash); + } + if (options.bytes === String) + object.lastBlockProposer = ""; + else { + object.lastBlockProposer = []; + if (options.bytes !== Array) + object.lastBlockProposer = $util.newBuffer(object.lastBlockProposer); + } + object.metadata = null; + } + if (message.quorumHashes && message.quorumHashes.length) { + object.quorumHashes = []; + for (var j = 0; j < message.quorumHashes.length; ++j) + object.quorumHashes[j] = options.bytes === String ? $util.base64.encode(message.quorumHashes[j], 0, message.quorumHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHashes[j]) : message.quorumHashes[j]; + } + if (message.currentQuorumHash != null && message.hasOwnProperty("currentQuorumHash")) + object.currentQuorumHash = options.bytes === String ? $util.base64.encode(message.currentQuorumHash, 0, message.currentQuorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.currentQuorumHash) : message.currentQuorumHash; + if (message.validatorSets && message.validatorSets.length) { + object.validatorSets = []; + for (var j = 0; j < message.validatorSets.length; ++j) + object.validatorSets[j] = $root.org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.ValidatorSetV0.toObject(message.validatorSets[j], options); + } + if (message.lastBlockProposer != null && message.hasOwnProperty("lastBlockProposer")) + object.lastBlockProposer = options.bytes === String ? $util.base64.encode(message.lastBlockProposer, 0, message.lastBlockProposer.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockProposer) : message.lastBlockProposer; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetCurrentQuorumsInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetCurrentQuorumsInfoResponse.GetCurrentQuorumsInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetCurrentQuorumsInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCurrentQuorumsInfoResponseV0; + })(); + + return GetCurrentQuorumsInfoResponse; + })(); + + v0.GetIdentityTokenBalancesRequest = (function() { + + /** + * Properties of a GetIdentityTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null} [v0] GetIdentityTokenBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentityTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenBalancesRequest. + * @implements IGetIdentityTokenBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set + */ + function GetIdentityTokenBalancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + */ + GetIdentityTokenBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest instance + */ + GetIdentityTokenBalancesRequest.create = function create(properties) { + return new GetIdentityTokenBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} GetIdentityTokenBalancesRequest + */ + GetIdentityTokenBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest} message GetIdentityTokenBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentityTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @interface IGetIdentityTokenBalancesRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityTokenBalancesRequestV0 identityId + * @property {Array.|null} [tokenIds] GetIdentityTokenBalancesRequestV0 tokenIds + * @property {boolean|null} [prove] GetIdentityTokenBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentityTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest + * @classdesc Represents a GetIdentityTokenBalancesRequestV0. + * @implements IGetIdentityTokenBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentityTokenBalancesRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenBalancesRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityTokenBalancesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetIdentityTokenBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + */ + GetIdentityTokenBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityTokenBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 instance + */ + GetIdentityTokenBalancesRequestV0.create = function create(properties) { + return new GetIdentityTokenBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.IGetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} GetIdentityTokenBalancesRequestV0 + */ + GetIdentityTokenBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0} message GetIdentityTokenBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityTokenBalancesRequestV0; + })(); + + return GetIdentityTokenBalancesRequest; + })(); + + v0.GetIdentityTokenBalancesResponse = (function() { + + /** + * Properties of a GetIdentityTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null} [v0] GetIdentityTokenBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentityTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenBalancesResponse. + * @implements IGetIdentityTokenBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set + */ + function GetIdentityTokenBalancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + */ + GetIdentityTokenBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse instance + */ + GetIdentityTokenBalancesResponse.create = function create(properties) { + return new GetIdentityTokenBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} GetIdentityTokenBalancesResponse + */ + GetIdentityTokenBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse} message GetIdentityTokenBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentityTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @interface IGetIdentityTokenBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null} [tokenBalances] GetIdentityTokenBalancesResponseV0 tokenBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse + * @classdesc Represents a GetIdentityTokenBalancesResponseV0. + * @implements IGetIdentityTokenBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentityTokenBalancesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenBalancesResponseV0 tokenBalances. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances|null|undefined} tokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.tokenBalances = null; + + /** + * GetIdentityTokenBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentityTokenBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + GetIdentityTokenBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenBalancesResponseV0 result. + * @member {"tokenBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityTokenBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 instance + */ + GetIdentityTokenBalancesResponseV0.create = function create(properties) { + return new GetIdentityTokenBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenBalances != null && Object.hasOwnProperty.call(message, "tokenBalances")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.encode(message.tokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.IGetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify(message.tokenBalances); + if (error) + return "tokenBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} GetIdentityTokenBalancesResponseV0 + */ + GetIdentityTokenBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0(); + if (object.tokenBalances != null) { + if (typeof object.tokenBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.tokenBalances: object expected"); + message.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.fromObject(object.tokenBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0} message GetIdentityTokenBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + object.tokenBalances = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.toObject(message.tokenBalances, options); + if (options.oneofs) + object.result = "tokenBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityTokenBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenBalancesResponseV0.TokenBalanceEntry = (function() { + + /** + * Properties of a TokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @interface ITokenBalanceEntry + * @property {Uint8Array|null} [tokenId] TokenBalanceEntry tokenId + * @property {number|Long|null} [balance] TokenBalanceEntry balance + */ + + /** + * Constructs a new TokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @classdesc Represents a TokenBalanceEntry. + * @implements ITokenBalanceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set + */ + function TokenBalanceEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenBalanceEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + */ + TokenBalanceEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenBalanceEntry balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + */ + TokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenBalanceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry instance + */ + TokenBalanceEntry.create = function create(properties) { + return new TokenBalanceEntry(properties); + }; + + /** + * Encodes the specified TokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalanceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified TokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalanceEntry} message TokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenBalanceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalanceEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenBalanceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenBalanceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenBalanceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenBalanceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} TokenBalanceEntry + */ + TokenBalanceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a TokenBalanceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry} message TokenBalanceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenBalanceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this TokenBalanceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry + * @instance + * @returns {Object.} JSON object + */ + TokenBalanceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenBalanceEntry; + })(); + + GetIdentityTokenBalancesResponseV0.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] TokenBalances tokenBalances + */ + + /** + * Constructs a new TokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0 + * @classdesc Represents a TokenBalances. + * @implements ITokenBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set + */ + function TokenBalances(properties) { + this.tokenBalances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenBalances tokenBalances. + * @member {Array.} tokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenBalances != null && message.tokenBalances.length) + for (var i = 0; i < message.tokenBalances.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.encode(message.tokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.ITokenBalances} message TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenBalances && message.tokenBalances.length)) + message.tokenBalances = []; + message.tokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenBalances != null && message.hasOwnProperty("tokenBalances")) { + if (!Array.isArray(message.tokenBalances)) + return "tokenBalances: array expected"; + for (var i = 0; i < message.tokenBalances.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.verify(message.tokenBalances[i]); + if (error) + return "tokenBalances." + error; + } + } + return null; + }; + + /** + * Creates a TokenBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} TokenBalances + */ + TokenBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances(); + if (object.tokenBalances) { + if (!Array.isArray(object.tokenBalances)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: array expected"); + message.tokenBalances = []; + for (var i = 0; i < object.tokenBalances.length; ++i) { + if (typeof object.tokenBalances[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances.tokenBalances: object expected"); + message.tokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.fromObject(object.tokenBalances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances} message TokenBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenBalances = []; + if (message.tokenBalances && message.tokenBalances.length) { + object.tokenBalances = []; + for (var j = 0; j < message.tokenBalances.length; ++j) + object.tokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry.toObject(message.tokenBalances[j], options); + } + return object; + }; + + /** + * Converts this TokenBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances + * @instance + * @returns {Object.} JSON object + */ + TokenBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenBalances; + })(); + + return GetIdentityTokenBalancesResponseV0; + })(); + + return GetIdentityTokenBalancesResponse; + })(); + + v0.GetIdentitiesTokenBalancesRequest = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenBalancesRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null} [v0] GetIdentitiesTokenBalancesRequest v0 + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenBalancesRequest. + * @implements IGetIdentitiesTokenBalancesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenBalancesRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + */ + GetIdentitiesTokenBalancesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest instance + */ + GetIdentitiesTokenBalancesRequest.create = function create(properties) { + return new GetIdentitiesTokenBalancesRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} GetIdentitiesTokenBalancesRequest + */ + GetIdentitiesTokenBalancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest} message GetIdentitiesTokenBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @interface IGetIdentitiesTokenBalancesRequestV0 + * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenBalancesRequestV0 tokenId + * @property {Array.|null} [identityIds] GetIdentitiesTokenBalancesRequestV0 identityIds + * @property {boolean|null} [prove] GetIdentitiesTokenBalancesRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest + * @classdesc Represents a GetIdentitiesTokenBalancesRequestV0. + * @implements IGetIdentitiesTokenBalancesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesRequestV0(properties) { + this.identityIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenBalancesRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetIdentitiesTokenBalancesRequestV0 identityIds. + * @member {Array.} identityIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.identityIds = $util.emptyArray; + + /** + * GetIdentitiesTokenBalancesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + */ + GetIdentitiesTokenBalancesRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesTokenBalancesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 instance + */ + GetIdentitiesTokenBalancesRequestV0.create = function create(properties) { + return new GetIdentitiesTokenBalancesRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.identityIds != null && message.identityIds.length) + for (var i = 0; i < message.identityIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.IGetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + if (!(message.identityIds && message.identityIds.length)) + message.identityIds = []; + message.identityIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.identityIds != null && message.hasOwnProperty("identityIds")) { + if (!Array.isArray(message.identityIds)) + return "identityIds: array expected"; + for (var i = 0; i < message.identityIds.length; ++i) + if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) + return "identityIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} GetIdentitiesTokenBalancesRequestV0 + */ + GetIdentitiesTokenBalancesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.identityIds) { + if (!Array.isArray(object.identityIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0.identityIds: array expected"); + message.identityIds = []; + for (var i = 0; i < object.identityIds.length; ++i) + if (typeof object.identityIds[i] === "string") + $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); + else if (object.identityIds[i].length >= 0) + message.identityIds[i] = object.identityIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0} message GetIdentitiesTokenBalancesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityIds = []; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.identityIds && message.identityIds.length) { + object.identityIds = []; + for (var j = 0; j < message.identityIds.length; ++j) + object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesTokenBalancesRequestV0; + })(); + + return GetIdentitiesTokenBalancesRequest; + })(); + + v0.GetIdentitiesTokenBalancesResponse = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenBalancesResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null} [v0] GetIdentitiesTokenBalancesResponse v0 + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenBalancesResponse. + * @implements IGetIdentitiesTokenBalancesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenBalancesResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + */ + GetIdentitiesTokenBalancesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse instance + */ + GetIdentitiesTokenBalancesResponse.create = function create(properties) { + return new GetIdentitiesTokenBalancesResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} GetIdentitiesTokenBalancesResponse + */ + GetIdentitiesTokenBalancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse} message GetIdentitiesTokenBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @interface IGetIdentitiesTokenBalancesResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null} [identityTokenBalances] GetIdentitiesTokenBalancesResponseV0 identityTokenBalances + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenBalancesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenBalancesResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesTokenBalancesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse + * @classdesc Represents a GetIdentitiesTokenBalancesResponseV0. + * @implements IGetIdentitiesTokenBalancesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set + */ + function GetIdentitiesTokenBalancesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenBalancesResponseV0 identityTokenBalances. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances|null|undefined} identityTokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.identityTokenBalances = null; + + /** + * GetIdentitiesTokenBalancesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.proof = null; + + /** + * GetIdentitiesTokenBalancesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + GetIdentitiesTokenBalancesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenBalancesResponseV0 result. + * @member {"identityTokenBalances"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesTokenBalancesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityTokenBalances", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenBalancesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 instance + */ + GetIdentitiesTokenBalancesResponseV0.create = function create(properties) { + return new GetIdentitiesTokenBalancesResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenBalances != null && Object.hasOwnProperty.call(message, "identityTokenBalances")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.encode(message.identityTokenBalances, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenBalancesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.IGetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenBalancesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenBalancesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenBalancesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenBalancesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenBalancesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify(message.identityTokenBalances); + if (error) + return "identityTokenBalances." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenBalancesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} GetIdentitiesTokenBalancesResponseV0 + */ + GetIdentitiesTokenBalancesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0(); + if (object.identityTokenBalances != null) { + if (typeof object.identityTokenBalances !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.identityTokenBalances: object expected"); + message.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.fromObject(object.identityTokenBalances); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenBalancesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0} message GetIdentitiesTokenBalancesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenBalancesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + object.identityTokenBalances = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.toObject(message.identityTokenBalances, options); + if (options.oneofs) + object.result = "identityTokenBalances"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesTokenBalancesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenBalancesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry = (function() { + + /** + * Properties of an IdentityTokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @interface IIdentityTokenBalanceEntry + * @property {Uint8Array|null} [identityId] IdentityTokenBalanceEntry identityId + * @property {number|Long|null} [balance] IdentityTokenBalanceEntry balance + */ + + /** + * Constructs a new IdentityTokenBalanceEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @classdesc Represents an IdentityTokenBalanceEntry. + * @implements IIdentityTokenBalanceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set + */ + function IdentityTokenBalanceEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityTokenBalanceEntry identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + */ + IdentityTokenBalanceEntry.prototype.identityId = $util.newBuffer([]); + + /** + * IdentityTokenBalanceEntry balance. + * @member {number|Long} balance + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + */ + IdentityTokenBalanceEntry.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new IdentityTokenBalanceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry instance + */ + IdentityTokenBalanceEntry.create = function create(properties) { + return new IdentityTokenBalanceEntry(properties); + }; + + /** + * Encodes the specified IdentityTokenBalanceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalanceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.balance); + return writer; + }; + + /** + * Encodes the specified IdentityTokenBalanceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalanceEntry} message IdentityTokenBalanceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalanceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalanceEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.balance = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenBalanceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalanceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenBalanceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenBalanceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) + if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high))) + return "balance: integer|Long expected"; + return null; + }; + + /** + * Creates an IdentityTokenBalanceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} IdentityTokenBalanceEntry + */ + IdentityTokenBalanceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.balance != null) + if ($util.Long) + (message.balance = $util.Long.fromValue(object.balance)).unsigned = true; + else if (typeof object.balance === "string") + message.balance = parseInt(object.balance, 10); + else if (typeof object.balance === "number") + message.balance = object.balance; + else if (typeof object.balance === "object") + message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an IdentityTokenBalanceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry} message IdentityTokenBalanceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenBalanceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.balance = options.longs === String ? "0" : 0; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.balance != null && message.hasOwnProperty("balance")) + if (typeof message.balance === "number") + object.balance = options.longs === String ? String(message.balance) : message.balance; + else + object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber(true) : message.balance; + return object; + }; + + /** + * Converts this IdentityTokenBalanceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenBalanceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenBalanceEntry; + })(); + + GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances = (function() { + + /** + * Properties of an IdentityTokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @interface IIdentityTokenBalances + * @property {Array.|null} [identityTokenBalances] IdentityTokenBalances identityTokenBalances + */ + + /** + * Constructs a new IdentityTokenBalances. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0 + * @classdesc Represents an IdentityTokenBalances. + * @implements IIdentityTokenBalances + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set + */ + function IdentityTokenBalances(properties) { + this.identityTokenBalances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityTokenBalances identityTokenBalances. + * @member {Array.} identityTokenBalances + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @instance + */ + IdentityTokenBalances.prototype.identityTokenBalances = $util.emptyArray; + + /** + * Creates a new IdentityTokenBalances instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances instance + */ + IdentityTokenBalances.create = function create(properties) { + return new IdentityTokenBalances(properties); + }; + + /** + * Encodes the specified IdentityTokenBalances message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenBalances != null && message.identityTokenBalances.length) + for (var i = 0; i < message.identityTokenBalances.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.encode(message.identityTokenBalances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityTokenBalances message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IIdentityTokenBalances} message IdentityTokenBalances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenBalances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenBalances message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalances.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identityTokenBalances && message.identityTokenBalances.length)) + message.identityTokenBalances = []; + message.identityTokenBalances.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenBalances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenBalances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenBalances message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenBalances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityTokenBalances != null && message.hasOwnProperty("identityTokenBalances")) { + if (!Array.isArray(message.identityTokenBalances)) + return "identityTokenBalances: array expected"; + for (var i = 0; i < message.identityTokenBalances.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.verify(message.identityTokenBalances[i]); + if (error) + return "identityTokenBalances." + error; + } + } + return null; + }; + + /** + * Creates an IdentityTokenBalances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} IdentityTokenBalances + */ + IdentityTokenBalances.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances(); + if (object.identityTokenBalances) { + if (!Array.isArray(object.identityTokenBalances)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: array expected"); + message.identityTokenBalances = []; + for (var i = 0; i < object.identityTokenBalances.length; ++i) { + if (typeof object.identityTokenBalances[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances.identityTokenBalances: object expected"); + message.identityTokenBalances[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.fromObject(object.identityTokenBalances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityTokenBalances message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances} message IdentityTokenBalances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenBalances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityTokenBalances = []; + if (message.identityTokenBalances && message.identityTokenBalances.length) { + object.identityTokenBalances = []; + for (var j = 0; j < message.identityTokenBalances.length; ++j) + object.identityTokenBalances[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry.toObject(message.identityTokenBalances[j], options); + } + return object; + }; + + /** + * Converts this IdentityTokenBalances to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenBalances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenBalances; + })(); + + return GetIdentitiesTokenBalancesResponseV0; + })(); + + return GetIdentitiesTokenBalancesResponse; + })(); + + v0.GetIdentityTokenInfosRequest = (function() { + + /** + * Properties of a GetIdentityTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenInfosRequest + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null} [v0] GetIdentityTokenInfosRequest v0 + */ + + /** + * Constructs a new GetIdentityTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenInfosRequest. + * @implements IGetIdentityTokenInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set + */ + function GetIdentityTokenInfosRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + */ + GetIdentityTokenInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest instance + */ + GetIdentityTokenInfosRequest.create = function create(properties) { + return new GetIdentityTokenInfosRequest(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} GetIdentityTokenInfosRequest + */ + GetIdentityTokenInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest} message GetIdentityTokenInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 = (function() { + + /** + * Properties of a GetIdentityTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @interface IGetIdentityTokenInfosRequestV0 + * @property {Uint8Array|null} [identityId] GetIdentityTokenInfosRequestV0 identityId + * @property {Array.|null} [tokenIds] GetIdentityTokenInfosRequestV0 tokenIds + * @property {boolean|null} [prove] GetIdentityTokenInfosRequestV0 prove + */ + + /** + * Constructs a new GetIdentityTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest + * @classdesc Represents a GetIdentityTokenInfosRequestV0. + * @implements IGetIdentityTokenInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set + */ + function GetIdentityTokenInfosRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenInfosRequestV0 identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.identityId = $util.newBuffer([]); + + /** + * GetIdentityTokenInfosRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetIdentityTokenInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + */ + GetIdentityTokenInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentityTokenInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 instance + */ + GetIdentityTokenInfosRequestV0.create = function create(properties) { + return new GetIdentityTokenInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.IGetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} GetIdentityTokenInfosRequestV0 + */ + GetIdentityTokenInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0} message GetIdentityTokenInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.prove = false; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityTokenInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosRequest.GetIdentityTokenInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityTokenInfosRequestV0; + })(); + + return GetIdentityTokenInfosRequest; + })(); + + v0.GetIdentityTokenInfosResponse = (function() { + + /** + * Properties of a GetIdentityTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityTokenInfosResponse + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null} [v0] GetIdentityTokenInfosResponse v0 + */ + + /** + * Constructs a new GetIdentityTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityTokenInfosResponse. + * @implements IGetIdentityTokenInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set + */ + function GetIdentityTokenInfosResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + */ + GetIdentityTokenInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse instance + */ + GetIdentityTokenInfosResponse.create = function create(properties) { + return new GetIdentityTokenInfosResponse(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} GetIdentityTokenInfosResponse + */ + GetIdentityTokenInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse} message GetIdentityTokenInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentityTokenInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 = (function() { + + /** + * Properties of a GetIdentityTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @interface IGetIdentityTokenInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null} [tokenInfos] GetIdentityTokenInfosResponseV0 tokenInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityTokenInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityTokenInfosResponseV0 metadata + */ + + /** + * Constructs a new GetIdentityTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse + * @classdesc Represents a GetIdentityTokenInfosResponseV0. + * @implements IGetIdentityTokenInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set + */ + function GetIdentityTokenInfosResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityTokenInfosResponseV0 tokenInfos. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos|null|undefined} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.tokenInfos = null; + + /** + * GetIdentityTokenInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.proof = null; + + /** + * GetIdentityTokenInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + GetIdentityTokenInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityTokenInfosResponseV0 result. + * @member {"tokenInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + */ + Object.defineProperty(GetIdentityTokenInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityTokenInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 instance + */ + GetIdentityTokenInfosResponseV0.create = function create(properties) { + return new GetIdentityTokenInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && Object.hasOwnProperty.call(message, "tokenInfos")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.encode(message.tokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.IGetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityTokenInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityTokenInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityTokenInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify(message.tokenInfos); + if (error) + return "tokenInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} GetIdentityTokenInfosResponseV0 + */ + GetIdentityTokenInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0(); + if (object.tokenInfos != null) { + if (typeof object.tokenInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.tokenInfos: object expected"); + message.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.fromObject(object.tokenInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityTokenInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0} message GetIdentityTokenInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityTokenInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + object.tokenInfos = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.toObject(message.tokenInfos, options); + if (options.oneofs) + object.result = "tokenInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityTokenInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentityTokenInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { + + /** + * Properties of a TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenIdentityInfoEntry + * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen + */ + + /** + * Constructs a new TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenIdentityInfoEntry. + * @implements ITokenIdentityInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + */ + function TokenIdentityInfoEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenIdentityInfoEntry frozen. + * @member {boolean} frozen + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + */ + TokenIdentityInfoEntry.prototype.frozen = false; + + /** + * Creates a new TokenIdentityInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance + */ + TokenIdentityInfoEntry.create = function create(properties) { + return new TokenIdentityInfoEntry(properties); + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); + return writer; + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozen = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenIdentityInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenIdentityInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozen != null && message.hasOwnProperty("frozen")) + if (typeof message.frozen !== "boolean") + return "frozen: boolean expected"; + return null; + }; + + /** + * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + */ + TokenIdentityInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry(); + if (object.frozen != null) + message.frozen = Boolean(object.frozen); + return message; + }; + + /** + * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenIdentityInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frozen = false; + if (message.frozen != null && message.hasOwnProperty("frozen")) + object.frozen = message.frozen; + return object; + }; + + /** + * Converts this TokenIdentityInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenIdentityInfoEntry; + })(); + + GetIdentityTokenInfosResponseV0.TokenInfoEntry = (function() { + + /** + * Properties of a TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenInfoEntry + * @property {Uint8Array|null} [tokenId] TokenInfoEntry tokenId + * @property {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info + */ + + /** + * Constructs a new TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenInfoEntry. + * @implements ITokenInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + */ + function TokenInfoEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenInfoEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenInfoEntry info. + * @member {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.info = null; + + /** + * Creates a new TokenInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance + */ + TokenInfoEntry.create = function create(properties) { + return new TokenInfoEntry(properties); + }; + + /** + * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); + if (error) + return "info." + error; + } + return null; + }; + + /** + * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + */ + TokenInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.info: object expected"); + message.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); + } + return message; + }; + + /** + * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.info = null; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); + return object; + }; + + /** + * Converts this TokenInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfoEntry; + })(); + + GetIdentityTokenInfosResponseV0.TokenInfos = (function() { + + /** + * Properties of a TokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @interface ITokenInfos + * @property {Array.|null} [tokenInfos] TokenInfos tokenInfos + */ + + /** + * Constructs a new TokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0 + * @classdesc Represents a TokenInfos. + * @implements ITokenInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set + */ + function TokenInfos(properties) { + this.tokenInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenInfos tokenInfos. + * @member {Array.} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @instance + */ + TokenInfos.prototype.tokenInfos = $util.emptyArray; + + /** + * Creates a new TokenInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos instance + */ + TokenInfos.create = function create(properties) { + return new TokenInfos(properties); + }; + + /** + * Encodes the specified TokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && message.tokenInfos.length) + for (var i = 0; i < message.tokenInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.ITokenInfos} message TokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfos.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenInfos && message.tokenInfos.length)) + message.tokenInfos = []; + message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + if (!Array.isArray(message.tokenInfos)) + return "tokenInfos: array expected"; + for (var i = 0; i < message.tokenInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); + if (error) + return "tokenInfos." + error; + } + } + return null; + }; + + /** + * Creates a TokenInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} TokenInfos + */ + TokenInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos(); + if (object.tokenInfos) { + if (!Array.isArray(object.tokenInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: array expected"); + message.tokenInfos = []; + for (var i = 0; i < object.tokenInfos.length; ++i) { + if (typeof object.tokenInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos.tokenInfos: object expected"); + message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos} message TokenInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenInfos = []; + if (message.tokenInfos && message.tokenInfos.length) { + object.tokenInfos = []; + for (var j = 0; j < message.tokenInfos.length; ++j) + object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); + } + return object; + }; + + /** + * Converts this TokenInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityTokenInfosResponse.GetIdentityTokenInfosResponseV0.TokenInfos + * @instance + * @returns {Object.} JSON object + */ + TokenInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfos; + })(); + + return GetIdentityTokenInfosResponseV0; + })(); + + return GetIdentityTokenInfosResponse; + })(); + + v0.GetIdentitiesTokenInfosRequest = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenInfosRequest + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null} [v0] GetIdentitiesTokenInfosRequest v0 + */ + + /** + * Constructs a new GetIdentitiesTokenInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenInfosRequest. + * @implements IGetIdentitiesTokenInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + */ + GetIdentitiesTokenInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest instance + */ + GetIdentitiesTokenInfosRequest.create = function create(properties) { + return new GetIdentitiesTokenInfosRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} GetIdentitiesTokenInfosRequest + */ + GetIdentitiesTokenInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest} message GetIdentitiesTokenInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @interface IGetIdentitiesTokenInfosRequestV0 + * @property {Uint8Array|null} [tokenId] GetIdentitiesTokenInfosRequestV0 tokenId + * @property {Array.|null} [identityIds] GetIdentitiesTokenInfosRequestV0 identityIds + * @property {boolean|null} [prove] GetIdentitiesTokenInfosRequestV0 prove + */ + + /** + * Constructs a new GetIdentitiesTokenInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest + * @classdesc Represents a GetIdentitiesTokenInfosRequestV0. + * @implements IGetIdentitiesTokenInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosRequestV0(properties) { + this.identityIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenInfosRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetIdentitiesTokenInfosRequestV0 identityIds. + * @member {Array.} identityIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.identityIds = $util.emptyArray; + + /** + * GetIdentitiesTokenInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + */ + GetIdentitiesTokenInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetIdentitiesTokenInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 instance + */ + GetIdentitiesTokenInfosRequestV0.create = function create(properties) { + return new GetIdentitiesTokenInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.identityIds != null && message.identityIds.length) + for (var i = 0; i < message.identityIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.identityIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.IGetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + if (!(message.identityIds && message.identityIds.length)) + message.identityIds = []; + message.identityIds.push(reader.bytes()); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.identityIds != null && message.hasOwnProperty("identityIds")) { + if (!Array.isArray(message.identityIds)) + return "identityIds: array expected"; + for (var i = 0; i < message.identityIds.length; ++i) + if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) + return "identityIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} GetIdentitiesTokenInfosRequestV0 + */ + GetIdentitiesTokenInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.identityIds) { + if (!Array.isArray(object.identityIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0.identityIds: array expected"); + message.identityIds = []; + for (var i = 0; i < object.identityIds.length; ++i) + if (typeof object.identityIds[i] === "string") + $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); + else if (object.identityIds[i].length >= 0) + message.identityIds[i] = object.identityIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0} message GetIdentitiesTokenInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identityIds = []; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.identityIds && message.identityIds.length) { + object.identityIds = []; + for (var j = 0; j < message.identityIds.length; ++j) + object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosRequest.GetIdentitiesTokenInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesTokenInfosRequestV0; + })(); + + return GetIdentitiesTokenInfosRequest; + })(); + + v0.GetIdentitiesTokenInfosResponse = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesTokenInfosResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null} [v0] GetIdentitiesTokenInfosResponse v0 + */ + + /** + * Constructs a new GetIdentitiesTokenInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesTokenInfosResponse. + * @implements IGetIdentitiesTokenInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + */ + GetIdentitiesTokenInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse instance + */ + GetIdentitiesTokenInfosResponse.create = function create(properties) { + return new GetIdentitiesTokenInfosResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} GetIdentitiesTokenInfosResponse + */ + GetIdentitiesTokenInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse} message GetIdentitiesTokenInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 = (function() { + + /** + * Properties of a GetIdentitiesTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @interface IGetIdentitiesTokenInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null} [identityTokenInfos] GetIdentitiesTokenInfosResponseV0 identityTokenInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesTokenInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesTokenInfosResponseV0 metadata + */ + + /** + * Constructs a new GetIdentitiesTokenInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse + * @classdesc Represents a GetIdentitiesTokenInfosResponseV0. + * @implements IGetIdentitiesTokenInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set + */ + function GetIdentitiesTokenInfosResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesTokenInfosResponseV0 identityTokenInfos. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos|null|undefined} identityTokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.identityTokenInfos = null; + + /** + * GetIdentitiesTokenInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.proof = null; + + /** + * GetIdentitiesTokenInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + GetIdentitiesTokenInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesTokenInfosResponseV0 result. + * @member {"identityTokenInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + */ + Object.defineProperty(GetIdentitiesTokenInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identityTokenInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesTokenInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 instance + */ + GetIdentitiesTokenInfosResponseV0.create = function create(properties) { + return new GetIdentitiesTokenInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityTokenInfos != null && Object.hasOwnProperty.call(message, "identityTokenInfos")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.encode(message.identityTokenInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesTokenInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.IGetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesTokenInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesTokenInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesTokenInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesTokenInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesTokenInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify(message.identityTokenInfos); + if (error) + return "identityTokenInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesTokenInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} GetIdentitiesTokenInfosResponseV0 + */ + GetIdentitiesTokenInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0(); + if (object.identityTokenInfos != null) { + if (typeof object.identityTokenInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.identityTokenInfos: object expected"); + message.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.fromObject(object.identityTokenInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesTokenInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0} message GetIdentitiesTokenInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesTokenInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identityTokenInfos != null && message.hasOwnProperty("identityTokenInfos")) { + object.identityTokenInfos = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.toObject(message.identityTokenInfos, options); + if (options.oneofs) + object.result = "identityTokenInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesTokenInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesTokenInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry = (function() { + + /** + * Properties of a TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface ITokenIdentityInfoEntry + * @property {boolean|null} [frozen] TokenIdentityInfoEntry frozen + */ + + /** + * Constructs a new TokenIdentityInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents a TokenIdentityInfoEntry. + * @implements ITokenIdentityInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + */ + function TokenIdentityInfoEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenIdentityInfoEntry frozen. + * @member {boolean} frozen + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + */ + TokenIdentityInfoEntry.prototype.frozen = false; + + /** + * Creates a new TokenIdentityInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry instance + */ + TokenIdentityInfoEntry.create = function create(properties) { + return new TokenIdentityInfoEntry(properties); + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozen != null && Object.hasOwnProperty.call(message, "frozen")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.frozen); + return writer; + }; + + /** + * Encodes the specified TokenIdentityInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry} message TokenIdentityInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenIdentityInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozen = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenIdentityInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenIdentityInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenIdentityInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenIdentityInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozen != null && message.hasOwnProperty("frozen")) + if (typeof message.frozen !== "boolean") + return "frozen: boolean expected"; + return null; + }; + + /** + * Creates a TokenIdentityInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} TokenIdentityInfoEntry + */ + TokenIdentityInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry(); + if (object.frozen != null) + message.frozen = Boolean(object.frozen); + return message; + }; + + /** + * Creates a plain object from a TokenIdentityInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry} message TokenIdentityInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenIdentityInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.frozen = false; + if (message.frozen != null && message.hasOwnProperty("frozen")) + object.frozen = message.frozen; + return object; + }; + + /** + * Converts this TokenIdentityInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenIdentityInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenIdentityInfoEntry; + })(); + + GetIdentitiesTokenInfosResponseV0.TokenInfoEntry = (function() { + + /** + * Properties of a TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface ITokenInfoEntry + * @property {Uint8Array|null} [identityId] TokenInfoEntry identityId + * @property {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null} [info] TokenInfoEntry info + */ + + /** + * Constructs a new TokenInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents a TokenInfoEntry. + * @implements ITokenInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + */ + function TokenInfoEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenInfoEntry identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.identityId = $util.newBuffer([]); + + /** + * TokenInfoEntry info. + * @member {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenIdentityInfoEntry|null|undefined} info + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + */ + TokenInfoEntry.prototype.info = null; + + /** + * Creates a new TokenInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry instance + */ + TokenInfoEntry.create = function create(properties) { + return new TokenInfoEntry(properties); + }; + + /** + * Encodes the specified TokenInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.encode(message.info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.ITokenInfoEntry} message TokenInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identityId = reader.bytes(); + break; + case 2: + message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.verify(message.info); + if (error) + return "info." + error; + } + return null; + }; + + /** + * Creates a TokenInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} TokenInfoEntry + */ + TokenInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.info: object expected"); + message.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.fromObject(object.info); + } + return message; + }; + + /** + * Creates a plain object from a TokenInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry} message TokenInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.info = null; + } + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenIdentityInfoEntry.toObject(message.info, options); + return object; + }; + + /** + * Converts this TokenInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry + * @instance + * @returns {Object.} JSON object + */ + TokenInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenInfoEntry; + })(); + + GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos = (function() { + + /** + * Properties of an IdentityTokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @interface IIdentityTokenInfos + * @property {Array.|null} [tokenInfos] IdentityTokenInfos tokenInfos + */ + + /** + * Constructs a new IdentityTokenInfos. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0 + * @classdesc Represents an IdentityTokenInfos. + * @implements IIdentityTokenInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set + */ + function IdentityTokenInfos(properties) { + this.tokenInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityTokenInfos tokenInfos. + * @member {Array.} tokenInfos + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @instance + */ + IdentityTokenInfos.prototype.tokenInfos = $util.emptyArray; + + /** + * Creates a new IdentityTokenInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos instance + */ + IdentityTokenInfos.create = function create(properties) { + return new IdentityTokenInfos(properties); + }; + + /** + * Encodes the specified IdentityTokenInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenInfos != null && message.tokenInfos.length) + for (var i = 0; i < message.tokenInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.encode(message.tokenInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityTokenInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IIdentityTokenInfos} message IdentityTokenInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityTokenInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityTokenInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenInfos.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenInfos && message.tokenInfos.length)) + message.tokenInfos = []; + message.tokenInfos.push($root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityTokenInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityTokenInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityTokenInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityTokenInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenInfos != null && message.hasOwnProperty("tokenInfos")) { + if (!Array.isArray(message.tokenInfos)) + return "tokenInfos: array expected"; + for (var i = 0; i < message.tokenInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.verify(message.tokenInfos[i]); + if (error) + return "tokenInfos." + error; + } + } + return null; + }; + + /** + * Creates an IdentityTokenInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} IdentityTokenInfos + */ + IdentityTokenInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos(); + if (object.tokenInfos) { + if (!Array.isArray(object.tokenInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: array expected"); + message.tokenInfos = []; + for (var i = 0; i < object.tokenInfos.length; ++i) { + if (typeof object.tokenInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos.tokenInfos: object expected"); + message.tokenInfos[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.fromObject(object.tokenInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityTokenInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos} message IdentityTokenInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityTokenInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenInfos = []; + if (message.tokenInfos && message.tokenInfos.length) { + object.tokenInfos = []; + for (var j = 0; j < message.tokenInfos.length; ++j) + object.tokenInfos[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.TokenInfoEntry.toObject(message.tokenInfos[j], options); + } + return object; + }; + + /** + * Converts this IdentityTokenInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesTokenInfosResponse.GetIdentitiesTokenInfosResponseV0.IdentityTokenInfos + * @instance + * @returns {Object.} JSON object + */ + IdentityTokenInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityTokenInfos; + })(); + + return GetIdentitiesTokenInfosResponseV0; + })(); + + return GetIdentitiesTokenInfosResponse; + })(); + + v0.GetTokenStatusesRequest = (function() { + + /** + * Properties of a GetTokenStatusesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenStatusesRequest + * @property {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null} [v0] GetTokenStatusesRequest v0 + */ + + /** + * Constructs a new GetTokenStatusesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenStatusesRequest. + * @implements IGetTokenStatusesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set + */ + function GetTokenStatusesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenStatusesRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + */ + GetTokenStatusesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + */ + Object.defineProperty(GetTokenStatusesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest instance + */ + GetTokenStatusesRequest.create = function create(properties) { + return new GetTokenStatusesRequest(properties); + }; + + /** + * Encodes the specified GetTokenStatusesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesRequest} message GetTokenStatusesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenStatusesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest} GetTokenStatusesRequest + */ + GetTokenStatusesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest} message GetTokenStatusesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenStatusesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesRequest.GetTokenStatusesRequestV0 = (function() { + + /** + * Properties of a GetTokenStatusesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @interface IGetTokenStatusesRequestV0 + * @property {Array.|null} [tokenIds] GetTokenStatusesRequestV0 tokenIds + * @property {boolean|null} [prove] GetTokenStatusesRequestV0 prove + */ + + /** + * Constructs a new GetTokenStatusesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest + * @classdesc Represents a GetTokenStatusesRequestV0. + * @implements IGetTokenStatusesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set + */ + function GetTokenStatusesRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenStatusesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + */ + GetTokenStatusesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetTokenStatusesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + */ + GetTokenStatusesRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenStatusesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 instance + */ + GetTokenStatusesRequestV0.create = function create(properties) { + return new GetTokenStatusesRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenStatusesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.IGetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenStatusesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} GetTokenStatusesRequestV0 + */ + GetTokenStatusesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0(); + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0} message GetTokenStatusesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) + object.prove = false; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenStatusesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesRequest.GetTokenStatusesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenStatusesRequestV0; + })(); + + return GetTokenStatusesRequest; + })(); + + v0.GetTokenStatusesResponse = (function() { + + /** + * Properties of a GetTokenStatusesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenStatusesResponse + * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null} [v0] GetTokenStatusesResponse v0 + */ + + /** + * Constructs a new GetTokenStatusesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenStatusesResponse. + * @implements IGetTokenStatusesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set + */ + function GetTokenStatusesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenStatusesResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + */ + GetTokenStatusesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + */ + Object.defineProperty(GetTokenStatusesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse instance + */ + GetTokenStatusesResponse.create = function create(properties) { + return new GetTokenStatusesResponse(properties); + }; + + /** + * Encodes the specified GetTokenStatusesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenStatusesResponse} message GetTokenStatusesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenStatusesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse} GetTokenStatusesResponse + */ + GetTokenStatusesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse} message GetTokenStatusesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenStatusesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesResponse.GetTokenStatusesResponseV0 = (function() { + + /** + * Properties of a GetTokenStatusesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @interface IGetTokenStatusesResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null} [tokenStatuses] GetTokenStatusesResponseV0 tokenStatuses + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenStatusesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenStatusesResponseV0 metadata + */ + + /** + * Constructs a new GetTokenStatusesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse + * @classdesc Represents a GetTokenStatusesResponseV0. + * @implements IGetTokenStatusesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set + */ + function GetTokenStatusesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenStatusesResponseV0 tokenStatuses. + * @member {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses|null|undefined} tokenStatuses + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.tokenStatuses = null; + + /** + * GetTokenStatusesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.proof = null; + + /** + * GetTokenStatusesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + GetTokenStatusesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenStatusesResponseV0 result. + * @member {"tokenStatuses"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + */ + Object.defineProperty(GetTokenStatusesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenStatuses", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenStatusesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 instance + */ + GetTokenStatusesResponseV0.create = function create(properties) { + return new GetTokenStatusesResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenStatusesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenStatuses != null && Object.hasOwnProperty.call(message, "tokenStatuses")) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.encode(message.tokenStatuses, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenStatusesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.IGetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenStatusesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenStatusesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenStatusesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenStatusesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenStatusesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify(message.tokenStatuses); + if (error) + return "tokenStatuses." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenStatusesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} GetTokenStatusesResponseV0 + */ + GetTokenStatusesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0(); + if (object.tokenStatuses != null) { + if (typeof object.tokenStatuses !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.tokenStatuses: object expected"); + message.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.fromObject(object.tokenStatuses); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenStatusesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0} message GetTokenStatusesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenStatusesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + object.tokenStatuses = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.toObject(message.tokenStatuses, options); + if (options.oneofs) + object.result = "tokenStatuses"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenStatusesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenStatusesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenStatusesResponseV0.TokenStatusEntry = (function() { + + /** + * Properties of a TokenStatusEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @interface ITokenStatusEntry + * @property {Uint8Array|null} [tokenId] TokenStatusEntry tokenId + * @property {boolean|null} [paused] TokenStatusEntry paused + */ + + /** + * Constructs a new TokenStatusEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @classdesc Represents a TokenStatusEntry. + * @implements ITokenStatusEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set + */ + function TokenStatusEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenStatusEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + */ + TokenStatusEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenStatusEntry paused. + * @member {boolean} paused + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + */ + TokenStatusEntry.prototype.paused = false; + + /** + * Creates a new TokenStatusEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry instance + */ + TokenStatusEntry.create = function create(properties) { + return new TokenStatusEntry(properties); + }; + + /** + * Encodes the specified TokenStatusEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatusEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.paused != null && Object.hasOwnProperty.call(message, "paused")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.paused); + return writer; + }; + + /** + * Encodes the specified TokenStatusEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatusEntry} message TokenStatusEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatusEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenStatusEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatusEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.paused = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenStatusEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatusEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenStatusEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenStatusEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.paused != null && message.hasOwnProperty("paused")) + if (typeof message.paused !== "boolean") + return "paused: boolean expected"; + return null; + }; + + /** + * Creates a TokenStatusEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} TokenStatusEntry + */ + TokenStatusEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.paused != null) + message.paused = Boolean(object.paused); + return message; + }; + + /** + * Creates a plain object from a TokenStatusEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry} message TokenStatusEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenStatusEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.paused = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.paused != null && message.hasOwnProperty("paused")) + object.paused = message.paused; + return object; + }; + + /** + * Converts this TokenStatusEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry + * @instance + * @returns {Object.} JSON object + */ + TokenStatusEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenStatusEntry; + })(); + + GetTokenStatusesResponseV0.TokenStatuses = (function() { + + /** + * Properties of a TokenStatuses. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @interface ITokenStatuses + * @property {Array.|null} [tokenStatuses] TokenStatuses tokenStatuses + */ + + /** + * Constructs a new TokenStatuses. + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0 + * @classdesc Represents a TokenStatuses. + * @implements ITokenStatuses + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set + */ + function TokenStatuses(properties) { + this.tokenStatuses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenStatuses tokenStatuses. + * @member {Array.} tokenStatuses + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @instance + */ + TokenStatuses.prototype.tokenStatuses = $util.emptyArray; + + /** + * Creates a new TokenStatuses instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses instance + */ + TokenStatuses.create = function create(properties) { + return new TokenStatuses(properties); + }; + + /** + * Encodes the specified TokenStatuses message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatuses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenStatuses != null && message.tokenStatuses.length) + for (var i = 0; i < message.tokenStatuses.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.encode(message.tokenStatuses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenStatuses message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.ITokenStatuses} message TokenStatuses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenStatuses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenStatuses message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatuses.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenStatuses && message.tokenStatuses.length)) + message.tokenStatuses = []; + message.tokenStatuses.push($root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenStatuses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenStatuses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenStatuses message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenStatuses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenStatuses != null && message.hasOwnProperty("tokenStatuses")) { + if (!Array.isArray(message.tokenStatuses)) + return "tokenStatuses: array expected"; + for (var i = 0; i < message.tokenStatuses.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.verify(message.tokenStatuses[i]); + if (error) + return "tokenStatuses." + error; + } + } + return null; + }; + + /** + * Creates a TokenStatuses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} TokenStatuses + */ + TokenStatuses.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses(); + if (object.tokenStatuses) { + if (!Array.isArray(object.tokenStatuses)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: array expected"); + message.tokenStatuses = []; + for (var i = 0; i < object.tokenStatuses.length; ++i) { + if (typeof object.tokenStatuses[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses.tokenStatuses: object expected"); + message.tokenStatuses[i] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.fromObject(object.tokenStatuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenStatuses message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @static + * @param {org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses} message TokenStatuses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenStatuses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenStatuses = []; + if (message.tokenStatuses && message.tokenStatuses.length) { + object.tokenStatuses = []; + for (var j = 0; j < message.tokenStatuses.length; ++j) + object.tokenStatuses[j] = $root.org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatusEntry.toObject(message.tokenStatuses[j], options); + } + return object; + }; + + /** + * Converts this TokenStatuses to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenStatusesResponse.GetTokenStatusesResponseV0.TokenStatuses + * @instance + * @returns {Object.} JSON object + */ + TokenStatuses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenStatuses; + })(); + + return GetTokenStatusesResponseV0; + })(); + + return GetTokenStatusesResponse; + })(); + + v0.GetTokenDirectPurchasePricesResponse = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenDirectPurchasePricesResponse + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null} [v0] GetTokenDirectPurchasePricesResponse v0 + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenDirectPurchasePricesResponse. + * @implements IGetTokenDirectPurchasePricesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + */ + GetTokenDirectPurchasePricesResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse instance + */ + GetTokenDirectPurchasePricesResponse.create = function create(properties) { + return new GetTokenDirectPurchasePricesResponse(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} GetTokenDirectPurchasePricesResponse + */ + GetTokenDirectPurchasePricesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse} message GetTokenDirectPurchasePricesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @interface IGetTokenDirectPurchasePricesResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null} [tokenDirectPurchasePrices] GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenDirectPurchasePricesResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenDirectPurchasePricesResponseV0 metadata + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse + * @classdesc Represents a GetTokenDirectPurchasePricesResponseV0. + * @implements IGetTokenDirectPurchasePricesResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesResponseV0 tokenDirectPurchasePrices. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices|null|undefined} tokenDirectPurchasePrices + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.tokenDirectPurchasePrices = null; + + /** + * GetTokenDirectPurchasePricesResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.proof = null; + + /** + * GetTokenDirectPurchasePricesResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + GetTokenDirectPurchasePricesResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesResponseV0 result. + * @member {"tokenDirectPurchasePrices"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenDirectPurchasePrices", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 instance + */ + GetTokenDirectPurchasePricesResponseV0.create = function create(properties) { + return new GetTokenDirectPurchasePricesResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDirectPurchasePrices != null && Object.hasOwnProperty.call(message, "tokenDirectPurchasePrices")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.encode(message.tokenDirectPurchasePrices, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.IGetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify(message.tokenDirectPurchasePrices); + if (error) + return "tokenDirectPurchasePrices." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} GetTokenDirectPurchasePricesResponseV0 + */ + GetTokenDirectPurchasePricesResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0(); + if (object.tokenDirectPurchasePrices != null) { + if (typeof object.tokenDirectPurchasePrices !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.tokenDirectPurchasePrices: object expected"); + message.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.fromObject(object.tokenDirectPurchasePrices); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0} message GetTokenDirectPurchasePricesResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenDirectPurchasePrices != null && message.hasOwnProperty("tokenDirectPurchasePrices")) { + object.tokenDirectPurchasePrices = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.toObject(message.tokenDirectPurchasePrices, options); + if (options.oneofs) + object.result = "tokenDirectPurchasePrices"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesResponseV0.PriceForQuantity = (function() { + + /** + * Properties of a PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface IPriceForQuantity + * @property {number|Long|null} [quantity] PriceForQuantity quantity + * @property {number|Long|null} [price] PriceForQuantity price + */ + + /** + * Constructs a new PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a PriceForQuantity. + * @implements IPriceForQuantity + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set + */ + function PriceForQuantity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceForQuantity quantity. + * @member {number|Long} quantity + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PriceForQuantity price. + * @member {number|Long} price + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PriceForQuantity instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity instance + */ + PriceForQuantity.create = function create(properties) { + return new PriceForQuantity(properties); + }; + + /** + * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); + return writer; + }; + + /** + * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.uint64(); + break; + case 2: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceForQuantity message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceForQuantity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.price != null && message.hasOwnProperty("price")) + if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) + return "price: integer|Long expected"; + return null; + }; + + /** + * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} PriceForQuantity + */ + PriceForQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity(); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + if (object.price != null) + if ($util.Long) + (message.price = $util.Long.fromValue(object.price)).unsigned = true; + else if (typeof object.price === "string") + message.price = parseInt(object.price, 10); + else if (typeof object.price === "number") + message.price = object.price; + else if (typeof object.price === "object") + message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity} message PriceForQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceForQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.quantity = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.price = options.longs === String ? "0" : 0; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (message.price != null && message.hasOwnProperty("price")) + if (typeof message.price === "number") + object.price = options.longs === String ? String(message.price) : message.price; + else + object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; + return object; + }; + + /** + * Converts this PriceForQuantity to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity + * @instance + * @returns {Object.} JSON object + */ + PriceForQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceForQuantity; + })(); + + GetTokenDirectPurchasePricesResponseV0.PricingSchedule = (function() { + + /** + * Properties of a PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface IPricingSchedule + * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity + */ + + /** + * Constructs a new PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a PricingSchedule. + * @implements IPricingSchedule + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set + */ + function PricingSchedule(properties) { + this.priceForQuantity = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PricingSchedule priceForQuantity. + * @member {Array.} priceForQuantity + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @instance + */ + PricingSchedule.prototype.priceForQuantity = $util.emptyArray; + + /** + * Creates a new PricingSchedule instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule instance + */ + PricingSchedule.create = function create(properties) { + return new PricingSchedule(properties); + }; + + /** + * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priceForQuantity != null && message.priceForQuantity.length) + for (var i = 0; i < message.priceForQuantity.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.priceForQuantity && message.priceForQuantity.length)) + message.priceForQuantity = []; + message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PricingSchedule message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PricingSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { + if (!Array.isArray(message.priceForQuantity)) + return "priceForQuantity: array expected"; + for (var i = 0; i < message.priceForQuantity.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.verify(message.priceForQuantity[i]); + if (error) + return "priceForQuantity." + error; + } + } + return null; + }; + + /** + * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} PricingSchedule + */ + PricingSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule(); + if (object.priceForQuantity) { + if (!Array.isArray(object.priceForQuantity)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: array expected"); + message.priceForQuantity = []; + for (var i = 0; i < object.priceForQuantity.length; ++i) { + if (typeof object.priceForQuantity[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.priceForQuantity: object expected"); + message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.fromObject(object.priceForQuantity[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule} message PricingSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PricingSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.priceForQuantity = []; + if (message.priceForQuantity && message.priceForQuantity.length) { + object.priceForQuantity = []; + for (var j = 0; j < message.priceForQuantity.length; ++j) + object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity.toObject(message.priceForQuantity[j], options); + } + return object; + }; + + /** + * Converts this PricingSchedule to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule + * @instance + * @returns {Object.} JSON object + */ + PricingSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PricingSchedule; + })(); + + GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry = (function() { + + /** + * Properties of a TokenDirectPurchasePriceEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface ITokenDirectPurchasePriceEntry + * @property {Uint8Array|null} [tokenId] TokenDirectPurchasePriceEntry tokenId + * @property {number|Long|null} [fixedPrice] TokenDirectPurchasePriceEntry fixedPrice + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null} [variablePrice] TokenDirectPurchasePriceEntry variablePrice + */ + + /** + * Constructs a new TokenDirectPurchasePriceEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a TokenDirectPurchasePriceEntry. + * @implements ITokenDirectPurchasePriceEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set + */ + function TokenDirectPurchasePriceEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDirectPurchasePriceEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + TokenDirectPurchasePriceEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenDirectPurchasePriceEntry fixedPrice. + * @member {number|Long} fixedPrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + TokenDirectPurchasePriceEntry.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TokenDirectPurchasePriceEntry variablePrice. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.IPricingSchedule|null|undefined} variablePrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + TokenDirectPurchasePriceEntry.prototype.variablePrice = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TokenDirectPurchasePriceEntry price. + * @member {"fixedPrice"|"variablePrice"|undefined} price + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + */ + Object.defineProperty(TokenDirectPurchasePriceEntry.prototype, "price", { + get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TokenDirectPurchasePriceEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry instance + */ + TokenDirectPurchasePriceEntry.create = function create(properties) { + return new TokenDirectPurchasePriceEntry(properties); + }; + + /** + * Encodes the specified TokenDirectPurchasePriceEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePriceEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.fixedPrice); + if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDirectPurchasePriceEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePriceEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePriceEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.fixedPrice = reader.uint64(); + break; + case 3: + message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDirectPurchasePriceEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePriceEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDirectPurchasePriceEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDirectPurchasePriceEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + properties.price = 1; + if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) + return "fixedPrice: integer|Long expected"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + if (properties.price === 1) + return "price: multiple values"; + properties.price = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.verify(message.variablePrice); + if (error) + return "variablePrice." + error; + } + } + return null; + }; + + /** + * Creates a TokenDirectPurchasePriceEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} TokenDirectPurchasePriceEntry + */ + TokenDirectPurchasePriceEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.fixedPrice != null) + if ($util.Long) + (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; + else if (typeof object.fixedPrice === "string") + message.fixedPrice = parseInt(object.fixedPrice, 10); + else if (typeof object.fixedPrice === "number") + message.fixedPrice = object.fixedPrice; + else if (typeof object.fixedPrice === "object") + message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); + if (object.variablePrice != null) { + if (typeof object.variablePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.variablePrice: object expected"); + message.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.fromObject(object.variablePrice); + } + return message; + }; + + /** + * Creates a plain object from a TokenDirectPurchasePriceEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry} message TokenDirectPurchasePriceEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDirectPurchasePriceEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + if (typeof message.fixedPrice === "number") + object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; + else + object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; + if (options.oneofs) + object.price = "fixedPrice"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + object.variablePrice = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule.toObject(message.variablePrice, options); + if (options.oneofs) + object.price = "variablePrice"; + } + return object; + }; + + /** + * Converts this TokenDirectPurchasePriceEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry + * @instance + * @returns {Object.} JSON object + */ + TokenDirectPurchasePriceEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDirectPurchasePriceEntry; + })(); + + GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices = (function() { + + /** + * Properties of a TokenDirectPurchasePrices. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @interface ITokenDirectPurchasePrices + * @property {Array.|null} [tokenDirectPurchasePrice] TokenDirectPurchasePrices tokenDirectPurchasePrice + */ + + /** + * Constructs a new TokenDirectPurchasePrices. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0 + * @classdesc Represents a TokenDirectPurchasePrices. + * @implements ITokenDirectPurchasePrices + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set + */ + function TokenDirectPurchasePrices(properties) { + this.tokenDirectPurchasePrice = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDirectPurchasePrices tokenDirectPurchasePrice. + * @member {Array.} tokenDirectPurchasePrice + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @instance + */ + TokenDirectPurchasePrices.prototype.tokenDirectPurchasePrice = $util.emptyArray; + + /** + * Creates a new TokenDirectPurchasePrices instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices instance + */ + TokenDirectPurchasePrices.create = function create(properties) { + return new TokenDirectPurchasePrices(properties); + }; + + /** + * Encodes the specified TokenDirectPurchasePrices message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePrices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDirectPurchasePrice != null && message.tokenDirectPurchasePrice.length) + for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.encode(message.tokenDirectPurchasePrice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDirectPurchasePrices message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.ITokenDirectPurchasePrices} message TokenDirectPurchasePrices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDirectPurchasePrices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePrices.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length)) + message.tokenDirectPurchasePrice = []; + message.tokenDirectPurchasePrice.push($root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDirectPurchasePrices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDirectPurchasePrices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDirectPurchasePrices message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDirectPurchasePrices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenDirectPurchasePrice != null && message.hasOwnProperty("tokenDirectPurchasePrice")) { + if (!Array.isArray(message.tokenDirectPurchasePrice)) + return "tokenDirectPurchasePrice: array expected"; + for (var i = 0; i < message.tokenDirectPurchasePrice.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.verify(message.tokenDirectPurchasePrice[i]); + if (error) + return "tokenDirectPurchasePrice." + error; + } + } + return null; + }; + + /** + * Creates a TokenDirectPurchasePrices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} TokenDirectPurchasePrices + */ + TokenDirectPurchasePrices.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices(); + if (object.tokenDirectPurchasePrice) { + if (!Array.isArray(object.tokenDirectPurchasePrice)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: array expected"); + message.tokenDirectPurchasePrice = []; + for (var i = 0; i < object.tokenDirectPurchasePrice.length; ++i) { + if (typeof object.tokenDirectPurchasePrice[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices.tokenDirectPurchasePrice: object expected"); + message.tokenDirectPurchasePrice[i] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.fromObject(object.tokenDirectPurchasePrice[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenDirectPurchasePrices message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices} message TokenDirectPurchasePrices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDirectPurchasePrices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenDirectPurchasePrice = []; + if (message.tokenDirectPurchasePrice && message.tokenDirectPurchasePrice.length) { + object.tokenDirectPurchasePrice = []; + for (var j = 0; j < message.tokenDirectPurchasePrice.length; ++j) + object.tokenDirectPurchasePrice[j] = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry.toObject(message.tokenDirectPurchasePrice[j], options); + } + return object; + }; + + /** + * Converts this TokenDirectPurchasePrices to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices + * @instance + * @returns {Object.} JSON object + */ + TokenDirectPurchasePrices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDirectPurchasePrices; + })(); + + return GetTokenDirectPurchasePricesResponseV0; + })(); + + return GetTokenDirectPurchasePricesResponse; + })(); + + v0.GetTokenDirectPurchasePricesRequest = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenDirectPurchasePricesRequest + * @property {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null} [v0] GetTokenDirectPurchasePricesRequest v0 + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenDirectPurchasePricesRequest. + * @implements IGetTokenDirectPurchasePricesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + */ + GetTokenDirectPurchasePricesRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenDirectPurchasePricesRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + */ + Object.defineProperty(GetTokenDirectPurchasePricesRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenDirectPurchasePricesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest instance + */ + GetTokenDirectPurchasePricesRequest.create = function create(properties) { + return new GetTokenDirectPurchasePricesRequest(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} GetTokenDirectPurchasePricesRequest + */ + GetTokenDirectPurchasePricesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest} message GetTokenDirectPurchasePricesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 = (function() { + + /** + * Properties of a GetTokenDirectPurchasePricesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @interface IGetTokenDirectPurchasePricesRequestV0 + * @property {Array.|null} [tokenIds] GetTokenDirectPurchasePricesRequestV0 tokenIds + * @property {boolean|null} [prove] GetTokenDirectPurchasePricesRequestV0 prove + */ + + /** + * Constructs a new GetTokenDirectPurchasePricesRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest + * @classdesc Represents a GetTokenDirectPurchasePricesRequestV0. + * @implements IGetTokenDirectPurchasePricesRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set + */ + function GetTokenDirectPurchasePricesRequestV0(properties) { + this.tokenIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenDirectPurchasePricesRequestV0 tokenIds. + * @member {Array.} tokenIds + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + */ + GetTokenDirectPurchasePricesRequestV0.prototype.tokenIds = $util.emptyArray; + + /** + * GetTokenDirectPurchasePricesRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + */ + GetTokenDirectPurchasePricesRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenDirectPurchasePricesRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 instance + */ + GetTokenDirectPurchasePricesRequestV0.create = function create(properties) { + return new GetTokenDirectPurchasePricesRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenIds != null && message.tokenIds.length) + for (var i = 0; i < message.tokenIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenIds[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenDirectPurchasePricesRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.IGetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenDirectPurchasePricesRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenIds && message.tokenIds.length)) + message.tokenIds = []; + message.tokenIds.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenDirectPurchasePricesRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenDirectPurchasePricesRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenDirectPurchasePricesRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenDirectPurchasePricesRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenIds != null && message.hasOwnProperty("tokenIds")) { + if (!Array.isArray(message.tokenIds)) + return "tokenIds: array expected"; + for (var i = 0; i < message.tokenIds.length; ++i) + if (!(message.tokenIds[i] && typeof message.tokenIds[i].length === "number" || $util.isString(message.tokenIds[i]))) + return "tokenIds: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenDirectPurchasePricesRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} GetTokenDirectPurchasePricesRequestV0 + */ + GetTokenDirectPurchasePricesRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0(); + if (object.tokenIds) { + if (!Array.isArray(object.tokenIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0.tokenIds: array expected"); + message.tokenIds = []; + for (var i = 0; i < object.tokenIds.length; ++i) + if (typeof object.tokenIds[i] === "string") + $util.base64.decode(object.tokenIds[i], message.tokenIds[i] = $util.newBuffer($util.base64.length(object.tokenIds[i])), 0); + else if (object.tokenIds[i].length >= 0) + message.tokenIds[i] = object.tokenIds[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenDirectPurchasePricesRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0} message GetTokenDirectPurchasePricesRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenDirectPurchasePricesRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenIds = []; + if (options.defaults) + object.prove = false; + if (message.tokenIds && message.tokenIds.length) { + object.tokenIds = []; + for (var j = 0; j < message.tokenIds.length; ++j) + object.tokenIds[j] = options.bytes === String ? $util.base64.encode(message.tokenIds[j], 0, message.tokenIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenIds[j]) : message.tokenIds[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenDirectPurchasePricesRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenDirectPurchasePricesRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenDirectPurchasePricesRequestV0; + })(); + + return GetTokenDirectPurchasePricesRequest; + })(); + + v0.GetTokenPreProgrammedDistributionsRequest = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenPreProgrammedDistributionsRequest + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null} [v0] GetTokenPreProgrammedDistributionsRequest v0 + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenPreProgrammedDistributionsRequest. + * @implements IGetTokenPreProgrammedDistributionsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenPreProgrammedDistributionsRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + */ + GetTokenPreProgrammedDistributionsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest instance + */ + GetTokenPreProgrammedDistributionsRequest.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsRequest(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} GetTokenPreProgrammedDistributionsRequest + */ + GetTokenPreProgrammedDistributionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest} message GetTokenPreProgrammedDistributionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @interface IGetTokenPreProgrammedDistributionsRequestV0 + * @property {Uint8Array|null} [tokenId] GetTokenPreProgrammedDistributionsRequestV0 tokenId + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null} [startAtInfo] GetTokenPreProgrammedDistributionsRequestV0 startAtInfo + * @property {number|null} [limit] GetTokenPreProgrammedDistributionsRequestV0 limit + * @property {boolean|null} [prove] GetTokenPreProgrammedDistributionsRequestV0 prove + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest + * @classdesc Represents a GetTokenPreProgrammedDistributionsRequestV0. + * @implements IGetTokenPreProgrammedDistributionsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenPreProgrammedDistributionsRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetTokenPreProgrammedDistributionsRequestV0 startAtInfo. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo|null|undefined} startAtInfo + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.startAtInfo = null; + + /** + * GetTokenPreProgrammedDistributionsRequestV0 limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.limit = 0; + + /** + * GetTokenPreProgrammedDistributionsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenPreProgrammedDistributionsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 instance + */ + GetTokenPreProgrammedDistributionsRequestV0.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.startAtInfo != null && Object.hasOwnProperty.call(message, "startAtInfo")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.encode(message.startAtInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.limit); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.IGetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.decode(reader, reader.uint32()); + break; + case 3: + message.limit = reader.uint32(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify(message.startAtInfo); + if (error) + return "startAtInfo." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} GetTokenPreProgrammedDistributionsRequestV0 + */ + GetTokenPreProgrammedDistributionsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.startAtInfo != null) { + if (typeof object.startAtInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.startAtInfo: object expected"); + message.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.fromObject(object.startAtInfo); + } + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0} message GetTokenPreProgrammedDistributionsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.startAtInfo = null; + object.limit = 0; + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.startAtInfo != null && message.hasOwnProperty("startAtInfo")) + object.startAtInfo = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.toObject(message.startAtInfo, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo = (function() { + + /** + * Properties of a StartAtInfo. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @interface IStartAtInfo + * @property {number|Long|null} [startTimeMs] StartAtInfo startTimeMs + * @property {Uint8Array|null} [startRecipient] StartAtInfo startRecipient + * @property {boolean|null} [startRecipientIncluded] StartAtInfo startRecipientIncluded + */ + + /** + * Constructs a new StartAtInfo. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0 + * @classdesc Represents a StartAtInfo. + * @implements IStartAtInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set + */ + function StartAtInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtInfo startTimeMs. + * @member {number|Long} startTimeMs + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * StartAtInfo startRecipient. + * @member {Uint8Array} startRecipient + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startRecipient = $util.newBuffer([]); + + /** + * StartAtInfo startRecipientIncluded. + * @member {boolean} startRecipientIncluded + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + */ + StartAtInfo.prototype.startRecipientIncluded = false; + + /** + * Creates a new StartAtInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo instance + */ + StartAtInfo.create = function create(properties) { + return new StartAtInfo(properties); + }; + + /** + * Encodes the specified StartAtInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.startTimeMs); + if (message.startRecipient != null && Object.hasOwnProperty.call(message, "startRecipient")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startRecipient); + if (message.startRecipientIncluded != null && Object.hasOwnProperty.call(message, "startRecipientIncluded")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.startRecipientIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.IStartAtInfo} message StartAtInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeMs = reader.uint64(); + break; + case 2: + message.startRecipient = reader.bytes(); + break; + case 3: + message.startRecipientIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) + return "startTimeMs: integer|Long expected"; + if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) + if (!(message.startRecipient && typeof message.startRecipient.length === "number" || $util.isString(message.startRecipient))) + return "startRecipient: buffer expected"; + if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) + if (typeof message.startRecipientIncluded !== "boolean") + return "startRecipientIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} StartAtInfo + */ + StartAtInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo(); + if (object.startTimeMs != null) + if ($util.Long) + (message.startTimeMs = $util.Long.fromValue(object.startTimeMs)).unsigned = true; + else if (typeof object.startTimeMs === "string") + message.startTimeMs = parseInt(object.startTimeMs, 10); + else if (typeof object.startTimeMs === "number") + message.startTimeMs = object.startTimeMs; + else if (typeof object.startTimeMs === "object") + message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(true); + if (object.startRecipient != null) + if (typeof object.startRecipient === "string") + $util.base64.decode(object.startRecipient, message.startRecipient = $util.newBuffer($util.base64.length(object.startRecipient)), 0); + else if (object.startRecipient.length >= 0) + message.startRecipient = object.startRecipient; + if (object.startRecipientIncluded != null) + message.startRecipientIncluded = Boolean(object.startRecipientIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo} message StartAtInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startTimeMs = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.startRecipient = ""; + else { + object.startRecipient = []; + if (options.bytes !== Array) + object.startRecipient = $util.newBuffer(object.startRecipient); + } + object.startRecipientIncluded = false; + } + if (message.startTimeMs != null && message.hasOwnProperty("startTimeMs")) + if (typeof message.startTimeMs === "number") + object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; + else + object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber(true) : message.startTimeMs; + if (message.startRecipient != null && message.hasOwnProperty("startRecipient")) + object.startRecipient = options.bytes === String ? $util.base64.encode(message.startRecipient, 0, message.startRecipient.length) : options.bytes === Array ? Array.prototype.slice.call(message.startRecipient) : message.startRecipient; + if (message.startRecipientIncluded != null && message.hasOwnProperty("startRecipientIncluded")) + object.startRecipientIncluded = message.startRecipientIncluded; + return object; + }; + + /** + * Converts this StartAtInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsRequest.GetTokenPreProgrammedDistributionsRequestV0.StartAtInfo + * @instance + * @returns {Object.} JSON object + */ + StartAtInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtInfo; + })(); + + return GetTokenPreProgrammedDistributionsRequestV0; + })(); + + return GetTokenPreProgrammedDistributionsRequest; + })(); + + v0.GetTokenPreProgrammedDistributionsResponse = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenPreProgrammedDistributionsResponse + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null} [v0] GetTokenPreProgrammedDistributionsResponse v0 + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenPreProgrammedDistributionsResponse. + * @implements IGetTokenPreProgrammedDistributionsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenPreProgrammedDistributionsResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + */ + GetTokenPreProgrammedDistributionsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse instance + */ + GetTokenPreProgrammedDistributionsResponse.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsResponse(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} GetTokenPreProgrammedDistributionsResponse + */ + GetTokenPreProgrammedDistributionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse} message GetTokenPreProgrammedDistributionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 = (function() { + + /** + * Properties of a GetTokenPreProgrammedDistributionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @interface IGetTokenPreProgrammedDistributionsResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null} [tokenDistributions] GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenPreProgrammedDistributionsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenPreProgrammedDistributionsResponseV0 metadata + */ + + /** + * Constructs a new GetTokenPreProgrammedDistributionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse + * @classdesc Represents a GetTokenPreProgrammedDistributionsResponseV0. + * @implements IGetTokenPreProgrammedDistributionsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set + */ + function GetTokenPreProgrammedDistributionsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenPreProgrammedDistributionsResponseV0 tokenDistributions. + * @member {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions|null|undefined} tokenDistributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.tokenDistributions = null; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.proof = null; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenPreProgrammedDistributionsResponseV0 result. + * @member {"tokenDistributions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + */ + Object.defineProperty(GetTokenPreProgrammedDistributionsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenDistributions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenPreProgrammedDistributionsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 instance + */ + GetTokenPreProgrammedDistributionsResponseV0.create = function create(properties) { + return new GetTokenPreProgrammedDistributionsResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDistributions != null && Object.hasOwnProperty.call(message, "tokenDistributions")) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.encode(message.tokenDistributions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenPreProgrammedDistributionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.IGetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenPreProgrammedDistributionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenPreProgrammedDistributionsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenPreProgrammedDistributionsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenPreProgrammedDistributionsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenPreProgrammedDistributionsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify(message.tokenDistributions); + if (error) + return "tokenDistributions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenPreProgrammedDistributionsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} GetTokenPreProgrammedDistributionsResponseV0 + */ + GetTokenPreProgrammedDistributionsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0(); + if (object.tokenDistributions != null) { + if (typeof object.tokenDistributions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.tokenDistributions: object expected"); + message.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.fromObject(object.tokenDistributions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenPreProgrammedDistributionsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0} message GetTokenPreProgrammedDistributionsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenPreProgrammedDistributionsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + object.tokenDistributions = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.toObject(message.tokenDistributions, options); + if (options.oneofs) + object.result = "tokenDistributions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenPreProgrammedDistributionsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenPreProgrammedDistributionsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry = (function() { + + /** + * Properties of a TokenDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenDistributionEntry + * @property {Uint8Array|null} [recipientId] TokenDistributionEntry recipientId + * @property {number|Long|null} [amount] TokenDistributionEntry amount + */ + + /** + * Constructs a new TokenDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenDistributionEntry. + * @implements ITokenDistributionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set + */ + function TokenDistributionEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDistributionEntry recipientId. + * @member {Uint8Array} recipientId + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + */ + TokenDistributionEntry.prototype.recipientId = $util.newBuffer([]); + + /** + * TokenDistributionEntry amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + */ + TokenDistributionEntry.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenDistributionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry instance + */ + TokenDistributionEntry.create = function create(properties) { + return new TokenDistributionEntry(properties); + }; + + /** + * Encodes the specified TokenDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.recipientId); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); + return writer; + }; + + /** + * Encodes the specified TokenDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributionEntry} message TokenDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDistributionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributionEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recipientId = reader.bytes(); + break; + case 2: + message.amount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDistributionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDistributionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDistributionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) + return "recipientId: buffer expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenDistributionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} TokenDistributionEntry + */ + TokenDistributionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry(); + if (object.recipientId != null) + if (typeof object.recipientId === "string") + $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); + else if (object.recipientId.length >= 0) + message.recipientId = object.recipientId; + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a TokenDistributionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry} message TokenDistributionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDistributionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.recipientId = ""; + else { + object.recipientId = []; + if (options.bytes !== Array) + object.recipientId = $util.newBuffer(object.recipientId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + } + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + return object; + }; + + /** + * Converts this TokenDistributionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry + * @instance + * @returns {Object.} JSON object + */ + TokenDistributionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDistributionEntry; + })(); + + GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry = (function() { + + /** + * Properties of a TokenTimedDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenTimedDistributionEntry + * @property {number|Long|null} [timestamp] TokenTimedDistributionEntry timestamp + * @property {Array.|null} [distributions] TokenTimedDistributionEntry distributions + */ + + /** + * Constructs a new TokenTimedDistributionEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenTimedDistributionEntry. + * @implements ITokenTimedDistributionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set + */ + function TokenTimedDistributionEntry(properties) { + this.distributions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenTimedDistributionEntry timestamp. + * @member {number|Long} timestamp + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + */ + TokenTimedDistributionEntry.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TokenTimedDistributionEntry distributions. + * @member {Array.} distributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + */ + TokenTimedDistributionEntry.prototype.distributions = $util.emptyArray; + + /** + * Creates a new TokenTimedDistributionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry instance + */ + TokenTimedDistributionEntry.create = function create(properties) { + return new TokenTimedDistributionEntry(properties); + }; + + /** + * Encodes the specified TokenTimedDistributionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTimedDistributionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp); + if (message.distributions != null && message.distributions.length) + for (var i = 0; i < message.distributions.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.encode(message.distributions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenTimedDistributionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenTimedDistributionEntry} message TokenTimedDistributionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTimedDistributionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTimedDistributionEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + if (!(message.distributions && message.distributions.length)) + message.distributions = []; + message.distributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenTimedDistributionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTimedDistributionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenTimedDistributionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenTimedDistributionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.distributions != null && message.hasOwnProperty("distributions")) { + if (!Array.isArray(message.distributions)) + return "distributions: array expected"; + for (var i = 0; i < message.distributions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.verify(message.distributions[i]); + if (error) + return "distributions." + error; + } + } + return null; + }; + + /** + * Creates a TokenTimedDistributionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} TokenTimedDistributionEntry + */ + TokenTimedDistributionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.distributions) { + if (!Array.isArray(object.distributions)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: array expected"); + message.distributions = []; + for (var i = 0; i < object.distributions.length; ++i) { + if (typeof object.distributions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.distributions: object expected"); + message.distributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.fromObject(object.distributions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenTimedDistributionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry} message TokenTimedDistributionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenTimedDistributionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.distributions = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.distributions && message.distributions.length) { + object.distributions = []; + for (var j = 0; j < message.distributions.length; ++j) + object.distributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributionEntry.toObject(message.distributions[j], options); + } + return object; + }; + + /** + * Converts this TokenTimedDistributionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry + * @instance + * @returns {Object.} JSON object + */ + TokenTimedDistributionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenTimedDistributionEntry; + })(); + + GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions = (function() { + + /** + * Properties of a TokenDistributions. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @interface ITokenDistributions + * @property {Array.|null} [tokenDistributions] TokenDistributions tokenDistributions + */ + + /** + * Constructs a new TokenDistributions. + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0 + * @classdesc Represents a TokenDistributions. + * @implements ITokenDistributions + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set + */ + function TokenDistributions(properties) { + this.tokenDistributions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenDistributions tokenDistributions. + * @member {Array.} tokenDistributions + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @instance + */ + TokenDistributions.prototype.tokenDistributions = $util.emptyArray; + + /** + * Creates a new TokenDistributions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions instance + */ + TokenDistributions.create = function create(properties) { + return new TokenDistributions(properties); + }; + + /** + * Encodes the specified TokenDistributions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenDistributions != null && message.tokenDistributions.length) + for (var i = 0; i < message.tokenDistributions.length; ++i) + $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.encode(message.tokenDistributions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenDistributions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.ITokenDistributions} message TokenDistributions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDistributions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenDistributions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.tokenDistributions && message.tokenDistributions.length)) + message.tokenDistributions = []; + message.tokenDistributions.push($root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenDistributions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDistributions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenDistributions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenDistributions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenDistributions != null && message.hasOwnProperty("tokenDistributions")) { + if (!Array.isArray(message.tokenDistributions)) + return "tokenDistributions: array expected"; + for (var i = 0; i < message.tokenDistributions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.verify(message.tokenDistributions[i]); + if (error) + return "tokenDistributions." + error; + } + } + return null; + }; + + /** + * Creates a TokenDistributions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} TokenDistributions + */ + TokenDistributions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions(); + if (object.tokenDistributions) { + if (!Array.isArray(object.tokenDistributions)) + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: array expected"); + message.tokenDistributions = []; + for (var i = 0; i < object.tokenDistributions.length; ++i) { + if (typeof object.tokenDistributions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions.tokenDistributions: object expected"); + message.tokenDistributions[i] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.fromObject(object.tokenDistributions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TokenDistributions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @static + * @param {org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions} message TokenDistributions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenDistributions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokenDistributions = []; + if (message.tokenDistributions && message.tokenDistributions.length) { + object.tokenDistributions = []; + for (var j = 0; j < message.tokenDistributions.length; ++j) + object.tokenDistributions[j] = $root.org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenTimedDistributionEntry.toObject(message.tokenDistributions[j], options); + } + return object; + }; + + /** + * Converts this TokenDistributions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenPreProgrammedDistributionsResponse.GetTokenPreProgrammedDistributionsResponseV0.TokenDistributions + * @instance + * @returns {Object.} JSON object + */ + TokenDistributions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenDistributions; + })(); + + return GetTokenPreProgrammedDistributionsResponseV0; + })(); + + return GetTokenPreProgrammedDistributionsResponse; + })(); + + v0.GetTokenTotalSupplyRequest = (function() { + + /** + * Properties of a GetTokenTotalSupplyRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenTotalSupplyRequest + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null} [v0] GetTokenTotalSupplyRequest v0 + */ + + /** + * Constructs a new GetTokenTotalSupplyRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenTotalSupplyRequest. + * @implements IGetTokenTotalSupplyRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set + */ + function GetTokenTotalSupplyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenTotalSupplyRequest v0. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + */ + GetTokenTotalSupplyRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest instance + */ + GetTokenTotalSupplyRequest.create = function create(properties) { + return new GetTokenTotalSupplyRequest(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} GetTokenTotalSupplyRequest + */ + GetTokenTotalSupplyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest} message GetTokenTotalSupplyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenTotalSupplyRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 = (function() { + + /** + * Properties of a GetTokenTotalSupplyRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @interface IGetTokenTotalSupplyRequestV0 + * @property {Uint8Array|null} [tokenId] GetTokenTotalSupplyRequestV0 tokenId + * @property {boolean|null} [prove] GetTokenTotalSupplyRequestV0 prove + */ + + /** + * Constructs a new GetTokenTotalSupplyRequestV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest + * @classdesc Represents a GetTokenTotalSupplyRequestV0. + * @implements IGetTokenTotalSupplyRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set + */ + function GetTokenTotalSupplyRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenTotalSupplyRequestV0 tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + */ + GetTokenTotalSupplyRequestV0.prototype.tokenId = $util.newBuffer([]); + + /** + * GetTokenTotalSupplyRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + */ + GetTokenTotalSupplyRequestV0.prototype.prove = false; + + /** + * Creates a new GetTokenTotalSupplyRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 instance + */ + GetTokenTotalSupplyRequestV0.create = function create(properties) { + return new GetTokenTotalSupplyRequestV0(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.IGetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetTokenTotalSupplyRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} GetTokenTotalSupplyRequestV0 + */ + GetTokenTotalSupplyRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0} message GetTokenTotalSupplyRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + object.prove = false; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetTokenTotalSupplyRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTokenTotalSupplyRequestV0; + })(); + + return GetTokenTotalSupplyRequest; + })(); + + v0.GetTokenTotalSupplyResponse = (function() { + + /** + * Properties of a GetTokenTotalSupplyResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetTokenTotalSupplyResponse + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null} [v0] GetTokenTotalSupplyResponse v0 + */ + + /** + * Constructs a new GetTokenTotalSupplyResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetTokenTotalSupplyResponse. + * @implements IGetTokenTotalSupplyResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set + */ + function GetTokenTotalSupplyResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenTotalSupplyResponse v0. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + */ + GetTokenTotalSupplyResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse instance + */ + GetTokenTotalSupplyResponse.create = function create(properties) { + return new GetTokenTotalSupplyResponse(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} GetTokenTotalSupplyResponse + */ + GetTokenTotalSupplyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse} message GetTokenTotalSupplyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetTokenTotalSupplyResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 = (function() { + + /** + * Properties of a GetTokenTotalSupplyResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @interface IGetTokenTotalSupplyResponseV0 + * @property {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null} [tokenTotalSupply] GetTokenTotalSupplyResponseV0 tokenTotalSupply + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetTokenTotalSupplyResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetTokenTotalSupplyResponseV0 metadata + */ + + /** + * Constructs a new GetTokenTotalSupplyResponseV0. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse + * @classdesc Represents a GetTokenTotalSupplyResponseV0. + * @implements IGetTokenTotalSupplyResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set + */ + function GetTokenTotalSupplyResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTokenTotalSupplyResponseV0 tokenTotalSupply. + * @member {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry|null|undefined} tokenTotalSupply + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.tokenTotalSupply = null; + + /** + * GetTokenTotalSupplyResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.proof = null; + + /** + * GetTokenTotalSupplyResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + GetTokenTotalSupplyResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTokenTotalSupplyResponseV0 result. + * @member {"tokenTotalSupply"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + */ + Object.defineProperty(GetTokenTotalSupplyResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["tokenTotalSupply", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTokenTotalSupplyResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 instance + */ + GetTokenTotalSupplyResponseV0.create = function create(properties) { + return new GetTokenTotalSupplyResponseV0(properties); + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenTotalSupply != null && Object.hasOwnProperty.call(message, "tokenTotalSupply")) + $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.encode(message.tokenTotalSupply, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTokenTotalSupplyResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.IGetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTokenTotalSupplyResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTokenTotalSupplyResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTokenTotalSupplyResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTokenTotalSupplyResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTokenTotalSupplyResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify(message.tokenTotalSupply); + if (error) + return "tokenTotalSupply." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetTokenTotalSupplyResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} GetTokenTotalSupplyResponseV0 + */ + GetTokenTotalSupplyResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0(); + if (object.tokenTotalSupply != null) { + if (typeof object.tokenTotalSupply !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.tokenTotalSupply: object expected"); + message.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.fromObject(object.tokenTotalSupply); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTokenTotalSupplyResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0} message GetTokenTotalSupplyResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTokenTotalSupplyResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.tokenTotalSupply != null && message.hasOwnProperty("tokenTotalSupply")) { + object.tokenTotalSupply = $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.toObject(message.tokenTotalSupply, options); + if (options.oneofs) + object.result = "tokenTotalSupply"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetTokenTotalSupplyResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetTokenTotalSupplyResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry = (function() { + + /** + * Properties of a TokenTotalSupplyEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @interface ITokenTotalSupplyEntry + * @property {Uint8Array|null} [tokenId] TokenTotalSupplyEntry tokenId + * @property {number|Long|null} [totalAggregatedAmountInUserAccounts] TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts + * @property {number|Long|null} [totalSystemAmount] TokenTotalSupplyEntry totalSystemAmount + */ + + /** + * Constructs a new TokenTotalSupplyEntry. + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0 + * @classdesc Represents a TokenTotalSupplyEntry. + * @implements ITokenTotalSupplyEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set + */ + function TokenTotalSupplyEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenTotalSupplyEntry tokenId. + * @member {Uint8Array} tokenId + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.tokenId = $util.newBuffer([]); + + /** + * TokenTotalSupplyEntry totalAggregatedAmountInUserAccounts. + * @member {number|Long} totalAggregatedAmountInUserAccounts + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.totalAggregatedAmountInUserAccounts = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * TokenTotalSupplyEntry totalSystemAmount. + * @member {number|Long} totalSystemAmount + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + */ + TokenTotalSupplyEntry.prototype.totalSystemAmount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TokenTotalSupplyEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry instance + */ + TokenTotalSupplyEntry.create = function create(properties) { + return new TokenTotalSupplyEntry(properties); + }; + + /** + * Encodes the specified TokenTotalSupplyEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTotalSupplyEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenId); + if (message.totalAggregatedAmountInUserAccounts != null && Object.hasOwnProperty.call(message, "totalAggregatedAmountInUserAccounts")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.totalAggregatedAmountInUserAccounts); + if (message.totalSystemAmount != null && Object.hasOwnProperty.call(message, "totalSystemAmount")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.totalSystemAmount); + return writer; + }; + + /** + * Encodes the specified TokenTotalSupplyEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.ITokenTotalSupplyEntry} message TokenTotalSupplyEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTotalSupplyEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTotalSupplyEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenId = reader.bytes(); + break; + case 2: + message.totalAggregatedAmountInUserAccounts = reader.uint64(); + break; + case 3: + message.totalSystemAmount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenTotalSupplyEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTotalSupplyEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenTotalSupplyEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenTotalSupplyEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + if (!(message.tokenId && typeof message.tokenId.length === "number" || $util.isString(message.tokenId))) + return "tokenId: buffer expected"; + if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) + if (!$util.isInteger(message.totalAggregatedAmountInUserAccounts) && !(message.totalAggregatedAmountInUserAccounts && $util.isInteger(message.totalAggregatedAmountInUserAccounts.low) && $util.isInteger(message.totalAggregatedAmountInUserAccounts.high))) + return "totalAggregatedAmountInUserAccounts: integer|Long expected"; + if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) + if (!$util.isInteger(message.totalSystemAmount) && !(message.totalSystemAmount && $util.isInteger(message.totalSystemAmount.low) && $util.isInteger(message.totalSystemAmount.high))) + return "totalSystemAmount: integer|Long expected"; + return null; + }; + + /** + * Creates a TokenTotalSupplyEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} TokenTotalSupplyEntry + */ + TokenTotalSupplyEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry(); + if (object.tokenId != null) + if (typeof object.tokenId === "string") + $util.base64.decode(object.tokenId, message.tokenId = $util.newBuffer($util.base64.length(object.tokenId)), 0); + else if (object.tokenId.length >= 0) + message.tokenId = object.tokenId; + if (object.totalAggregatedAmountInUserAccounts != null) + if ($util.Long) + (message.totalAggregatedAmountInUserAccounts = $util.Long.fromValue(object.totalAggregatedAmountInUserAccounts)).unsigned = true; + else if (typeof object.totalAggregatedAmountInUserAccounts === "string") + message.totalAggregatedAmountInUserAccounts = parseInt(object.totalAggregatedAmountInUserAccounts, 10); + else if (typeof object.totalAggregatedAmountInUserAccounts === "number") + message.totalAggregatedAmountInUserAccounts = object.totalAggregatedAmountInUserAccounts; + else if (typeof object.totalAggregatedAmountInUserAccounts === "object") + message.totalAggregatedAmountInUserAccounts = new $util.LongBits(object.totalAggregatedAmountInUserAccounts.low >>> 0, object.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true); + if (object.totalSystemAmount != null) + if ($util.Long) + (message.totalSystemAmount = $util.Long.fromValue(object.totalSystemAmount)).unsigned = true; + else if (typeof object.totalSystemAmount === "string") + message.totalSystemAmount = parseInt(object.totalSystemAmount, 10); + else if (typeof object.totalSystemAmount === "number") + message.totalSystemAmount = object.totalSystemAmount; + else if (typeof object.totalSystemAmount === "object") + message.totalSystemAmount = new $util.LongBits(object.totalSystemAmount.low >>> 0, object.totalSystemAmount.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a TokenTotalSupplyEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry} message TokenTotalSupplyEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenTotalSupplyEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenId = ""; + else { + object.tokenId = []; + if (options.bytes !== Array) + object.tokenId = $util.newBuffer(object.tokenId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalAggregatedAmountInUserAccounts = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalAggregatedAmountInUserAccounts = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalSystemAmount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalSystemAmount = options.longs === String ? "0" : 0; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) + object.tokenId = options.bytes === String ? $util.base64.encode(message.tokenId, 0, message.tokenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenId) : message.tokenId; + if (message.totalAggregatedAmountInUserAccounts != null && message.hasOwnProperty("totalAggregatedAmountInUserAccounts")) + if (typeof message.totalAggregatedAmountInUserAccounts === "number") + object.totalAggregatedAmountInUserAccounts = options.longs === String ? String(message.totalAggregatedAmountInUserAccounts) : message.totalAggregatedAmountInUserAccounts; + else + object.totalAggregatedAmountInUserAccounts = options.longs === String ? $util.Long.prototype.toString.call(message.totalAggregatedAmountInUserAccounts) : options.longs === Number ? new $util.LongBits(message.totalAggregatedAmountInUserAccounts.low >>> 0, message.totalAggregatedAmountInUserAccounts.high >>> 0).toNumber(true) : message.totalAggregatedAmountInUserAccounts; + if (message.totalSystemAmount != null && message.hasOwnProperty("totalSystemAmount")) + if (typeof message.totalSystemAmount === "number") + object.totalSystemAmount = options.longs === String ? String(message.totalSystemAmount) : message.totalSystemAmount; + else + object.totalSystemAmount = options.longs === String ? $util.Long.prototype.toString.call(message.totalSystemAmount) : options.longs === Number ? new $util.LongBits(message.totalSystemAmount.low >>> 0, message.totalSystemAmount.high >>> 0).toNumber(true) : message.totalSystemAmount; + return object; + }; + + /** + * Converts this TokenTotalSupplyEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry + * @instance + * @returns {Object.} JSON object + */ + TokenTotalSupplyEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenTotalSupplyEntry; + })(); + + return GetTokenTotalSupplyResponseV0; + })(); + + return GetTokenTotalSupplyResponse; + })(); + + v0.GetGroupInfoRequest = (function() { + + /** + * Properties of a GetGroupInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfoRequest + * @property {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null} [v0] GetGroupInfoRequest v0 + */ + + /** + * Constructs a new GetGroupInfoRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfoRequest. + * @implements IGetGroupInfoRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set + */ + function GetGroupInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfoRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + */ + GetGroupInfoRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + */ + Object.defineProperty(GetGroupInfoRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest instance + */ + GetGroupInfoRequest.create = function create(properties) { + return new GetGroupInfoRequest(properties); + }; + + /** + * Encodes the specified GetGroupInfoRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoRequest} message GetGroupInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest} GetGroupInfoRequest + */ + GetGroupInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest} message GetGroupInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfoRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoRequest.GetGroupInfoRequestV0 = (function() { + + /** + * Properties of a GetGroupInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @interface IGetGroupInfoRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupInfoRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupInfoRequestV0 groupContractPosition + * @property {boolean|null} [prove] GetGroupInfoRequestV0 prove + */ + + /** + * Constructs a new GetGroupInfoRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest + * @classdesc Represents a GetGroupInfoRequestV0. + * @implements IGetGroupInfoRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set + */ + function GetGroupInfoRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfoRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupInfoRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupInfoRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + */ + GetGroupInfoRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupInfoRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 instance + */ + GetGroupInfoRequestV0.create = function create(properties) { + return new GetGroupInfoRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupInfoRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.IGetGroupInfoRequestV0} message GetGroupInfoRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupInfoRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} GetGroupInfoRequestV0 + */ + GetGroupInfoRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0} message GetGroupInfoRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupInfoRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoRequest.GetGroupInfoRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupInfoRequestV0; + })(); + + return GetGroupInfoRequest; + })(); + + v0.GetGroupInfoResponse = (function() { + + /** + * Properties of a GetGroupInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfoResponse + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null} [v0] GetGroupInfoResponse v0 + */ + + /** + * Constructs a new GetGroupInfoResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfoResponse. + * @implements IGetGroupInfoResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set + */ + function GetGroupInfoResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfoResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + */ + GetGroupInfoResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + */ + Object.defineProperty(GetGroupInfoResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse instance + */ + GetGroupInfoResponse.create = function create(properties) { + return new GetGroupInfoResponse(properties); + }; + + /** + * Encodes the specified GetGroupInfoResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfoResponse} message GetGroupInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse} GetGroupInfoResponse + */ + GetGroupInfoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse} message GetGroupInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfoResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoResponse.GetGroupInfoResponseV0 = (function() { + + /** + * Properties of a GetGroupInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @interface IGetGroupInfoResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null} [groupInfo] GetGroupInfoResponseV0 groupInfo + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfoResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfoResponseV0 metadata + */ + + /** + * Constructs a new GetGroupInfoResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse + * @classdesc Represents a GetGroupInfoResponseV0. + * @implements IGetGroupInfoResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set + */ + function GetGroupInfoResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfoResponseV0 groupInfo. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo|null|undefined} groupInfo + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.groupInfo = null; + + /** + * GetGroupInfoResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.proof = null; + + /** + * GetGroupInfoResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + GetGroupInfoResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfoResponseV0 result. + * @member {"groupInfo"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + */ + Object.defineProperty(GetGroupInfoResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupInfo", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfoResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 instance + */ + GetGroupInfoResponseV0.create = function create(properties) { + return new GetGroupInfoResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupInfoResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfoResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.IGetGroupInfoResponseV0} message GetGroupInfoResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfoResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 4: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfoResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfoResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfoResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfoResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify(message.groupInfo); + if (error) + return "groupInfo." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupInfoResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} GetGroupInfoResponseV0 + */ + GetGroupInfoResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0(); + if (object.groupInfo != null) { + if (typeof object.groupInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.groupInfo: object expected"); + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.fromObject(object.groupInfo); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfoResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0} message GetGroupInfoResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfoResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.toObject(message.groupInfo, options); + if (options.oneofs) + object.result = "groupInfo"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupInfoResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfoResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfoResponseV0.GroupMemberEntry = (function() { + + /** + * Properties of a GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupMemberEntry + * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId + * @property {number|null} [power] GroupMemberEntry power + */ + + /** + * Constructs a new GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupMemberEntry. + * @implements IGroupMemberEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set + */ + function GroupMemberEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMemberEntry memberId. + * @member {Uint8Array} memberId + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.memberId = $util.newBuffer([]); + + /** + * GroupMemberEntry power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.power = 0; + + /** + * Creates a new GroupMemberEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry instance + */ + GroupMemberEntry.create = function create(properties) { + return new GroupMemberEntry(properties); + }; + + /** + * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.memberId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMemberEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMemberEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberId != null && message.hasOwnProperty("memberId")) + if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) + return "memberId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} GroupMemberEntry + */ + GroupMemberEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry(); + if (object.memberId != null) + if (typeof object.memberId === "string") + $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); + else if (object.memberId.length >= 0) + message.memberId = object.memberId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry} message GroupMemberEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMemberEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.memberId = ""; + else { + object.memberId = []; + if (options.bytes !== Array) + object.memberId = $util.newBuffer(object.memberId); + } + object.power = 0; + } + if (message.memberId != null && message.hasOwnProperty("memberId")) + object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupMemberEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry + * @instance + * @returns {Object.} JSON object + */ + GroupMemberEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupMemberEntry; + })(); + + GetGroupInfoResponseV0.GroupInfoEntry = (function() { + + /** + * Properties of a GroupInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupInfoEntry + * @property {Array.|null} [members] GroupInfoEntry members + * @property {number|null} [groupRequiredPower] GroupInfoEntry groupRequiredPower + */ + + /** + * Constructs a new GroupInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupInfoEntry. + * @implements IGroupInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set + */ + function GroupInfoEntry(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupInfoEntry members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + */ + GroupInfoEntry.prototype.members = $util.emptyArray; + + /** + * GroupInfoEntry groupRequiredPower. + * @member {number} groupRequiredPower + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + */ + GroupInfoEntry.prototype.groupRequiredPower = 0; + + /** + * Creates a new GroupInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry instance + */ + GroupInfoEntry.create = function create(properties) { + return new GroupInfoEntry(properties); + }; + + /** + * Encodes the specified GroupInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupRequiredPower); + return writer; + }; + + /** + * Encodes the specified GroupInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry} message GroupInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); + break; + case 2: + message.groupRequiredPower = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + if (!$util.isInteger(message.groupRequiredPower)) + return "groupRequiredPower: integer expected"; + return null; + }; + + /** + * Creates a GroupInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} GroupInfoEntry + */ + GroupInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry(); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.fromObject(object.members[i]); + } + } + if (object.groupRequiredPower != null) + message.groupRequiredPower = object.groupRequiredPower >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry} message GroupInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) + object.groupRequiredPower = 0; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupMemberEntry.toObject(message.members[j], options); + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + object.groupRequiredPower = message.groupRequiredPower; + return object; + }; + + /** + * Converts this GroupInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry + * @instance + * @returns {Object.} JSON object + */ + GroupInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfoEntry; + })(); + + GetGroupInfoResponseV0.GroupInfo = (function() { + + /** + * Properties of a GroupInfo. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @interface IGroupInfo + * @property {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null} [groupInfo] GroupInfo groupInfo + */ + + /** + * Constructs a new GroupInfo. + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0 + * @classdesc Represents a GroupInfo. + * @implements IGroupInfo + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set + */ + function GroupInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupInfo groupInfo. + * @member {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfoEntry|null|undefined} groupInfo + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @instance + */ + GroupInfo.prototype.groupInfo = null; + + /** + * Creates a new GroupInfo instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo instance + */ + GroupInfo.create = function create(properties) { + return new GroupInfo(properties); + }; + + /** + * Encodes the specified GroupInfo message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfo != null && Object.hasOwnProperty.call(message, "groupInfo")) + $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.encode(message.groupInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupInfo message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.IGroupInfo} message GroupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfo message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfo message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.verify(message.groupInfo); + if (error) + return "groupInfo." + error; + } + return null; + }; + + /** + * Creates a GroupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} GroupInfo + */ + GroupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo(); + if (object.groupInfo != null) { + if (typeof object.groupInfo !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo.groupInfo: object expected"); + message.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.fromObject(object.groupInfo); + } + return message; + }; + + /** + * Creates a plain object from a GroupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo} message GroupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.groupInfo = null; + if (message.groupInfo != null && message.hasOwnProperty("groupInfo")) + object.groupInfo = $root.org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfoEntry.toObject(message.groupInfo, options); + return object; + }; + + /** + * Converts this GroupInfo to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfoResponse.GetGroupInfoResponseV0.GroupInfo + * @instance + * @returns {Object.} JSON object + */ + GroupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfo; + })(); + + return GetGroupInfoResponseV0; + })(); + + return GetGroupInfoResponse; + })(); + + v0.GetGroupInfosRequest = (function() { + + /** + * Properties of a GetGroupInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfosRequest + * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null} [v0] GetGroupInfosRequest v0 + */ + + /** + * Constructs a new GetGroupInfosRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfosRequest. + * @implements IGetGroupInfosRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set + */ + function GetGroupInfosRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfosRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + */ + GetGroupInfosRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + */ + Object.defineProperty(GetGroupInfosRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest instance + */ + GetGroupInfosRequest.create = function create(properties) { + return new GetGroupInfosRequest(properties); + }; + + /** + * Encodes the specified GetGroupInfosRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosRequest} message GetGroupInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest} GetGroupInfosRequest + */ + GetGroupInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest} message GetGroupInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfosRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosRequest.StartAtGroupContractPosition = (function() { + + /** + * Properties of a StartAtGroupContractPosition. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @interface IStartAtGroupContractPosition + * @property {number|null} [startGroupContractPosition] StartAtGroupContractPosition startGroupContractPosition + * @property {boolean|null} [startGroupContractPositionIncluded] StartAtGroupContractPosition startGroupContractPositionIncluded + */ + + /** + * Constructs a new StartAtGroupContractPosition. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @classdesc Represents a StartAtGroupContractPosition. + * @implements IStartAtGroupContractPosition + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set + */ + function StartAtGroupContractPosition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtGroupContractPosition startGroupContractPosition. + * @member {number} startGroupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + */ + StartAtGroupContractPosition.prototype.startGroupContractPosition = 0; + + /** + * StartAtGroupContractPosition startGroupContractPositionIncluded. + * @member {boolean} startGroupContractPositionIncluded + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + */ + StartAtGroupContractPosition.prototype.startGroupContractPositionIncluded = false; + + /** + * Creates a new StartAtGroupContractPosition instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition instance + */ + StartAtGroupContractPosition.create = function create(properties) { + return new StartAtGroupContractPosition(properties); + }; + + /** + * Encodes the specified StartAtGroupContractPosition message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtGroupContractPosition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startGroupContractPosition != null && Object.hasOwnProperty.call(message, "startGroupContractPosition")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.startGroupContractPosition); + if (message.startGroupContractPositionIncluded != null && Object.hasOwnProperty.call(message, "startGroupContractPositionIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startGroupContractPositionIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtGroupContractPosition message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition} message StartAtGroupContractPosition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtGroupContractPosition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtGroupContractPosition message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtGroupContractPosition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startGroupContractPosition = reader.uint32(); + break; + case 2: + message.startGroupContractPositionIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtGroupContractPosition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtGroupContractPosition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtGroupContractPosition message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtGroupContractPosition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) + if (!$util.isInteger(message.startGroupContractPosition)) + return "startGroupContractPosition: integer expected"; + if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) + if (typeof message.startGroupContractPositionIncluded !== "boolean") + return "startGroupContractPositionIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtGroupContractPosition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} StartAtGroupContractPosition + */ + StartAtGroupContractPosition.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition(); + if (object.startGroupContractPosition != null) + message.startGroupContractPosition = object.startGroupContractPosition >>> 0; + if (object.startGroupContractPositionIncluded != null) + message.startGroupContractPositionIncluded = Boolean(object.startGroupContractPositionIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtGroupContractPosition message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition} message StartAtGroupContractPosition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtGroupContractPosition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startGroupContractPosition = 0; + object.startGroupContractPositionIncluded = false; + } + if (message.startGroupContractPosition != null && message.hasOwnProperty("startGroupContractPosition")) + object.startGroupContractPosition = message.startGroupContractPosition; + if (message.startGroupContractPositionIncluded != null && message.hasOwnProperty("startGroupContractPositionIncluded")) + object.startGroupContractPositionIncluded = message.startGroupContractPositionIncluded; + return object; + }; + + /** + * Converts this StartAtGroupContractPosition to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition + * @instance + * @returns {Object.} JSON object + */ + StartAtGroupContractPosition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtGroupContractPosition; + })(); + + GetGroupInfosRequest.GetGroupInfosRequestV0 = (function() { + + /** + * Properties of a GetGroupInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @interface IGetGroupInfosRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupInfosRequestV0 contractId + * @property {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null} [startAtGroupContractPosition] GetGroupInfosRequestV0 startAtGroupContractPosition + * @property {number|null} [count] GetGroupInfosRequestV0 count + * @property {boolean|null} [prove] GetGroupInfosRequestV0 prove + */ + + /** + * Constructs a new GetGroupInfosRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest + * @classdesc Represents a GetGroupInfosRequestV0. + * @implements IGetGroupInfosRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set + */ + function GetGroupInfosRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfosRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupInfosRequestV0 startAtGroupContractPosition. + * @member {org.dash.platform.dapi.v0.GetGroupInfosRequest.IStartAtGroupContractPosition|null|undefined} startAtGroupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.startAtGroupContractPosition = null; + + /** + * GetGroupInfosRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.count = 0; + + /** + * GetGroupInfosRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + */ + GetGroupInfosRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupInfosRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 instance + */ + GetGroupInfosRequestV0.create = function create(properties) { + return new GetGroupInfosRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupInfosRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.startAtGroupContractPosition != null && Object.hasOwnProperty.call(message, "startAtGroupContractPosition")) + $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.encode(message.startAtGroupContractPosition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.IGetGroupInfosRequestV0} message GetGroupInfosRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.decode(reader, reader.uint32()); + break; + case 3: + message.count = reader.uint32(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.verify(message.startAtGroupContractPosition); + if (error) + return "startAtGroupContractPosition." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupInfosRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} GetGroupInfosRequestV0 + */ + GetGroupInfosRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.startAtGroupContractPosition != null) { + if (typeof object.startAtGroupContractPosition !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0.startAtGroupContractPosition: object expected"); + message.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.fromObject(object.startAtGroupContractPosition); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0} message GetGroupInfosRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.startAtGroupContractPosition = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.startAtGroupContractPosition != null && message.hasOwnProperty("startAtGroupContractPosition")) + object.startAtGroupContractPosition = $root.org.dash.platform.dapi.v0.GetGroupInfosRequest.StartAtGroupContractPosition.toObject(message.startAtGroupContractPosition, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupInfosRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosRequest.GetGroupInfosRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupInfosRequestV0; + })(); + + return GetGroupInfosRequest; + })(); + + v0.GetGroupInfosResponse = (function() { + + /** + * Properties of a GetGroupInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupInfosResponse + * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null} [v0] GetGroupInfosResponse v0 + */ + + /** + * Constructs a new GetGroupInfosResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupInfosResponse. + * @implements IGetGroupInfosResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set + */ + function GetGroupInfosResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfosResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + */ + GetGroupInfosResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + */ + Object.defineProperty(GetGroupInfosResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse instance + */ + GetGroupInfosResponse.create = function create(properties) { + return new GetGroupInfosResponse(properties); + }; + + /** + * Encodes the specified GetGroupInfosResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupInfosResponse} message GetGroupInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse} GetGroupInfosResponse + */ + GetGroupInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse} message GetGroupInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupInfosResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosResponse.GetGroupInfosResponseV0 = (function() { + + /** + * Properties of a GetGroupInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @interface IGetGroupInfosResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null} [groupInfos] GetGroupInfosResponseV0 groupInfos + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupInfosResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupInfosResponseV0 metadata + */ + + /** + * Constructs a new GetGroupInfosResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse + * @classdesc Represents a GetGroupInfosResponseV0. + * @implements IGetGroupInfosResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set + */ + function GetGroupInfosResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupInfosResponseV0 groupInfos. + * @member {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos|null|undefined} groupInfos + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.groupInfos = null; + + /** + * GetGroupInfosResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.proof = null; + + /** + * GetGroupInfosResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + GetGroupInfosResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupInfosResponseV0 result. + * @member {"groupInfos"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + */ + Object.defineProperty(GetGroupInfosResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupInfos", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupInfosResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 instance + */ + GetGroupInfosResponseV0.create = function create(properties) { + return new GetGroupInfosResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupInfosResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfos != null && Object.hasOwnProperty.call(message, "groupInfos")) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.encode(message.groupInfos, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupInfosResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.IGetGroupInfosResponseV0} message GetGroupInfosResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupInfosResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 4: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupInfosResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupInfosResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupInfosResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupInfosResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify(message.groupInfos); + if (error) + return "groupInfos." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupInfosResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} GetGroupInfosResponseV0 + */ + GetGroupInfosResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0(); + if (object.groupInfos != null) { + if (typeof object.groupInfos !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.groupInfos: object expected"); + message.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.fromObject(object.groupInfos); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupInfosResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0} message GetGroupInfosResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupInfosResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + object.groupInfos = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.toObject(message.groupInfos, options); + if (options.oneofs) + object.result = "groupInfos"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupInfosResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupInfosResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupInfosResponseV0.GroupMemberEntry = (function() { + + /** + * Properties of a GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupMemberEntry + * @property {Uint8Array|null} [memberId] GroupMemberEntry memberId + * @property {number|null} [power] GroupMemberEntry power + */ + + /** + * Constructs a new GroupMemberEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupMemberEntry. + * @implements IGroupMemberEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set + */ + function GroupMemberEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMemberEntry memberId. + * @member {Uint8Array} memberId + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.memberId = $util.newBuffer([]); + + /** + * GroupMemberEntry power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + */ + GroupMemberEntry.prototype.power = 0; + + /** + * Creates a new GroupMemberEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry instance + */ + GroupMemberEntry.create = function create(properties) { + return new GroupMemberEntry(properties); + }; + + /** + * Encodes the specified GroupMemberEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberId != null && Object.hasOwnProperty.call(message, "memberId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.memberId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupMemberEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupMemberEntry} message GroupMemberEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMemberEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.memberId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMemberEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMemberEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMemberEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMemberEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberId != null && message.hasOwnProperty("memberId")) + if (!(message.memberId && typeof message.memberId.length === "number" || $util.isString(message.memberId))) + return "memberId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupMemberEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} GroupMemberEntry + */ + GroupMemberEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry(); + if (object.memberId != null) + if (typeof object.memberId === "string") + $util.base64.decode(object.memberId, message.memberId = $util.newBuffer($util.base64.length(object.memberId)), 0); + else if (object.memberId.length >= 0) + message.memberId = object.memberId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupMemberEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry} message GroupMemberEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMemberEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.memberId = ""; + else { + object.memberId = []; + if (options.bytes !== Array) + object.memberId = $util.newBuffer(object.memberId); + } + object.power = 0; + } + if (message.memberId != null && message.hasOwnProperty("memberId")) + object.memberId = options.bytes === String ? $util.base64.encode(message.memberId, 0, message.memberId.length) : options.bytes === Array ? Array.prototype.slice.call(message.memberId) : message.memberId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupMemberEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry + * @instance + * @returns {Object.} JSON object + */ + GroupMemberEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupMemberEntry; + })(); + + GetGroupInfosResponseV0.GroupPositionInfoEntry = (function() { + + /** + * Properties of a GroupPositionInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupPositionInfoEntry + * @property {number|null} [groupContractPosition] GroupPositionInfoEntry groupContractPosition + * @property {Array.|null} [members] GroupPositionInfoEntry members + * @property {number|null} [groupRequiredPower] GroupPositionInfoEntry groupRequiredPower + */ + + /** + * Constructs a new GroupPositionInfoEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupPositionInfoEntry. + * @implements IGroupPositionInfoEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set + */ + function GroupPositionInfoEntry(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupPositionInfoEntry groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.groupContractPosition = 0; + + /** + * GroupPositionInfoEntry members. + * @member {Array.} members + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.members = $util.emptyArray; + + /** + * GroupPositionInfoEntry groupRequiredPower. + * @member {number} groupRequiredPower + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + */ + GroupPositionInfoEntry.prototype.groupRequiredPower = 0; + + /** + * Creates a new GroupPositionInfoEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry instance + */ + GroupPositionInfoEntry.create = function create(properties) { + return new GroupPositionInfoEntry(properties); + }; + + /** + * Encodes the specified GroupPositionInfoEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupPositionInfoEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.groupContractPosition); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.encode(message.members[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.groupRequiredPower != null && Object.hasOwnProperty.call(message, "groupRequiredPower")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.groupRequiredPower); + return writer; + }; + + /** + * Encodes the specified GroupPositionInfoEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupPositionInfoEntry} message GroupPositionInfoEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupPositionInfoEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupPositionInfoEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupPositionInfoEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupContractPosition = reader.uint32(); + break; + case 2: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.decode(reader, reader.uint32())); + break; + case 3: + message.groupRequiredPower = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupPositionInfoEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupPositionInfoEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupPositionInfoEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupPositionInfoEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.verify(message.members[i]); + if (error) + return "members." + error; + } + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + if (!$util.isInteger(message.groupRequiredPower)) + return "groupRequiredPower: integer expected"; + return null; + }; + + /** + * Creates a GroupPositionInfoEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} GroupPositionInfoEntry + */ + GroupPositionInfoEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry(); + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.members: object expected"); + message.members[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.fromObject(object.members[i]); + } + } + if (object.groupRequiredPower != null) + message.groupRequiredPower = object.groupRequiredPower >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupPositionInfoEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry} message GroupPositionInfoEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupPositionInfoEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.groupContractPosition = 0; + object.groupRequiredPower = 0; + } + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupMemberEntry.toObject(message.members[j], options); + } + if (message.groupRequiredPower != null && message.hasOwnProperty("groupRequiredPower")) + object.groupRequiredPower = message.groupRequiredPower; + return object; + }; + + /** + * Converts this GroupPositionInfoEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry + * @instance + * @returns {Object.} JSON object + */ + GroupPositionInfoEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupPositionInfoEntry; + })(); + + GetGroupInfosResponseV0.GroupInfos = (function() { + + /** + * Properties of a GroupInfos. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @interface IGroupInfos + * @property {Array.|null} [groupInfos] GroupInfos groupInfos + */ + + /** + * Constructs a new GroupInfos. + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0 + * @classdesc Represents a GroupInfos. + * @implements IGroupInfos + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set + */ + function GroupInfos(properties) { + this.groupInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupInfos groupInfos. + * @member {Array.} groupInfos + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @instance + */ + GroupInfos.prototype.groupInfos = $util.emptyArray; + + /** + * Creates a new GroupInfos instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos instance + */ + GroupInfos.create = function create(properties) { + return new GroupInfos(properties); + }; + + /** + * Encodes the specified GroupInfos message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfos.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupInfos != null && message.groupInfos.length) + for (var i = 0; i < message.groupInfos.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.encode(message.groupInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupInfos message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.IGroupInfos} message GroupInfos message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupInfos.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupInfos message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfos.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupInfos && message.groupInfos.length)) + message.groupInfos = []; + message.groupInfos.push($root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupInfos message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupInfos.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupInfos message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupInfos.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupInfos != null && message.hasOwnProperty("groupInfos")) { + if (!Array.isArray(message.groupInfos)) + return "groupInfos: array expected"; + for (var i = 0; i < message.groupInfos.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.verify(message.groupInfos[i]); + if (error) + return "groupInfos." + error; + } + } + return null; + }; + + /** + * Creates a GroupInfos message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} GroupInfos + */ + GroupInfos.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos(); + if (object.groupInfos) { + if (!Array.isArray(object.groupInfos)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: array expected"); + message.groupInfos = []; + for (var i = 0; i < object.groupInfos.length; ++i) { + if (typeof object.groupInfos[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos.groupInfos: object expected"); + message.groupInfos[i] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.fromObject(object.groupInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupInfos message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @static + * @param {org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos} message GroupInfos + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupInfos.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupInfos = []; + if (message.groupInfos && message.groupInfos.length) { + object.groupInfos = []; + for (var j = 0; j < message.groupInfos.length; ++j) + object.groupInfos[j] = $root.org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupPositionInfoEntry.toObject(message.groupInfos[j], options); + } + return object; + }; + + /** + * Converts this GroupInfos to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupInfosResponse.GetGroupInfosResponseV0.GroupInfos + * @instance + * @returns {Object.} JSON object + */ + GroupInfos.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupInfos; + })(); + + return GetGroupInfosResponseV0; + })(); + + return GetGroupInfosResponse; + })(); + + v0.GetGroupActionsRequest = (function() { + + /** + * Properties of a GetGroupActionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionsRequest + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null} [v0] GetGroupActionsRequest v0 + */ + + /** + * Constructs a new GetGroupActionsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionsRequest. + * @implements IGetGroupActionsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set + */ + function GetGroupActionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionsRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + */ + GetGroupActionsRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + */ + Object.defineProperty(GetGroupActionsRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest instance + */ + GetGroupActionsRequest.create = function create(properties) { + return new GetGroupActionsRequest(properties); + }; + + /** + * Encodes the specified GetGroupActionsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsRequest} message GetGroupActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest} GetGroupActionsRequest + */ + GetGroupActionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest} message GetGroupActionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionStatus enum. + * @name org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus + * @enum {number} + * @property {number} ACTIVE=0 ACTIVE value + * @property {number} CLOSED=1 CLOSED value + */ + GetGroupActionsRequest.ActionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVE"] = 0; + values[valuesById[1] = "CLOSED"] = 1; + return values; + })(); + + GetGroupActionsRequest.StartAtActionId = (function() { + + /** + * Properties of a StartAtActionId. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @interface IStartAtActionId + * @property {Uint8Array|null} [startActionId] StartAtActionId startActionId + * @property {boolean|null} [startActionIdIncluded] StartAtActionId startActionIdIncluded + */ + + /** + * Constructs a new StartAtActionId. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @classdesc Represents a StartAtActionId. + * @implements IStartAtActionId + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set + */ + function StartAtActionId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartAtActionId startActionId. + * @member {Uint8Array} startActionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + */ + StartAtActionId.prototype.startActionId = $util.newBuffer([]); + + /** + * StartAtActionId startActionIdIncluded. + * @member {boolean} startActionIdIncluded + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + */ + StartAtActionId.prototype.startActionIdIncluded = false; + + /** + * Creates a new StartAtActionId instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId instance + */ + StartAtActionId.create = function create(properties) { + return new StartAtActionId(properties); + }; + + /** + * Encodes the specified StartAtActionId message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtActionId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startActionId != null && Object.hasOwnProperty.call(message, "startActionId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startActionId); + if (message.startActionIdIncluded != null && Object.hasOwnProperty.call(message, "startActionIdIncluded")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.startActionIdIncluded); + return writer; + }; + + /** + * Encodes the specified StartAtActionId message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId} message StartAtActionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartAtActionId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartAtActionId message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtActionId.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startActionId = reader.bytes(); + break; + case 2: + message.startActionIdIncluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartAtActionId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartAtActionId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartAtActionId message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartAtActionId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startActionId != null && message.hasOwnProperty("startActionId")) + if (!(message.startActionId && typeof message.startActionId.length === "number" || $util.isString(message.startActionId))) + return "startActionId: buffer expected"; + if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) + if (typeof message.startActionIdIncluded !== "boolean") + return "startActionIdIncluded: boolean expected"; + return null; + }; + + /** + * Creates a StartAtActionId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} StartAtActionId + */ + StartAtActionId.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId(); + if (object.startActionId != null) + if (typeof object.startActionId === "string") + $util.base64.decode(object.startActionId, message.startActionId = $util.newBuffer($util.base64.length(object.startActionId)), 0); + else if (object.startActionId.length >= 0) + message.startActionId = object.startActionId; + if (object.startActionIdIncluded != null) + message.startActionIdIncluded = Boolean(object.startActionIdIncluded); + return message; + }; + + /** + * Creates a plain object from a StartAtActionId message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId} message StartAtActionId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartAtActionId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.startActionId = ""; + else { + object.startActionId = []; + if (options.bytes !== Array) + object.startActionId = $util.newBuffer(object.startActionId); + } + object.startActionIdIncluded = false; + } + if (message.startActionId != null && message.hasOwnProperty("startActionId")) + object.startActionId = options.bytes === String ? $util.base64.encode(message.startActionId, 0, message.startActionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.startActionId) : message.startActionId; + if (message.startActionIdIncluded != null && message.hasOwnProperty("startActionIdIncluded")) + object.startActionIdIncluded = message.startActionIdIncluded; + return object; + }; + + /** + * Converts this StartAtActionId to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId + * @instance + * @returns {Object.} JSON object + */ + StartAtActionId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartAtActionId; + })(); + + GetGroupActionsRequest.GetGroupActionsRequestV0 = (function() { + + /** + * Properties of a GetGroupActionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @interface IGetGroupActionsRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupActionsRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupActionsRequestV0 groupContractPosition + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus|null} [status] GetGroupActionsRequestV0 status + * @property {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null} [startAtActionId] GetGroupActionsRequestV0 startAtActionId + * @property {number|null} [count] GetGroupActionsRequestV0 count + * @property {boolean|null} [prove] GetGroupActionsRequestV0 prove + */ + + /** + * Constructs a new GetGroupActionsRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest + * @classdesc Represents a GetGroupActionsRequestV0. + * @implements IGetGroupActionsRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set + */ + function GetGroupActionsRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionsRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupActionsRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupActionsRequestV0 status. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus} status + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.status = 0; + + /** + * GetGroupActionsRequestV0 startAtActionId. + * @member {org.dash.platform.dapi.v0.GetGroupActionsRequest.IStartAtActionId|null|undefined} startAtActionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.startAtActionId = null; + + /** + * GetGroupActionsRequestV0 count. + * @member {number} count + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.count = 0; + + /** + * GetGroupActionsRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + */ + GetGroupActionsRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupActionsRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 instance + */ + GetGroupActionsRequestV0.create = function create(properties) { + return new GetGroupActionsRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupActionsRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.startAtActionId != null && Object.hasOwnProperty.call(message, "startAtActionId")) + $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.encode(message.startAtActionId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.count); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.IGetGroupActionsRequestV0} message GetGroupActionsRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.decode(reader, reader.uint32()); + break; + case 5: + message.count = reader.uint32(); + break; + case 6: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + break; + } + if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.verify(message.startAtActionId); + if (error) + return "startAtActionId." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupActionsRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} GetGroupActionsRequestV0 + */ + GetGroupActionsRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + switch (object.status) { + case "ACTIVE": + case 0: + message.status = 0; + break; + case "CLOSED": + case 1: + message.status = 1; + break; + } + if (object.startAtActionId != null) { + if (typeof object.startAtActionId !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0.startAtActionId: object expected"); + message.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.fromObject(object.startAtActionId); + } + if (object.count != null) + message.count = object.count >>> 0; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0} message GetGroupActionsRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.status = options.enums === String ? "ACTIVE" : 0; + object.startAtActionId = null; + object.count = 0; + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.ActionStatus[message.status] : message.status; + if (message.startAtActionId != null && message.hasOwnProperty("startAtActionId")) + object.startAtActionId = $root.org.dash.platform.dapi.v0.GetGroupActionsRequest.StartAtActionId.toObject(message.startAtActionId, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupActionsRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsRequest.GetGroupActionsRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupActionsRequestV0; + })(); + + return GetGroupActionsRequest; + })(); + + v0.GetGroupActionsResponse = (function() { + + /** + * Properties of a GetGroupActionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionsResponse + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null} [v0] GetGroupActionsResponse v0 + */ + + /** + * Constructs a new GetGroupActionsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionsResponse. + * @implements IGetGroupActionsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set + */ + function GetGroupActionsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionsResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + */ + GetGroupActionsResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + */ + Object.defineProperty(GetGroupActionsResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse instance + */ + GetGroupActionsResponse.create = function create(properties) { + return new GetGroupActionsResponse(properties); + }; + + /** + * Encodes the specified GetGroupActionsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionsResponse} message GetGroupActionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse} GetGroupActionsResponse + */ + GetGroupActionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse} message GetGroupActionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionsResponse.GetGroupActionsResponseV0 = (function() { + + /** + * Properties of a GetGroupActionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @interface IGetGroupActionsResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null} [groupActions] GetGroupActionsResponseV0 groupActions + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionsResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionsResponseV0 metadata + */ + + /** + * Constructs a new GetGroupActionsResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse + * @classdesc Represents a GetGroupActionsResponseV0. + * @implements IGetGroupActionsResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set + */ + function GetGroupActionsResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionsResponseV0 groupActions. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions|null|undefined} groupActions + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.groupActions = null; + + /** + * GetGroupActionsResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.proof = null; + + /** + * GetGroupActionsResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + GetGroupActionsResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionsResponseV0 result. + * @member {"groupActions"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + */ + Object.defineProperty(GetGroupActionsResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupActions", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionsResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 instance + */ + GetGroupActionsResponseV0.create = function create(properties) { + return new GetGroupActionsResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupActionsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActions != null && Object.hasOwnProperty.call(message, "groupActions")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.encode(message.groupActions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.IGetGroupActionsResponseV0} message GetGroupActionsResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionsResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionsResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionsResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionsResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionsResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify(message.groupActions); + if (error) + return "groupActions." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupActionsResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} GetGroupActionsResponseV0 + */ + GetGroupActionsResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0(); + if (object.groupActions != null) { + if (typeof object.groupActions !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.groupActions: object expected"); + message.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.fromObject(object.groupActions); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionsResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0} message GetGroupActionsResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionsResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + object.groupActions = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.toObject(message.groupActions, options); + if (options.oneofs) + object.result = "groupActions"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupActionsResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionsResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionsResponseV0.MintEvent = (function() { + + /** + * Properties of a MintEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IMintEvent + * @property {number|Long|null} [amount] MintEvent amount + * @property {Uint8Array|null} [recipientId] MintEvent recipientId + * @property {string|null} [publicNote] MintEvent publicNote + */ + + /** + * Constructs a new MintEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a MintEvent. + * @implements IMintEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set + */ + function MintEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MintEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MintEvent recipientId. + * @member {Uint8Array} recipientId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.recipientId = $util.newBuffer([]); + + /** + * MintEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + */ + MintEvent.prototype.publicNote = ""; + + /** + * Creates a new MintEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent instance + */ + MintEvent.create = function create(properties) { + return new MintEvent(properties); + }; + + /** + * Encodes the specified MintEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MintEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); + if (message.recipientId != null && Object.hasOwnProperty.call(message, "recipientId")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.recipientId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified MintEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent} message MintEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MintEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MintEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MintEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + case 2: + message.recipientId = reader.bytes(); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MintEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MintEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MintEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MintEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + if (!(message.recipientId && typeof message.recipientId.length === "number" || $util.isString(message.recipientId))) + return "recipientId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a MintEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} MintEvent + */ + MintEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent(); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + if (object.recipientId != null) + if (typeof object.recipientId === "string") + $util.base64.decode(object.recipientId, message.recipientId = $util.newBuffer($util.base64.length(object.recipientId)), 0); + else if (object.recipientId.length >= 0) + message.recipientId = object.recipientId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a MintEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent} message MintEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MintEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.recipientId = ""; + else { + object.recipientId = []; + if (options.bytes !== Array) + object.recipientId = $util.newBuffer(object.recipientId); + } + object.publicNote = ""; + } + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + if (message.recipientId != null && message.hasOwnProperty("recipientId")) + object.recipientId = options.bytes === String ? $util.base64.encode(message.recipientId, 0, message.recipientId.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientId) : message.recipientId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this MintEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent + * @instance + * @returns {Object.} JSON object + */ + MintEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MintEvent; + })(); + + GetGroupActionsResponseV0.BurnEvent = (function() { + + /** + * Properties of a BurnEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IBurnEvent + * @property {number|Long|null} [amount] BurnEvent amount + * @property {string|null} [publicNote] BurnEvent publicNote + */ + + /** + * Constructs a new BurnEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a BurnEvent. + * @implements IBurnEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set + */ + function BurnEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BurnEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + */ + BurnEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BurnEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + */ + BurnEvent.prototype.publicNote = ""; + + /** + * Creates a new BurnEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent instance + */ + BurnEvent.create = function create(properties) { + return new BurnEvent(properties); + }; + + /** + * Encodes the specified BurnEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BurnEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified BurnEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent} message BurnEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BurnEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BurnEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BurnEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BurnEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BurnEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BurnEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BurnEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a BurnEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} BurnEvent + */ + BurnEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent(); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a BurnEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent} message BurnEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BurnEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + object.publicNote = ""; + } + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this BurnEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent + * @instance + * @returns {Object.} JSON object + */ + BurnEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BurnEvent; + })(); + + GetGroupActionsResponseV0.FreezeEvent = (function() { + + /** + * Properties of a FreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IFreezeEvent + * @property {Uint8Array|null} [frozenId] FreezeEvent frozenId + * @property {string|null} [publicNote] FreezeEvent publicNote + */ + + /** + * Constructs a new FreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a FreezeEvent. + * @implements IFreezeEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set + */ + function FreezeEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FreezeEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + */ + FreezeEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * FreezeEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + */ + FreezeEvent.prototype.publicNote = ""; + + /** + * Creates a new FreezeEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent instance + */ + FreezeEvent.create = function create(properties) { + return new FreezeEvent(properties); + }; + + /** + * Encodes the specified FreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreezeEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified FreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent} message FreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FreezeEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreezeEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FreezeEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreezeEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FreezeEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FreezeEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a FreezeEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} FreezeEvent + */ + FreezeEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a FreezeEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent} message FreezeEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FreezeEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + object.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this FreezeEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent + * @instance + * @returns {Object.} JSON object + */ + FreezeEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FreezeEvent; + })(); + + GetGroupActionsResponseV0.UnfreezeEvent = (function() { + + /** + * Properties of an UnfreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IUnfreezeEvent + * @property {Uint8Array|null} [frozenId] UnfreezeEvent frozenId + * @property {string|null} [publicNote] UnfreezeEvent publicNote + */ + + /** + * Constructs a new UnfreezeEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an UnfreezeEvent. + * @implements IUnfreezeEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set + */ + function UnfreezeEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnfreezeEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + */ + UnfreezeEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * UnfreezeEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + */ + UnfreezeEvent.prototype.publicNote = ""; + + /** + * Creates a new UnfreezeEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent instance + */ + UnfreezeEvent.create = function create(properties) { + return new UnfreezeEvent(properties); + }; + + /** + * Encodes the specified UnfreezeEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnfreezeEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified UnfreezeEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent} message UnfreezeEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnfreezeEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnfreezeEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnfreezeEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnfreezeEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnfreezeEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnfreezeEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnfreezeEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an UnfreezeEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} UnfreezeEvent + */ + UnfreezeEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an UnfreezeEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent} message UnfreezeEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnfreezeEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + object.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this UnfreezeEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent + * @instance + * @returns {Object.} JSON object + */ + UnfreezeEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UnfreezeEvent; + })(); + + GetGroupActionsResponseV0.DestroyFrozenFundsEvent = (function() { + + /** + * Properties of a DestroyFrozenFundsEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDestroyFrozenFundsEvent + * @property {Uint8Array|null} [frozenId] DestroyFrozenFundsEvent frozenId + * @property {number|Long|null} [amount] DestroyFrozenFundsEvent amount + * @property {string|null} [publicNote] DestroyFrozenFundsEvent publicNote + */ + + /** + * Constructs a new DestroyFrozenFundsEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DestroyFrozenFundsEvent. + * @implements IDestroyFrozenFundsEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set + */ + function DestroyFrozenFundsEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DestroyFrozenFundsEvent frozenId. + * @member {Uint8Array} frozenId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.frozenId = $util.newBuffer([]); + + /** + * DestroyFrozenFundsEvent amount. + * @member {number|Long} amount + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DestroyFrozenFundsEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + */ + DestroyFrozenFundsEvent.prototype.publicNote = ""; + + /** + * Creates a new DestroyFrozenFundsEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent instance + */ + DestroyFrozenFundsEvent.create = function create(properties) { + return new DestroyFrozenFundsEvent(properties); + }; + + /** + * Encodes the specified DestroyFrozenFundsEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroyFrozenFundsEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frozenId != null && Object.hasOwnProperty.call(message, "frozenId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.frozenId); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified DestroyFrozenFundsEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent} message DestroyFrozenFundsEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestroyFrozenFundsEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroyFrozenFundsEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.frozenId = reader.bytes(); + break; + case 2: + message.amount = reader.uint64(); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestroyFrozenFundsEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestroyFrozenFundsEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestroyFrozenFundsEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestroyFrozenFundsEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + if (!(message.frozenId && typeof message.frozenId.length === "number" || $util.isString(message.frozenId))) + return "frozenId: buffer expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a DestroyFrozenFundsEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} DestroyFrozenFundsEvent + */ + DestroyFrozenFundsEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent(); + if (object.frozenId != null) + if (typeof object.frozenId === "string") + $util.base64.decode(object.frozenId, message.frozenId = $util.newBuffer($util.base64.length(object.frozenId)), 0); + else if (object.frozenId.length >= 0) + message.frozenId = object.frozenId; + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a DestroyFrozenFundsEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent} message DestroyFrozenFundsEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestroyFrozenFundsEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.frozenId = ""; + else { + object.frozenId = []; + if (options.bytes !== Array) + object.frozenId = $util.newBuffer(object.frozenId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + object.publicNote = ""; + } + if (message.frozenId != null && message.hasOwnProperty("frozenId")) + object.frozenId = options.bytes === String ? $util.base64.encode(message.frozenId, 0, message.frozenId.length) : options.bytes === Array ? Array.prototype.slice.call(message.frozenId) : message.frozenId; + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this DestroyFrozenFundsEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent + * @instance + * @returns {Object.} JSON object + */ + DestroyFrozenFundsEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DestroyFrozenFundsEvent; + })(); + + GetGroupActionsResponseV0.SharedEncryptedNote = (function() { + + /** + * Properties of a SharedEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ISharedEncryptedNote + * @property {number|null} [senderKeyIndex] SharedEncryptedNote senderKeyIndex + * @property {number|null} [recipientKeyIndex] SharedEncryptedNote recipientKeyIndex + * @property {Uint8Array|null} [encryptedData] SharedEncryptedNote encryptedData + */ + + /** + * Constructs a new SharedEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a SharedEncryptedNote. + * @implements ISharedEncryptedNote + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set + */ + function SharedEncryptedNote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SharedEncryptedNote senderKeyIndex. + * @member {number} senderKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.senderKeyIndex = 0; + + /** + * SharedEncryptedNote recipientKeyIndex. + * @member {number} recipientKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.recipientKeyIndex = 0; + + /** + * SharedEncryptedNote encryptedData. + * @member {Uint8Array} encryptedData + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + */ + SharedEncryptedNote.prototype.encryptedData = $util.newBuffer([]); + + /** + * Creates a new SharedEncryptedNote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote instance + */ + SharedEncryptedNote.create = function create(properties) { + return new SharedEncryptedNote(properties); + }; + + /** + * Encodes the specified SharedEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SharedEncryptedNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.senderKeyIndex != null && Object.hasOwnProperty.call(message, "senderKeyIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.senderKeyIndex); + if (message.recipientKeyIndex != null && Object.hasOwnProperty.call(message, "recipientKeyIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.recipientKeyIndex); + if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); + return writer; + }; + + /** + * Encodes the specified SharedEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ISharedEncryptedNote} message SharedEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SharedEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SharedEncryptedNote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SharedEncryptedNote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.senderKeyIndex = reader.uint32(); + break; + case 2: + message.recipientKeyIndex = reader.uint32(); + break; + case 3: + message.encryptedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SharedEncryptedNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SharedEncryptedNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SharedEncryptedNote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SharedEncryptedNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) + if (!$util.isInteger(message.senderKeyIndex)) + return "senderKeyIndex: integer expected"; + if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) + if (!$util.isInteger(message.recipientKeyIndex)) + return "recipientKeyIndex: integer expected"; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) + return "encryptedData: buffer expected"; + return null; + }; + + /** + * Creates a SharedEncryptedNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} SharedEncryptedNote + */ + SharedEncryptedNote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote(); + if (object.senderKeyIndex != null) + message.senderKeyIndex = object.senderKeyIndex >>> 0; + if (object.recipientKeyIndex != null) + message.recipientKeyIndex = object.recipientKeyIndex >>> 0; + if (object.encryptedData != null) + if (typeof object.encryptedData === "string") + $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); + else if (object.encryptedData.length >= 0) + message.encryptedData = object.encryptedData; + return message; + }; + + /** + * Creates a plain object from a SharedEncryptedNote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote} message SharedEncryptedNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SharedEncryptedNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.senderKeyIndex = 0; + object.recipientKeyIndex = 0; + if (options.bytes === String) + object.encryptedData = ""; + else { + object.encryptedData = []; + if (options.bytes !== Array) + object.encryptedData = $util.newBuffer(object.encryptedData); + } + } + if (message.senderKeyIndex != null && message.hasOwnProperty("senderKeyIndex")) + object.senderKeyIndex = message.senderKeyIndex; + if (message.recipientKeyIndex != null && message.hasOwnProperty("recipientKeyIndex")) + object.recipientKeyIndex = message.recipientKeyIndex; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; + return object; + }; + + /** + * Converts this SharedEncryptedNote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.SharedEncryptedNote + * @instance + * @returns {Object.} JSON object + */ + SharedEncryptedNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SharedEncryptedNote; + })(); + + GetGroupActionsResponseV0.PersonalEncryptedNote = (function() { + + /** + * Properties of a PersonalEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IPersonalEncryptedNote + * @property {number|null} [rootEncryptionKeyIndex] PersonalEncryptedNote rootEncryptionKeyIndex + * @property {number|null} [derivationEncryptionKeyIndex] PersonalEncryptedNote derivationEncryptionKeyIndex + * @property {Uint8Array|null} [encryptedData] PersonalEncryptedNote encryptedData + */ + + /** + * Constructs a new PersonalEncryptedNote. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a PersonalEncryptedNote. + * @implements IPersonalEncryptedNote + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set + */ + function PersonalEncryptedNote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonalEncryptedNote rootEncryptionKeyIndex. + * @member {number} rootEncryptionKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.rootEncryptionKeyIndex = 0; + + /** + * PersonalEncryptedNote derivationEncryptionKeyIndex. + * @member {number} derivationEncryptionKeyIndex + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.derivationEncryptionKeyIndex = 0; + + /** + * PersonalEncryptedNote encryptedData. + * @member {Uint8Array} encryptedData + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + */ + PersonalEncryptedNote.prototype.encryptedData = $util.newBuffer([]); + + /** + * Creates a new PersonalEncryptedNote instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote instance + */ + PersonalEncryptedNote.create = function create(properties) { + return new PersonalEncryptedNote(properties); + }; + + /** + * Encodes the specified PersonalEncryptedNote message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalEncryptedNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "rootEncryptionKeyIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rootEncryptionKeyIndex); + if (message.derivationEncryptionKeyIndex != null && Object.hasOwnProperty.call(message, "derivationEncryptionKeyIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.derivationEncryptionKeyIndex); + if (message.encryptedData != null && Object.hasOwnProperty.call(message, "encryptedData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encryptedData); + return writer; + }; + + /** + * Encodes the specified PersonalEncryptedNote message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IPersonalEncryptedNote} message PersonalEncryptedNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalEncryptedNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalEncryptedNote message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalEncryptedNote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootEncryptionKeyIndex = reader.uint32(); + break; + case 2: + message.derivationEncryptionKeyIndex = reader.uint32(); + break; + case 3: + message.encryptedData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalEncryptedNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalEncryptedNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalEncryptedNote message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalEncryptedNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) + if (!$util.isInteger(message.rootEncryptionKeyIndex)) + return "rootEncryptionKeyIndex: integer expected"; + if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) + if (!$util.isInteger(message.derivationEncryptionKeyIndex)) + return "derivationEncryptionKeyIndex: integer expected"; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + if (!(message.encryptedData && typeof message.encryptedData.length === "number" || $util.isString(message.encryptedData))) + return "encryptedData: buffer expected"; + return null; + }; + + /** + * Creates a PersonalEncryptedNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} PersonalEncryptedNote + */ + PersonalEncryptedNote.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote(); + if (object.rootEncryptionKeyIndex != null) + message.rootEncryptionKeyIndex = object.rootEncryptionKeyIndex >>> 0; + if (object.derivationEncryptionKeyIndex != null) + message.derivationEncryptionKeyIndex = object.derivationEncryptionKeyIndex >>> 0; + if (object.encryptedData != null) + if (typeof object.encryptedData === "string") + $util.base64.decode(object.encryptedData, message.encryptedData = $util.newBuffer($util.base64.length(object.encryptedData)), 0); + else if (object.encryptedData.length >= 0) + message.encryptedData = object.encryptedData; + return message; + }; + + /** + * Creates a plain object from a PersonalEncryptedNote message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote} message PersonalEncryptedNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalEncryptedNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rootEncryptionKeyIndex = 0; + object.derivationEncryptionKeyIndex = 0; + if (options.bytes === String) + object.encryptedData = ""; + else { + object.encryptedData = []; + if (options.bytes !== Array) + object.encryptedData = $util.newBuffer(object.encryptedData); + } + } + if (message.rootEncryptionKeyIndex != null && message.hasOwnProperty("rootEncryptionKeyIndex")) + object.rootEncryptionKeyIndex = message.rootEncryptionKeyIndex; + if (message.derivationEncryptionKeyIndex != null && message.hasOwnProperty("derivationEncryptionKeyIndex")) + object.derivationEncryptionKeyIndex = message.derivationEncryptionKeyIndex; + if (message.encryptedData != null && message.hasOwnProperty("encryptedData")) + object.encryptedData = options.bytes === String ? $util.base64.encode(message.encryptedData, 0, message.encryptedData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptedData) : message.encryptedData; + return object; + }; + + /** + * Converts this PersonalEncryptedNote to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.PersonalEncryptedNote + * @instance + * @returns {Object.} JSON object + */ + PersonalEncryptedNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PersonalEncryptedNote; + })(); + + GetGroupActionsResponseV0.EmergencyActionEvent = (function() { + + /** + * Properties of an EmergencyActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IEmergencyActionEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType|null} [actionType] EmergencyActionEvent actionType + * @property {string|null} [publicNote] EmergencyActionEvent publicNote + */ + + /** + * Constructs a new EmergencyActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an EmergencyActionEvent. + * @implements IEmergencyActionEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set + */ + function EmergencyActionEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmergencyActionEvent actionType. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType} actionType + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + */ + EmergencyActionEvent.prototype.actionType = 0; + + /** + * EmergencyActionEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + */ + EmergencyActionEvent.prototype.publicNote = ""; + + /** + * Creates a new EmergencyActionEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent instance + */ + EmergencyActionEvent.create = function create(properties) { + return new EmergencyActionEvent(properties); + }; + + /** + * Encodes the specified EmergencyActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmergencyActionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionType != null && Object.hasOwnProperty.call(message, "actionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionType); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified EmergencyActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent} message EmergencyActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmergencyActionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmergencyActionEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmergencyActionEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.actionType = reader.int32(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmergencyActionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmergencyActionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmergencyActionEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmergencyActionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionType != null && message.hasOwnProperty("actionType")) + switch (message.actionType) { + default: + return "actionType: enum value expected"; + case 0: + case 1: + break; + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an EmergencyActionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} EmergencyActionEvent + */ + EmergencyActionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent(); + switch (object.actionType) { + case "PAUSE": + case 0: + message.actionType = 0; + break; + case "RESUME": + case 1: + message.actionType = 1; + break; + } + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an EmergencyActionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent} message EmergencyActionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmergencyActionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionType = options.enums === String ? "PAUSE" : 0; + object.publicNote = ""; + } + if (message.actionType != null && message.hasOwnProperty("actionType")) + object.actionType = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType[message.actionType] : message.actionType; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this EmergencyActionEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent + * @instance + * @returns {Object.} JSON object + */ + EmergencyActionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionType enum. + * @name org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.ActionType + * @enum {number} + * @property {number} PAUSE=0 PAUSE value + * @property {number} RESUME=1 RESUME value + */ + EmergencyActionEvent.ActionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PAUSE"] = 0; + values[valuesById[1] = "RESUME"] = 1; + return values; + })(); + + return EmergencyActionEvent; + })(); + + GetGroupActionsResponseV0.TokenConfigUpdateEvent = (function() { + + /** + * Properties of a TokenConfigUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ITokenConfigUpdateEvent + * @property {Uint8Array|null} [tokenConfigUpdateItem] TokenConfigUpdateEvent tokenConfigUpdateItem + * @property {string|null} [publicNote] TokenConfigUpdateEvent publicNote + */ + + /** + * Constructs a new TokenConfigUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a TokenConfigUpdateEvent. + * @implements ITokenConfigUpdateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set + */ + function TokenConfigUpdateEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenConfigUpdateEvent tokenConfigUpdateItem. + * @member {Uint8Array} tokenConfigUpdateItem + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + */ + TokenConfigUpdateEvent.prototype.tokenConfigUpdateItem = $util.newBuffer([]); + + /** + * TokenConfigUpdateEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + */ + TokenConfigUpdateEvent.prototype.publicNote = ""; + + /** + * Creates a new TokenConfigUpdateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent instance + */ + TokenConfigUpdateEvent.create = function create(properties) { + return new TokenConfigUpdateEvent(properties); + }; + + /** + * Encodes the specified TokenConfigUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenConfigUpdateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenConfigUpdateItem != null && Object.hasOwnProperty.call(message, "tokenConfigUpdateItem")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tokenConfigUpdateItem); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified TokenConfigUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent} message TokenConfigUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenConfigUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenConfigUpdateEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenConfigUpdateItem = reader.bytes(); + break; + case 2: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenConfigUpdateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenConfigUpdateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenConfigUpdateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenConfigUpdateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) + if (!(message.tokenConfigUpdateItem && typeof message.tokenConfigUpdateItem.length === "number" || $util.isString(message.tokenConfigUpdateItem))) + return "tokenConfigUpdateItem: buffer expected"; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates a TokenConfigUpdateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} TokenConfigUpdateEvent + */ + TokenConfigUpdateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent(); + if (object.tokenConfigUpdateItem != null) + if (typeof object.tokenConfigUpdateItem === "string") + $util.base64.decode(object.tokenConfigUpdateItem, message.tokenConfigUpdateItem = $util.newBuffer($util.base64.length(object.tokenConfigUpdateItem)), 0); + else if (object.tokenConfigUpdateItem.length >= 0) + message.tokenConfigUpdateItem = object.tokenConfigUpdateItem; + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from a TokenConfigUpdateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent} message TokenConfigUpdateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenConfigUpdateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.tokenConfigUpdateItem = ""; + else { + object.tokenConfigUpdateItem = []; + if (options.bytes !== Array) + object.tokenConfigUpdateItem = $util.newBuffer(object.tokenConfigUpdateItem); + } + object.publicNote = ""; + } + if (message.tokenConfigUpdateItem != null && message.hasOwnProperty("tokenConfigUpdateItem")) + object.tokenConfigUpdateItem = options.bytes === String ? $util.base64.encode(message.tokenConfigUpdateItem, 0, message.tokenConfigUpdateItem.length) : options.bytes === Array ? Array.prototype.slice.call(message.tokenConfigUpdateItem) : message.tokenConfigUpdateItem; + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this TokenConfigUpdateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent + * @instance + * @returns {Object.} JSON object + */ + TokenConfigUpdateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenConfigUpdateEvent; + })(); + + GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent = (function() { + + /** + * Properties of an UpdateDirectPurchasePriceEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IUpdateDirectPurchasePriceEvent + * @property {number|Long|null} [fixedPrice] UpdateDirectPurchasePriceEvent fixedPrice + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null} [variablePrice] UpdateDirectPurchasePriceEvent variablePrice + * @property {string|null} [publicNote] UpdateDirectPurchasePriceEvent publicNote + */ + + /** + * Constructs a new UpdateDirectPurchasePriceEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents an UpdateDirectPurchasePriceEvent. + * @implements IUpdateDirectPurchasePriceEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set + */ + function UpdateDirectPurchasePriceEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDirectPurchasePriceEvent fixedPrice. + * @member {number|Long} fixedPrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.fixedPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UpdateDirectPurchasePriceEvent variablePrice. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule|null|undefined} variablePrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.variablePrice = null; + + /** + * UpdateDirectPurchasePriceEvent publicNote. + * @member {string} publicNote + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + UpdateDirectPurchasePriceEvent.prototype.publicNote = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateDirectPurchasePriceEvent price. + * @member {"fixedPrice"|"variablePrice"|undefined} price + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + */ + Object.defineProperty(UpdateDirectPurchasePriceEvent.prototype, "price", { + get: $util.oneOfGetter($oneOfFields = ["fixedPrice", "variablePrice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateDirectPurchasePriceEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent instance + */ + UpdateDirectPurchasePriceEvent.create = function create(properties) { + return new UpdateDirectPurchasePriceEvent(properties); + }; + + /** + * Encodes the specified UpdateDirectPurchasePriceEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDirectPurchasePriceEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixedPrice != null && Object.hasOwnProperty.call(message, "fixedPrice")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.fixedPrice); + if (message.variablePrice != null && Object.hasOwnProperty.call(message, "variablePrice")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.encode(message.variablePrice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.publicNote != null && Object.hasOwnProperty.call(message, "publicNote")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicNote); + return writer; + }; + + /** + * Encodes the specified UpdateDirectPurchasePriceEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDirectPurchasePriceEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDirectPurchasePriceEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fixedPrice = reader.uint64(); + break; + case 2: + message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.decode(reader, reader.uint32()); + break; + case 3: + message.publicNote = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDirectPurchasePriceEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDirectPurchasePriceEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDirectPurchasePriceEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDirectPurchasePriceEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + properties.price = 1; + if (!$util.isInteger(message.fixedPrice) && !(message.fixedPrice && $util.isInteger(message.fixedPrice.low) && $util.isInteger(message.fixedPrice.high))) + return "fixedPrice: integer|Long expected"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + if (properties.price === 1) + return "price: multiple values"; + properties.price = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify(message.variablePrice); + if (error) + return "variablePrice." + error; + } + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + if (!$util.isString(message.publicNote)) + return "publicNote: string expected"; + return null; + }; + + /** + * Creates an UpdateDirectPurchasePriceEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} UpdateDirectPurchasePriceEvent + */ + UpdateDirectPurchasePriceEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent(); + if (object.fixedPrice != null) + if ($util.Long) + (message.fixedPrice = $util.Long.fromValue(object.fixedPrice)).unsigned = true; + else if (typeof object.fixedPrice === "string") + message.fixedPrice = parseInt(object.fixedPrice, 10); + else if (typeof object.fixedPrice === "number") + message.fixedPrice = object.fixedPrice; + else if (typeof object.fixedPrice === "object") + message.fixedPrice = new $util.LongBits(object.fixedPrice.low >>> 0, object.fixedPrice.high >>> 0).toNumber(true); + if (object.variablePrice != null) { + if (typeof object.variablePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.variablePrice: object expected"); + message.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.fromObject(object.variablePrice); + } + if (object.publicNote != null) + message.publicNote = String(object.publicNote); + return message; + }; + + /** + * Creates a plain object from an UpdateDirectPurchasePriceEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent} message UpdateDirectPurchasePriceEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDirectPurchasePriceEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.publicNote = ""; + if (message.fixedPrice != null && message.hasOwnProperty("fixedPrice")) { + if (typeof message.fixedPrice === "number") + object.fixedPrice = options.longs === String ? String(message.fixedPrice) : message.fixedPrice; + else + object.fixedPrice = options.longs === String ? $util.Long.prototype.toString.call(message.fixedPrice) : options.longs === Number ? new $util.LongBits(message.fixedPrice.low >>> 0, message.fixedPrice.high >>> 0).toNumber(true) : message.fixedPrice; + if (options.oneofs) + object.price = "fixedPrice"; + } + if (message.variablePrice != null && message.hasOwnProperty("variablePrice")) { + object.variablePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.toObject(message.variablePrice, options); + if (options.oneofs) + object.price = "variablePrice"; + } + if (message.publicNote != null && message.hasOwnProperty("publicNote")) + object.publicNote = message.publicNote; + return object; + }; + + /** + * Converts this UpdateDirectPurchasePriceEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @instance + * @returns {Object.} JSON object + */ + UpdateDirectPurchasePriceEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UpdateDirectPurchasePriceEvent.PriceForQuantity = (function() { + + /** + * Properties of a PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @interface IPriceForQuantity + * @property {number|Long|null} [quantity] PriceForQuantity quantity + * @property {number|Long|null} [price] PriceForQuantity price + */ + + /** + * Constructs a new PriceForQuantity. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @classdesc Represents a PriceForQuantity. + * @implements IPriceForQuantity + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set + */ + function PriceForQuantity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceForQuantity quantity. + * @member {number|Long} quantity + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.quantity = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PriceForQuantity price. + * @member {number|Long} price + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + */ + PriceForQuantity.prototype.price = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PriceForQuantity instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity instance + */ + PriceForQuantity.create = function create(properties) { + return new PriceForQuantity(properties); + }; + + /** + * Encodes the specified PriceForQuantity message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.quantity); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.price); + return writer; + }; + + /** + * Encodes the specified PriceForQuantity message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPriceForQuantity} message PriceForQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceForQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantity = reader.uint64(); + break; + case 2: + message.price = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceForQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceForQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceForQuantity message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceForQuantity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.price != null && message.hasOwnProperty("price")) + if (!$util.isInteger(message.price) && !(message.price && $util.isInteger(message.price.low) && $util.isInteger(message.price.high))) + return "price: integer|Long expected"; + return null; + }; + + /** + * Creates a PriceForQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} PriceForQuantity + */ + PriceForQuantity.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity(); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + if (object.price != null) + if ($util.Long) + (message.price = $util.Long.fromValue(object.price)).unsigned = true; + else if (typeof object.price === "string") + message.price = parseInt(object.price, 10); + else if (typeof object.price === "number") + message.price = object.price; + else if (typeof object.price === "object") + message.price = new $util.LongBits(object.price.low >>> 0, object.price.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PriceForQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity} message PriceForQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceForQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.quantity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.quantity = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.price = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.price = options.longs === String ? "0" : 0; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (message.price != null && message.hasOwnProperty("price")) + if (typeof message.price === "number") + object.price = options.longs === String ? String(message.price) : message.price; + else + object.price = options.longs === String ? $util.Long.prototype.toString.call(message.price) : options.longs === Number ? new $util.LongBits(message.price.low >>> 0, message.price.high >>> 0).toNumber(true) : message.price; + return object; + }; + + /** + * Converts this PriceForQuantity to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity + * @instance + * @returns {Object.} JSON object + */ + PriceForQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceForQuantity; + })(); + + UpdateDirectPurchasePriceEvent.PricingSchedule = (function() { + + /** + * Properties of a PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @interface IPricingSchedule + * @property {Array.|null} [priceForQuantity] PricingSchedule priceForQuantity + */ + + /** + * Constructs a new PricingSchedule. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent + * @classdesc Represents a PricingSchedule. + * @implements IPricingSchedule + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set + */ + function PricingSchedule(properties) { + this.priceForQuantity = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PricingSchedule priceForQuantity. + * @member {Array.} priceForQuantity + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @instance + */ + PricingSchedule.prototype.priceForQuantity = $util.emptyArray; + + /** + * Creates a new PricingSchedule instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule instance + */ + PricingSchedule.create = function create(properties) { + return new PricingSchedule(properties); + }; + + /** + * Encodes the specified PricingSchedule message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priceForQuantity != null && message.priceForQuantity.length) + for (var i = 0; i < message.priceForQuantity.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.encode(message.priceForQuantity[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PricingSchedule message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.IPricingSchedule} message PricingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricingSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.priceForQuantity && message.priceForQuantity.length)) + message.priceForQuantity = []; + message.priceForQuantity.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PricingSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricingSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PricingSchedule message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PricingSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priceForQuantity != null && message.hasOwnProperty("priceForQuantity")) { + if (!Array.isArray(message.priceForQuantity)) + return "priceForQuantity: array expected"; + for (var i = 0; i < message.priceForQuantity.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.verify(message.priceForQuantity[i]); + if (error) + return "priceForQuantity." + error; + } + } + return null; + }; + + /** + * Creates a PricingSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} PricingSchedule + */ + PricingSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule(); + if (object.priceForQuantity) { + if (!Array.isArray(object.priceForQuantity)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: array expected"); + message.priceForQuantity = []; + for (var i = 0; i < object.priceForQuantity.length; ++i) { + if (typeof object.priceForQuantity[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule.priceForQuantity: object expected"); + message.priceForQuantity[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.fromObject(object.priceForQuantity[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PricingSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule} message PricingSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PricingSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.priceForQuantity = []; + if (message.priceForQuantity && message.priceForQuantity.length) { + object.priceForQuantity = []; + for (var j = 0; j < message.priceForQuantity.length; ++j) + object.priceForQuantity[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PriceForQuantity.toObject(message.priceForQuantity[j], options); + } + return object; + }; + + /** + * Converts this PricingSchedule to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.PricingSchedule + * @instance + * @returns {Object.} JSON object + */ + PricingSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PricingSchedule; + })(); + + return UpdateDirectPurchasePriceEvent; + })(); + + GetGroupActionsResponseV0.GroupActionEvent = (function() { + + /** + * Properties of a GroupActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActionEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null} [tokenEvent] GroupActionEvent tokenEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null} [documentEvent] GroupActionEvent documentEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null} [contractEvent] GroupActionEvent contractEvent + */ + + /** + * Constructs a new GroupActionEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActionEvent. + * @implements IGroupActionEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set + */ + function GroupActionEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActionEvent tokenEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent|null|undefined} tokenEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.tokenEvent = null; + + /** + * GroupActionEvent documentEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent|null|undefined} documentEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.documentEvent = null; + + /** + * GroupActionEvent contractEvent. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent|null|undefined} contractEvent + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + GroupActionEvent.prototype.contractEvent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GroupActionEvent eventType. + * @member {"tokenEvent"|"documentEvent"|"contractEvent"|undefined} eventType + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + */ + Object.defineProperty(GroupActionEvent.prototype, "eventType", { + get: $util.oneOfGetter($oneOfFields = ["tokenEvent", "documentEvent", "contractEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroupActionEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent instance + */ + GroupActionEvent.create = function create(properties) { + return new GroupActionEvent(properties); + }; + + /** + * Encodes the specified GroupActionEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenEvent != null && Object.hasOwnProperty.call(message, "tokenEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.encode(message.tokenEvent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentEvent != null && Object.hasOwnProperty.call(message, "documentEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.encode(message.documentEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contractEvent != null && Object.hasOwnProperty.call(message, "contractEvent")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.encode(message.contractEvent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent} message GroupActionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.decode(reader, reader.uint32()); + break; + case 2: + message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.decode(reader, reader.uint32()); + break; + case 3: + message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify(message.tokenEvent); + if (error) + return "tokenEvent." + error; + } + } + if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { + if (properties.eventType === 1) + return "eventType: multiple values"; + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify(message.documentEvent); + if (error) + return "documentEvent." + error; + } + } + if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { + if (properties.eventType === 1) + return "eventType: multiple values"; + properties.eventType = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify(message.contractEvent); + if (error) + return "contractEvent." + error; + } + } + return null; + }; + + /** + * Creates a GroupActionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} GroupActionEvent + */ + GroupActionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent(); + if (object.tokenEvent != null) { + if (typeof object.tokenEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.tokenEvent: object expected"); + message.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.fromObject(object.tokenEvent); + } + if (object.documentEvent != null) { + if (typeof object.documentEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.documentEvent: object expected"); + message.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.fromObject(object.documentEvent); + } + if (object.contractEvent != null) { + if (typeof object.contractEvent !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.contractEvent: object expected"); + message.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.fromObject(object.contractEvent); + } + return message; + }; + + /** + * Creates a plain object from a GroupActionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent} message GroupActionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tokenEvent != null && message.hasOwnProperty("tokenEvent")) { + object.tokenEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.toObject(message.tokenEvent, options); + if (options.oneofs) + object.eventType = "tokenEvent"; + } + if (message.documentEvent != null && message.hasOwnProperty("documentEvent")) { + object.documentEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.toObject(message.documentEvent, options); + if (options.oneofs) + object.eventType = "documentEvent"; + } + if (message.contractEvent != null && message.hasOwnProperty("contractEvent")) { + object.contractEvent = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.toObject(message.contractEvent, options); + if (options.oneofs) + object.eventType = "contractEvent"; + } + return object; + }; + + /** + * Converts this GroupActionEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent + * @instance + * @returns {Object.} JSON object + */ + GroupActionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionEvent; + })(); + + GetGroupActionsResponseV0.DocumentEvent = (function() { + + /** + * Properties of a DocumentEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDocumentEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null} [create] DocumentEvent create + */ + + /** + * Constructs a new DocumentEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DocumentEvent. + * @implements IDocumentEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set + */ + function DocumentEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentEvent create. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent|null|undefined} create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + */ + DocumentEvent.prototype.create = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DocumentEvent type. + * @member {"create"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + */ + Object.defineProperty(DocumentEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["create"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent instance + */ + DocumentEvent.create = function create(properties) { + return new DocumentEvent(properties); + }; + + /** + * Encodes the specified DocumentEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.create != null && Object.hasOwnProperty.call(message, "create")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.encode(message.create, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentEvent} message DocumentEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.create != null && message.hasOwnProperty("create")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify(message.create); + if (error) + return "create." + error; + } + } + return null; + }; + + /** + * Creates a DocumentEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} DocumentEvent + */ + DocumentEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent(); + if (object.create != null) { + if (typeof object.create !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent.create: object expected"); + message.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.fromObject(object.create); + } + return message; + }; + + /** + * Creates a plain object from a DocumentEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent} message DocumentEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.create != null && message.hasOwnProperty("create")) { + object.create = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.toObject(message.create, options); + if (options.oneofs) + object.type = "create"; + } + return object; + }; + + /** + * Converts this DocumentEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentEvent + * @instance + * @returns {Object.} JSON object + */ + DocumentEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentEvent; + })(); + + GetGroupActionsResponseV0.DocumentCreateEvent = (function() { + + /** + * Properties of a DocumentCreateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IDocumentCreateEvent + * @property {Uint8Array|null} [createdDocument] DocumentCreateEvent createdDocument + */ + + /** + * Constructs a new DocumentCreateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a DocumentCreateEvent. + * @implements IDocumentCreateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set + */ + function DocumentCreateEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentCreateEvent createdDocument. + * @member {Uint8Array} createdDocument + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @instance + */ + DocumentCreateEvent.prototype.createdDocument = $util.newBuffer([]); + + /** + * Creates a new DocumentCreateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent instance + */ + DocumentCreateEvent.create = function create(properties) { + return new DocumentCreateEvent(properties); + }; + + /** + * Encodes the specified DocumentCreateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentCreateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createdDocument != null && Object.hasOwnProperty.call(message, "createdDocument")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.createdDocument); + return writer; + }; + + /** + * Encodes the specified DocumentCreateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDocumentCreateEvent} message DocumentCreateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentCreateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentCreateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentCreateEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createdDocument = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentCreateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentCreateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentCreateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentCreateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) + if (!(message.createdDocument && typeof message.createdDocument.length === "number" || $util.isString(message.createdDocument))) + return "createdDocument: buffer expected"; + return null; + }; + + /** + * Creates a DocumentCreateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} DocumentCreateEvent + */ + DocumentCreateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent(); + if (object.createdDocument != null) + if (typeof object.createdDocument === "string") + $util.base64.decode(object.createdDocument, message.createdDocument = $util.newBuffer($util.base64.length(object.createdDocument)), 0); + else if (object.createdDocument.length >= 0) + message.createdDocument = object.createdDocument; + return message; + }; + + /** + * Creates a plain object from a DocumentCreateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent} message DocumentCreateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentCreateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.createdDocument = ""; + else { + object.createdDocument = []; + if (options.bytes !== Array) + object.createdDocument = $util.newBuffer(object.createdDocument); + } + if (message.createdDocument != null && message.hasOwnProperty("createdDocument")) + object.createdDocument = options.bytes === String ? $util.base64.encode(message.createdDocument, 0, message.createdDocument.length) : options.bytes === Array ? Array.prototype.slice.call(message.createdDocument) : message.createdDocument; + return object; + }; + + /** + * Converts this DocumentCreateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DocumentCreateEvent + * @instance + * @returns {Object.} JSON object + */ + DocumentCreateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentCreateEvent; + })(); + + GetGroupActionsResponseV0.ContractUpdateEvent = (function() { + + /** + * Properties of a ContractUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IContractUpdateEvent + * @property {Uint8Array|null} [updatedContract] ContractUpdateEvent updatedContract + */ + + /** + * Constructs a new ContractUpdateEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a ContractUpdateEvent. + * @implements IContractUpdateEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set + */ + function ContractUpdateEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContractUpdateEvent updatedContract. + * @member {Uint8Array} updatedContract + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @instance + */ + ContractUpdateEvent.prototype.updatedContract = $util.newBuffer([]); + + /** + * Creates a new ContractUpdateEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent instance + */ + ContractUpdateEvent.create = function create(properties) { + return new ContractUpdateEvent(properties); + }; + + /** + * Encodes the specified ContractUpdateEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractUpdateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updatedContract != null && Object.hasOwnProperty.call(message, "updatedContract")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.updatedContract); + return writer; + }; + + /** + * Encodes the specified ContractUpdateEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent} message ContractUpdateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractUpdateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractUpdateEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractUpdateEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updatedContract = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractUpdateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractUpdateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractUpdateEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractUpdateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) + if (!(message.updatedContract && typeof message.updatedContract.length === "number" || $util.isString(message.updatedContract))) + return "updatedContract: buffer expected"; + return null; + }; + + /** + * Creates a ContractUpdateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} ContractUpdateEvent + */ + ContractUpdateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent(); + if (object.updatedContract != null) + if (typeof object.updatedContract === "string") + $util.base64.decode(object.updatedContract, message.updatedContract = $util.newBuffer($util.base64.length(object.updatedContract)), 0); + else if (object.updatedContract.length >= 0) + message.updatedContract = object.updatedContract; + return message; + }; + + /** + * Creates a plain object from a ContractUpdateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent} message ContractUpdateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractUpdateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.updatedContract = ""; + else { + object.updatedContract = []; + if (options.bytes !== Array) + object.updatedContract = $util.newBuffer(object.updatedContract); + } + if (message.updatedContract != null && message.hasOwnProperty("updatedContract")) + object.updatedContract = options.bytes === String ? $util.base64.encode(message.updatedContract, 0, message.updatedContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.updatedContract) : message.updatedContract; + return object; + }; + + /** + * Converts this ContractUpdateEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent + * @instance + * @returns {Object.} JSON object + */ + ContractUpdateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractUpdateEvent; + })(); + + GetGroupActionsResponseV0.ContractEvent = (function() { + + /** + * Properties of a ContractEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IContractEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null} [update] ContractEvent update + */ + + /** + * Constructs a new ContractEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a ContractEvent. + * @implements IContractEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set + */ + function ContractEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContractEvent update. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractUpdateEvent|null|undefined} update + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + */ + ContractEvent.prototype.update = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContractEvent type. + * @member {"update"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + */ + Object.defineProperty(ContractEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["update"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent instance + */ + ContractEvent.create = function create(properties) { + return new ContractEvent(properties); + }; + + /** + * Encodes the specified ContractEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContractEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IContractEvent} message ContractEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContractEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContractEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContractEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContractEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.update != null && message.hasOwnProperty("update")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.verify(message.update); + if (error) + return "update." + error; + } + } + return null; + }; + + /** + * Creates a ContractEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} ContractEvent + */ + ContractEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent(); + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent.update: object expected"); + message.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.fromObject(object.update); + } + return message; + }; + + /** + * Creates a plain object from a ContractEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent} message ContractEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContractEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractUpdateEvent.toObject(message.update, options); + if (options.oneofs) + object.type = "update"; + } + return object; + }; + + /** + * Converts this ContractEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ContractEvent + * @instance + * @returns {Object.} JSON object + */ + ContractEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ContractEvent; + })(); + + GetGroupActionsResponseV0.TokenEvent = (function() { + + /** + * Properties of a TokenEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface ITokenEvent + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null} [mint] TokenEvent mint + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null} [burn] TokenEvent burn + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null} [freeze] TokenEvent freeze + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null} [unfreeze] TokenEvent unfreeze + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null} [destroyFrozenFunds] TokenEvent destroyFrozenFunds + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null} [emergencyAction] TokenEvent emergencyAction + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null} [tokenConfigUpdate] TokenEvent tokenConfigUpdate + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null} [updatePrice] TokenEvent updatePrice + */ + + /** + * Constructs a new TokenEvent. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a TokenEvent. + * @implements ITokenEvent + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set + */ + function TokenEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TokenEvent mint. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IMintEvent|null|undefined} mint + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.mint = null; + + /** + * TokenEvent burn. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IBurnEvent|null|undefined} burn + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.burn = null; + + /** + * TokenEvent freeze. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IFreezeEvent|null|undefined} freeze + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.freeze = null; + + /** + * TokenEvent unfreeze. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUnfreezeEvent|null|undefined} unfreeze + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.unfreeze = null; + + /** + * TokenEvent destroyFrozenFunds. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IDestroyFrozenFundsEvent|null|undefined} destroyFrozenFunds + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.destroyFrozenFunds = null; + + /** + * TokenEvent emergencyAction. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IEmergencyActionEvent|null|undefined} emergencyAction + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.emergencyAction = null; + + /** + * TokenEvent tokenConfigUpdate. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenConfigUpdateEvent|null|undefined} tokenConfigUpdate + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.tokenConfigUpdate = null; + + /** + * TokenEvent updatePrice. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IUpdateDirectPurchasePriceEvent|null|undefined} updatePrice + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + TokenEvent.prototype.updatePrice = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TokenEvent type. + * @member {"mint"|"burn"|"freeze"|"unfreeze"|"destroyFrozenFunds"|"emergencyAction"|"tokenConfigUpdate"|"updatePrice"|undefined} type + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + */ + Object.defineProperty(TokenEvent.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["mint", "burn", "freeze", "unfreeze", "destroyFrozenFunds", "emergencyAction", "tokenConfigUpdate", "updatePrice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TokenEvent instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent instance + */ + TokenEvent.create = function create(properties) { + return new TokenEvent(properties); + }; + + /** + * Encodes the specified TokenEvent message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mint != null && Object.hasOwnProperty.call(message, "mint")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.encode(message.mint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.burn != null && Object.hasOwnProperty.call(message, "burn")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.encode(message.burn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.freeze != null && Object.hasOwnProperty.call(message, "freeze")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.encode(message.freeze, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.unfreeze != null && Object.hasOwnProperty.call(message, "unfreeze")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.encode(message.unfreeze, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.destroyFrozenFunds != null && Object.hasOwnProperty.call(message, "destroyFrozenFunds")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.encode(message.destroyFrozenFunds, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.emergencyAction != null && Object.hasOwnProperty.call(message, "emergencyAction")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.encode(message.emergencyAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tokenConfigUpdate != null && Object.hasOwnProperty.call(message, "tokenConfigUpdate")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.encode(message.tokenConfigUpdate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updatePrice != null && Object.hasOwnProperty.call(message, "updatePrice")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.encode(message.updatePrice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TokenEvent message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.ITokenEvent} message TokenEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TokenEvent message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.decode(reader, reader.uint32()); + break; + case 2: + message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.decode(reader, reader.uint32()); + break; + case 3: + message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.decode(reader, reader.uint32()); + break; + case 4: + message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.decode(reader, reader.uint32()); + break; + case 5: + message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.decode(reader, reader.uint32()); + break; + case 6: + message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.decode(reader, reader.uint32()); + break; + case 7: + message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.decode(reader, reader.uint32()); + break; + case 8: + message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TokenEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TokenEvent message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TokenEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mint != null && message.hasOwnProperty("mint")) { + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.verify(message.mint); + if (error) + return "mint." + error; + } + } + if (message.burn != null && message.hasOwnProperty("burn")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.verify(message.burn); + if (error) + return "burn." + error; + } + } + if (message.freeze != null && message.hasOwnProperty("freeze")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.verify(message.freeze); + if (error) + return "freeze." + error; + } + } + if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.verify(message.unfreeze); + if (error) + return "unfreeze." + error; + } + } + if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.verify(message.destroyFrozenFunds); + if (error) + return "destroyFrozenFunds." + error; + } + } + if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.verify(message.emergencyAction); + if (error) + return "emergencyAction." + error; + } + } + if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.verify(message.tokenConfigUpdate); + if (error) + return "tokenConfigUpdate." + error; + } + } + if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.verify(message.updatePrice); + if (error) + return "updatePrice." + error; + } + } + return null; + }; + + /** + * Creates a TokenEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} TokenEvent + */ + TokenEvent.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent(); + if (object.mint != null) { + if (typeof object.mint !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.mint: object expected"); + message.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.fromObject(object.mint); + } + if (object.burn != null) { + if (typeof object.burn !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.burn: object expected"); + message.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.fromObject(object.burn); + } + if (object.freeze != null) { + if (typeof object.freeze !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.freeze: object expected"); + message.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.fromObject(object.freeze); + } + if (object.unfreeze != null) { + if (typeof object.unfreeze !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.unfreeze: object expected"); + message.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.fromObject(object.unfreeze); + } + if (object.destroyFrozenFunds != null) { + if (typeof object.destroyFrozenFunds !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.destroyFrozenFunds: object expected"); + message.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.fromObject(object.destroyFrozenFunds); + } + if (object.emergencyAction != null) { + if (typeof object.emergencyAction !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.emergencyAction: object expected"); + message.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.fromObject(object.emergencyAction); + } + if (object.tokenConfigUpdate != null) { + if (typeof object.tokenConfigUpdate !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.tokenConfigUpdate: object expected"); + message.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.fromObject(object.tokenConfigUpdate); + } + if (object.updatePrice != null) { + if (typeof object.updatePrice !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent.updatePrice: object expected"); + message.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.fromObject(object.updatePrice); + } + return message; + }; + + /** + * Creates a plain object from a TokenEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent} message TokenEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TokenEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.mint != null && message.hasOwnProperty("mint")) { + object.mint = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.MintEvent.toObject(message.mint, options); + if (options.oneofs) + object.type = "mint"; + } + if (message.burn != null && message.hasOwnProperty("burn")) { + object.burn = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.BurnEvent.toObject(message.burn, options); + if (options.oneofs) + object.type = "burn"; + } + if (message.freeze != null && message.hasOwnProperty("freeze")) { + object.freeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.FreezeEvent.toObject(message.freeze, options); + if (options.oneofs) + object.type = "freeze"; + } + if (message.unfreeze != null && message.hasOwnProperty("unfreeze")) { + object.unfreeze = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UnfreezeEvent.toObject(message.unfreeze, options); + if (options.oneofs) + object.type = "unfreeze"; + } + if (message.destroyFrozenFunds != null && message.hasOwnProperty("destroyFrozenFunds")) { + object.destroyFrozenFunds = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.DestroyFrozenFundsEvent.toObject(message.destroyFrozenFunds, options); + if (options.oneofs) + object.type = "destroyFrozenFunds"; + } + if (message.emergencyAction != null && message.hasOwnProperty("emergencyAction")) { + object.emergencyAction = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.EmergencyActionEvent.toObject(message.emergencyAction, options); + if (options.oneofs) + object.type = "emergencyAction"; + } + if (message.tokenConfigUpdate != null && message.hasOwnProperty("tokenConfigUpdate")) { + object.tokenConfigUpdate = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenConfigUpdateEvent.toObject(message.tokenConfigUpdate, options); + if (options.oneofs) + object.type = "tokenConfigUpdate"; + } + if (message.updatePrice != null && message.hasOwnProperty("updatePrice")) { + object.updatePrice = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.UpdateDirectPurchasePriceEvent.toObject(message.updatePrice, options); + if (options.oneofs) + object.type = "updatePrice"; + } + return object; + }; + + /** + * Converts this TokenEvent to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.TokenEvent + * @instance + * @returns {Object.} JSON object + */ + TokenEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TokenEvent; + })(); + + GetGroupActionsResponseV0.GroupActionEntry = (function() { + + /** + * Properties of a GroupActionEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActionEntry + * @property {Uint8Array|null} [actionId] GroupActionEntry actionId + * @property {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null} [event] GroupActionEntry event + */ + + /** + * Constructs a new GroupActionEntry. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActionEntry. + * @implements IGroupActionEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set + */ + function GroupActionEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActionEntry actionId. + * @member {Uint8Array} actionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + */ + GroupActionEntry.prototype.actionId = $util.newBuffer([]); + + /** + * GroupActionEntry event. + * @member {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEvent|null|undefined} event + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + */ + GroupActionEntry.prototype.event = null; + + /** + * Creates a new GroupActionEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry instance + */ + GroupActionEntry.create = function create(properties) { + return new GroupActionEntry(properties); + }; + + /** + * Encodes the specified GroupActionEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.actionId); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActionEntry} message GroupActionEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.actionId = reader.bytes(); + break; + case 2: + message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) + return "actionId: buffer expected"; + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.verify(message.event); + if (error) + return "event." + error; + } + return null; + }; + + /** + * Creates a GroupActionEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} GroupActionEntry + */ + GroupActionEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry(); + if (object.actionId != null) + if (typeof object.actionId === "string") + $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); + else if (object.actionId.length >= 0) + message.actionId = object.actionId; + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.event: object expected"); + message.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.fromObject(object.event); + } + return message; + }; + + /** + * Creates a plain object from a GroupActionEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry} message GroupActionEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.actionId = ""; + else { + object.actionId = []; + if (options.bytes !== Array) + object.actionId = $util.newBuffer(object.actionId); + } + object.event = null; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEvent.toObject(message.event, options); + return object; + }; + + /** + * Converts this GroupActionEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry + * @instance + * @returns {Object.} JSON object + */ + GroupActionEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionEntry; + })(); + + GetGroupActionsResponseV0.GroupActions = (function() { + + /** + * Properties of a GroupActions. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @interface IGroupActions + * @property {Array.|null} [groupActions] GroupActions groupActions + */ + + /** + * Constructs a new GroupActions. + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0 + * @classdesc Represents a GroupActions. + * @implements IGroupActions + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set + */ + function GroupActions(properties) { + this.groupActions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActions groupActions. + * @member {Array.} groupActions + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @instance + */ + GroupActions.prototype.groupActions = $util.emptyArray; + + /** + * Creates a new GroupActions instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions instance + */ + GroupActions.create = function create(properties) { + return new GroupActions(properties); + }; + + /** + * Encodes the specified GroupActions message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActions != null && message.groupActions.length) + for (var i = 0; i < message.groupActions.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.encode(message.groupActions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActions message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.IGroupActions} message GroupActions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActions message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.groupActions && message.groupActions.length)) + message.groupActions = []; + message.groupActions.push($root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActions message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupActions != null && message.hasOwnProperty("groupActions")) { + if (!Array.isArray(message.groupActions)) + return "groupActions: array expected"; + for (var i = 0; i < message.groupActions.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.verify(message.groupActions[i]); + if (error) + return "groupActions." + error; + } + } + return null; + }; + + /** + * Creates a GroupActions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} GroupActions + */ + GroupActions.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions(); + if (object.groupActions) { + if (!Array.isArray(object.groupActions)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: array expected"); + message.groupActions = []; + for (var i = 0; i < object.groupActions.length; ++i) { + if (typeof object.groupActions[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions.groupActions: object expected"); + message.groupActions[i] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.fromObject(object.groupActions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupActions message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions} message GroupActions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupActions = []; + if (message.groupActions && message.groupActions.length) { + object.groupActions = []; + for (var j = 0; j < message.groupActions.length; ++j) + object.groupActions[j] = $root.org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActionEntry.toObject(message.groupActions[j], options); + } + return object; + }; + + /** + * Converts this GroupActions to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionsResponse.GetGroupActionsResponseV0.GroupActions + * @instance + * @returns {Object.} JSON object + */ + GroupActions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActions; + })(); + + return GetGroupActionsResponseV0; + })(); + + return GetGroupActionsResponse; + })(); + + v0.GetGroupActionSignersRequest = (function() { + + /** + * Properties of a GetGroupActionSignersRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionSignersRequest + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null} [v0] GetGroupActionSignersRequest v0 + */ + + /** + * Constructs a new GetGroupActionSignersRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionSignersRequest. + * @implements IGetGroupActionSignersRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set + */ + function GetGroupActionSignersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionSignersRequest v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + */ + GetGroupActionSignersRequest.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersRequest version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + */ + Object.defineProperty(GetGroupActionSignersRequest.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest instance + */ + GetGroupActionSignersRequest.create = function create(properties) { + return new GetGroupActionSignersRequest(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersRequest} message GetGroupActionSignersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionSignersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} GetGroupActionSignersRequest + */ + GetGroupActionSignersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersRequest.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest} message GetGroupActionSignersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionSignersRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ActionStatus enum. + * @name org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus + * @enum {number} + * @property {number} ACTIVE=0 ACTIVE value + * @property {number} CLOSED=1 CLOSED value + */ + GetGroupActionSignersRequest.ActionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVE"] = 0; + values[valuesById[1] = "CLOSED"] = 1; + return values; + })(); + + GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 = (function() { + + /** + * Properties of a GetGroupActionSignersRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @interface IGetGroupActionSignersRequestV0 + * @property {Uint8Array|null} [contractId] GetGroupActionSignersRequestV0 contractId + * @property {number|null} [groupContractPosition] GetGroupActionSignersRequestV0 groupContractPosition + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus|null} [status] GetGroupActionSignersRequestV0 status + * @property {Uint8Array|null} [actionId] GetGroupActionSignersRequestV0 actionId + * @property {boolean|null} [prove] GetGroupActionSignersRequestV0 prove + */ + + /** + * Constructs a new GetGroupActionSignersRequestV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest + * @classdesc Represents a GetGroupActionSignersRequestV0. + * @implements IGetGroupActionSignersRequestV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set + */ + function GetGroupActionSignersRequestV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionSignersRequestV0 contractId. + * @member {Uint8Array} contractId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.contractId = $util.newBuffer([]); + + /** + * GetGroupActionSignersRequestV0 groupContractPosition. + * @member {number} groupContractPosition + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.groupContractPosition = 0; + + /** + * GetGroupActionSignersRequestV0 status. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus} status + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.status = 0; + + /** + * GetGroupActionSignersRequestV0 actionId. + * @member {Uint8Array} actionId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.actionId = $util.newBuffer([]); + + /** + * GetGroupActionSignersRequestV0 prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + */ + GetGroupActionSignersRequestV0.prototype.prove = false; + + /** + * Creates a new GetGroupActionSignersRequestV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 instance + */ + GetGroupActionSignersRequestV0.create = function create(properties) { + return new GetGroupActionSignersRequestV0(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersRequestV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequestV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contractId != null && Object.hasOwnProperty.call(message, "contractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contractId); + if (message.groupContractPosition != null && Object.hasOwnProperty.call(message, "groupContractPosition")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.groupContractPosition); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.actionId); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersRequestV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.IGetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersRequestV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequestV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractId = reader.bytes(); + break; + case 2: + message.groupContractPosition = reader.uint32(); + break; + case 3: + message.status = reader.int32(); + break; + case 4: + message.actionId = reader.bytes(); + break; + case 5: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersRequestV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersRequestV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersRequestV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersRequestV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contractId != null && message.hasOwnProperty("contractId")) + if (!(message.contractId && typeof message.contractId.length === "number" || $util.isString(message.contractId))) + return "contractId: buffer expected"; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + if (!$util.isInteger(message.groupContractPosition)) + return "groupContractPosition: integer expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + break; + } + if (message.actionId != null && message.hasOwnProperty("actionId")) + if (!(message.actionId && typeof message.actionId.length === "number" || $util.isString(message.actionId))) + return "actionId: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetGroupActionSignersRequestV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} GetGroupActionSignersRequestV0 + */ + GetGroupActionSignersRequestV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0(); + if (object.contractId != null) + if (typeof object.contractId === "string") + $util.base64.decode(object.contractId, message.contractId = $util.newBuffer($util.base64.length(object.contractId)), 0); + else if (object.contractId.length >= 0) + message.contractId = object.contractId; + if (object.groupContractPosition != null) + message.groupContractPosition = object.groupContractPosition >>> 0; + switch (object.status) { + case "ACTIVE": + case 0: + message.status = 0; + break; + case "CLOSED": + case 1: + message.status = 1; + break; + } + if (object.actionId != null) + if (typeof object.actionId === "string") + $util.base64.decode(object.actionId, message.actionId = $util.newBuffer($util.base64.length(object.actionId)), 0); + else if (object.actionId.length >= 0) + message.actionId = object.actionId; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersRequestV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0} message GetGroupActionSignersRequestV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersRequestV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contractId = ""; + else { + object.contractId = []; + if (options.bytes !== Array) + object.contractId = $util.newBuffer(object.contractId); + } + object.groupContractPosition = 0; + object.status = options.enums === String ? "ACTIVE" : 0; + if (options.bytes === String) + object.actionId = ""; + else { + object.actionId = []; + if (options.bytes !== Array) + object.actionId = $util.newBuffer(object.actionId); + } + object.prove = false; + } + if (message.contractId != null && message.hasOwnProperty("contractId")) + object.contractId = options.bytes === String ? $util.base64.encode(message.contractId, 0, message.contractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.contractId) : message.contractId; + if (message.groupContractPosition != null && message.hasOwnProperty("groupContractPosition")) + object.groupContractPosition = message.groupContractPosition; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.org.dash.platform.dapi.v0.GetGroupActionSignersRequest.ActionStatus[message.status] : message.status; + if (message.actionId != null && message.hasOwnProperty("actionId")) + object.actionId = options.bytes === String ? $util.base64.encode(message.actionId, 0, message.actionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.actionId) : message.actionId; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetGroupActionSignersRequestV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersRequest.GetGroupActionSignersRequestV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersRequestV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGroupActionSignersRequestV0; + })(); + + return GetGroupActionSignersRequest; + })(); + + v0.GetGroupActionSignersResponse = (function() { + + /** + * Properties of a GetGroupActionSignersResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetGroupActionSignersResponse + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null} [v0] GetGroupActionSignersResponse v0 + */ + + /** + * Constructs a new GetGroupActionSignersResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetGroupActionSignersResponse. + * @implements IGetGroupActionSignersResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set + */ + function GetGroupActionSignersResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionSignersResponse v0. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0|null|undefined} v0 + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + */ + GetGroupActionSignersResponse.prototype.v0 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersResponse version. + * @member {"v0"|undefined} version + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + */ + Object.defineProperty(GetGroupActionSignersResponse.prototype, "version", { + get: $util.oneOfGetter($oneOfFields = ["v0"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse instance + */ + GetGroupActionSignersResponse.create = function create(properties) { + return new GetGroupActionSignersResponse(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v0 != null && Object.hasOwnProperty.call(message, "v0")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetGroupActionSignersResponse} message GetGroupActionSignersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + properties.version = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify(message.v0); + if (error) + return "v0." + error; + } + } + return null; + }; + + /** + * Creates a GetGroupActionSignersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} GetGroupActionSignersResponse + */ + GetGroupActionSignersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse(); + if (object.v0 != null) { + if (typeof object.v0 !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.v0: object expected"); + message.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.fromObject(object.v0); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse} message GetGroupActionSignersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v0 != null && message.hasOwnProperty("v0")) { + object.v0 = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.toObject(message.v0, options); + if (options.oneofs) + object.version = "v0"; + } + return object; + }; + + /** + * Converts this GetGroupActionSignersResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 = (function() { + + /** + * Properties of a GetGroupActionSignersResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @interface IGetGroupActionSignersResponseV0 + * @property {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null} [groupActionSigners] GetGroupActionSignersResponseV0 groupActionSigners + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetGroupActionSignersResponseV0 proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetGroupActionSignersResponseV0 metadata + */ + + /** + * Constructs a new GetGroupActionSignersResponseV0. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse + * @classdesc Represents a GetGroupActionSignersResponseV0. + * @implements IGetGroupActionSignersResponseV0 + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set + */ + function GetGroupActionSignersResponseV0(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupActionSignersResponseV0 groupActionSigners. + * @member {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners|null|undefined} groupActionSigners + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.groupActionSigners = null; + + /** + * GetGroupActionSignersResponseV0 proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.proof = null; + + /** + * GetGroupActionSignersResponseV0 metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + GetGroupActionSignersResponseV0.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGroupActionSignersResponseV0 result. + * @member {"groupActionSigners"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + */ + Object.defineProperty(GetGroupActionSignersResponseV0.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["groupActionSigners", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGroupActionSignersResponseV0 instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 instance + */ + GetGroupActionSignersResponseV0.create = function create(properties) { + return new GetGroupActionSignersResponseV0(properties); + }; + + /** + * Encodes the specified GetGroupActionSignersResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponseV0.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupActionSigners != null && Object.hasOwnProperty.call(message, "groupActionSigners")) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.encode(message.groupActionSigners, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetGroupActionSignersResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.IGetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupActionSignersResponseV0.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponseV0.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGroupActionSignersResponseV0 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupActionSignersResponseV0.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupActionSignersResponseV0 message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupActionSignersResponseV0.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify(message.groupActionSigners); + if (error) + return "groupActionSigners." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetGroupActionSignersResponseV0 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} GetGroupActionSignersResponseV0 + */ + GetGroupActionSignersResponseV0.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0(); + if (object.groupActionSigners != null) { + if (typeof object.groupActionSigners !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.groupActionSigners: object expected"); + message.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.fromObject(object.groupActionSigners); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetGroupActionSignersResponseV0 message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0} message GetGroupActionSignersResponseV0 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupActionSignersResponseV0.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.groupActionSigners != null && message.hasOwnProperty("groupActionSigners")) { + object.groupActionSigners = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.toObject(message.groupActionSigners, options); + if (options.oneofs) + object.result = "groupActionSigners"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetGroupActionSignersResponseV0 to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @instance + * @returns {Object.} JSON object + */ + GetGroupActionSignersResponseV0.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetGroupActionSignersResponseV0.GroupActionSigner = (function() { + + /** + * Properties of a GroupActionSigner. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @interface IGroupActionSigner + * @property {Uint8Array|null} [signerId] GroupActionSigner signerId + * @property {number|null} [power] GroupActionSigner power + */ + + /** + * Constructs a new GroupActionSigner. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @classdesc Represents a GroupActionSigner. + * @implements IGroupActionSigner + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set + */ + function GroupActionSigner(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActionSigner signerId. + * @member {Uint8Array} signerId + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + */ + GroupActionSigner.prototype.signerId = $util.newBuffer([]); + + /** + * GroupActionSigner power. + * @member {number} power + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + */ + GroupActionSigner.prototype.power = 0; + + /** + * Creates a new GroupActionSigner instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner instance + */ + GroupActionSigner.create = function create(properties) { + return new GroupActionSigner(properties); + }; + + /** + * Encodes the specified GroupActionSigner message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigner.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signerId != null && Object.hasOwnProperty.call(message, "signerId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signerId); + if (message.power != null && Object.hasOwnProperty.call(message, "power")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.power); + return writer; + }; + + /** + * Encodes the specified GroupActionSigner message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigner} message GroupActionSigner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigner.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionSigner message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigner.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerId = reader.bytes(); + break; + case 2: + message.power = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionSigner message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigner.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionSigner message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionSigner.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signerId != null && message.hasOwnProperty("signerId")) + if (!(message.signerId && typeof message.signerId.length === "number" || $util.isString(message.signerId))) + return "signerId: buffer expected"; + if (message.power != null && message.hasOwnProperty("power")) + if (!$util.isInteger(message.power)) + return "power: integer expected"; + return null; + }; + + /** + * Creates a GroupActionSigner message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} GroupActionSigner + */ + GroupActionSigner.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner(); + if (object.signerId != null) + if (typeof object.signerId === "string") + $util.base64.decode(object.signerId, message.signerId = $util.newBuffer($util.base64.length(object.signerId)), 0); + else if (object.signerId.length >= 0) + message.signerId = object.signerId; + if (object.power != null) + message.power = object.power >>> 0; + return message; + }; + + /** + * Creates a plain object from a GroupActionSigner message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner} message GroupActionSigner + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionSigner.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.signerId = ""; + else { + object.signerId = []; + if (options.bytes !== Array) + object.signerId = $util.newBuffer(object.signerId); + } + object.power = 0; + } + if (message.signerId != null && message.hasOwnProperty("signerId")) + object.signerId = options.bytes === String ? $util.base64.encode(message.signerId, 0, message.signerId.length) : options.bytes === Array ? Array.prototype.slice.call(message.signerId) : message.signerId; + if (message.power != null && message.hasOwnProperty("power")) + object.power = message.power; + return object; + }; + + /** + * Converts this GroupActionSigner to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner + * @instance + * @returns {Object.} JSON object + */ + GroupActionSigner.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionSigner; + })(); + + GetGroupActionSignersResponseV0.GroupActionSigners = (function() { + + /** + * Properties of a GroupActionSigners. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @interface IGroupActionSigners + * @property {Array.|null} [signers] GroupActionSigners signers + */ + + /** + * Constructs a new GroupActionSigners. + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0 + * @classdesc Represents a GroupActionSigners. + * @implements IGroupActionSigners + * @constructor + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set + */ + function GroupActionSigners(properties) { + this.signers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupActionSigners signers. + * @member {Array.} signers + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @instance + */ + GroupActionSigners.prototype.signers = $util.emptyArray; + + /** + * Creates a new GroupActionSigners instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners instance + */ + GroupActionSigners.create = function create(properties) { + return new GroupActionSigners(properties); + }; + + /** + * Encodes the specified GroupActionSigners message. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigners.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signers != null && message.signers.length) + for (var i = 0; i < message.signers.length; ++i) + $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.encode(message.signers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupActionSigners message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.IGroupActionSigners} message GroupActionSigners message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupActionSigners.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupActionSigners message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigners.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.signers && message.signers.length)) + message.signers = []; + message.signers.push($root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupActionSigners message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupActionSigners.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupActionSigners message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupActionSigners.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signers != null && message.hasOwnProperty("signers")) { + if (!Array.isArray(message.signers)) + return "signers: array expected"; + for (var i = 0; i < message.signers.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.verify(message.signers[i]); + if (error) + return "signers." + error; + } + } + return null; + }; + + /** + * Creates a GroupActionSigners message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} GroupActionSigners + */ + GroupActionSigners.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners(); + if (object.signers) { + if (!Array.isArray(object.signers)) + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: array expected"); + message.signers = []; + for (var i = 0; i < object.signers.length; ++i) { + if (typeof object.signers[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners.signers: object expected"); + message.signers[i] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.fromObject(object.signers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupActionSigners message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @static + * @param {org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners} message GroupActionSigners + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupActionSigners.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.signers = []; + if (message.signers && message.signers.length) { + object.signers = []; + for (var j = 0; j < message.signers.length; ++j) + object.signers[j] = $root.org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigner.toObject(message.signers[j], options); + } + return object; + }; + + /** + * Converts this GroupActionSigners to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetGroupActionSignersResponse.GetGroupActionSignersResponseV0.GroupActionSigners + * @instance + * @returns {Object.} JSON object + */ + GroupActionSigners.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupActionSigners; + })(); + + return GetGroupActionSignersResponseV0; + })(); + + return GetGroupActionSignersResponse; + })(); + + return v0; + })(); + + return dapi; + })(); + + return platform; + })(); + + return dash; + })(); + + return org; +})(); + +$root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BytesValue; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = 0; + + /** + * Value numberValue. + * @member {number} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = 0; + + /** + * Value stringValue. + * @member {string} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = ""; + + /** + * Value boolValue. + * @member {boolean} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = false; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nullValue = reader.int32(); + break; + case 2: + message.numberValue = reader.double(); + break; + case 3: + message.stringValue = reader.string(); + break; + case 4: + message.boolValue = reader.bool(); + break; + case 5: + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 6: + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + return google; +})(); + module.exports = $root; diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h index 45bc51184ea..f7397bd9ed6 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h @@ -5506,6 +5506,10 @@ typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_Version_OneOfCase) { GetTokenDirectPurchasePricesResponse_Version_OneOfCase_V0 = 1, }; +/** + * Response to GetTokenDirectPurchasePricesRequest, containing information about + * direct purchase prices defined for requested token IDs. + **/ GPB_FINAL @interface GetTokenDirectPurchasePricesResponse : GPBMessage @property(nonatomic, readonly) GetTokenDirectPurchasePricesResponse_Version_OneOfCase versionOneOfCase; @@ -5537,10 +5541,16 @@ GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchase @property(nonatomic, readonly) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_Result_OneOfCase resultOneOfCase; +/** Contains the list of token IDs and their corresponding direct */ @property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices *tokenDirectPurchasePrices; +/** + * Requested information in a form of cryptographic proof. + * In Rust, use `FromProof` trait to convert it to the actual data. + **/ @property(nonatomic, readwrite, strong, null_resettable) Proof *proof; +/** Metadata about the blockchain state. */ @property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; /** Test to see if @c metadata has been set. */ @property(nonatomic, readwrite) BOOL hasMetadata; @@ -5559,10 +5569,15 @@ typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePric GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity_FieldNumber_Price = 2, }; +/** + * Contains the individual price tier for a specific quantity of tokens. + **/ GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PriceForQuantity : GPBMessage +/** Minimum quantity of tokens to purchase to get this price. */ @property(nonatomic, readwrite) uint64_t quantity; +/** Price for the specified quantity of tokens. */ @property(nonatomic, readwrite) uint64_t price; @end @@ -5573,6 +5588,9 @@ typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePric GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule_FieldNumber_PriceForQuantityArray = 1, }; +/** + * Contains list of price tiers for a specific token. + **/ GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule : GPBMessage @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *priceForQuantityArray; @@ -5597,13 +5615,19 @@ typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePric GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry : GPBMessage +/** 32-byte token identifier */ @property(nonatomic, readwrite, copy, null_resettable) NSData *tokenId; /** Price of the token; optional */ @property(nonatomic, readonly) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePriceEntry_Price_OneOfCase priceOneOfCase; +/** Fixed price for the token. */ @property(nonatomic, readwrite) uint64_t fixedPrice; +/** + * Tiered pricing for the token, where the price varies based on the + * quantity purchased. + **/ @property(nonatomic, readwrite, strong, null_resettable) GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_PricingSchedule *variablePrice; @end @@ -5619,6 +5643,10 @@ typedef GPB_ENUM(GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePric GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices_FieldNumber_TokenDirectPurchasePriceArray = 1, }; +/** + * For each requested token, contains list of token IDs and their + * corresponding direct purchase prices. + **/ GPB_FINAL @interface GetTokenDirectPurchasePricesResponse_GetTokenDirectPurchasePricesResponseV0_TokenDirectPurchasePrices : GPBMessage @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenDirectPurchasePriceArray; @@ -5638,6 +5666,14 @@ typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_Version_OneOfCase) { GetTokenDirectPurchasePricesRequest_Version_OneOfCase_V0 = 1, }; +/** + * Retrieve direct purchase prices defined for one or more tokens. + * + * Some tokens can have a direct purchase price defined using + * `TokenSetPriceForDirectPurchaseTransition` (see `dpp` crate for details). + * This request retrieves the direct purchase prices for those tokens and + * returns [GetTokenDirectPurchasePricesResponse]. + **/ GPB_FINAL @interface GetTokenDirectPurchasePricesRequest : GPBMessage @property(nonatomic, readonly) GetTokenDirectPurchasePricesRequest_Version_OneOfCase versionOneOfCase; @@ -5660,10 +5696,18 @@ typedef GPB_ENUM(GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePrice GPB_FINAL @interface GetTokenDirectPurchasePricesRequest_GetTokenDirectPurchasePricesRequestV0 : GPBMessage +/** + * List of token IDs to get prices for. + * + * The list must not be empty. + * Token IDs must have 32 bytes and be unique. + * Results for non-unique token IDs are undefined. + **/ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *tokenIdsArray; /** The number of items in @c tokenIdsArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger tokenIdsArray_Count; +/** Whether to return proofs for the response, or just direct response. */ @property(nonatomic, readwrite) BOOL prove; @end From 920f1f506979f8073ee2fbddcd898ecc3c682d11 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 16 Apr 2025 19:46:50 +0700 Subject: [PATCH 32/32] changed version parameter --- .../fetch_tokens_direct_purchase_price/mod.rs | 8 +++++++- .../prove_tokens_direct_purchase_price/mod.rs | 8 +++++++- .../drive_versions/drive_token_method_versions/mod.rs | 2 ++ .../drive_versions/drive_token_method_versions/v1.rs | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs index e35139480c4..73e355c678d 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/fetch_tokens_direct_purchase_price/mod.rs @@ -30,7 +30,13 @@ impl Drive { transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result>, Error> { - match platform_version.drive.methods.token.fetch.token_statuses { + match platform_version + .drive + .methods + .token + .fetch + .token_direct_purchase_prices + { 0 => { self.fetch_tokens_direct_purchase_price_v0(token_ids, transaction, platform_version) } diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/mod.rs index d760fdc6869..c57956dc0fc 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/prove_tokens_direct_purchase_price/mod.rs @@ -28,7 +28,13 @@ impl Drive { transaction: TransactionArg, platform_version: &PlatformVersion, ) -> Result, Error> { - match platform_version.drive.methods.token.prove.token_statuses { + match platform_version + .drive + .methods + .token + .prove + .token_direct_purchase_prices + { 0 => { self.prove_tokens_direct_purchase_price_v0(token_ids, transaction, platform_version) } diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/mod.rs b/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/mod.rs index db20e4365c3..344f2486a94 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/mod.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/mod.rs @@ -35,6 +35,7 @@ pub struct DriveTokenFetchMethodVersions { pub perpetual_distribution_last_paid_time: FeatureVersion, pub pre_programmed_distribution_last_paid_time: FeatureVersion, pub token_direct_purchase_price: FeatureVersion, + pub token_direct_purchase_prices: FeatureVersion, } #[derive(Clone, Debug, Default)] @@ -48,6 +49,7 @@ pub struct DriveTokenProveMethodVersions { pub token_statuses: FeatureVersion, pub total_supply_and_aggregated_identity_balances: FeatureVersion, pub pre_programmed_distributions: FeatureVersion, + pub token_direct_purchase_prices: FeatureVersion, } #[derive(Clone, Debug, Default)] diff --git a/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/v1.rs b/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/v1.rs index 257fb1eedce..030e0b7b528 100644 --- a/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/v1.rs +++ b/packages/rs-platform-version/src/version/drive_versions/drive_token_method_versions/v1.rs @@ -19,6 +19,7 @@ pub const DRIVE_TOKEN_METHOD_VERSIONS_V1: DriveTokenMethodVersions = DriveTokenM perpetual_distribution_last_paid_time: 0, pre_programmed_distribution_last_paid_time: 0, token_direct_purchase_price: 0, + token_direct_purchase_prices: 0, }, prove: DriveTokenProveMethodVersions { identity_token_balance: 0, @@ -30,6 +31,7 @@ pub const DRIVE_TOKEN_METHOD_VERSIONS_V1: DriveTokenMethodVersions = DriveTokenM token_statuses: 0, total_supply_and_aggregated_identity_balances: 0, pre_programmed_distributions: 0, + token_direct_purchase_prices: 0, }, update: DriveTokenUpdateMethodVersions { create_token_trees: 0,